Commit e956ee94 authored by Roman Kisel's avatar Roman Kisel Committed by Wei Liu
Browse files

arm64, x86: hyperv: Report the VTL the system boots in



The hyperv guest code might run in various Virtual Trust Levels.

Report the level when the kernel boots in the non-default (0)
one.

Signed-off-by: default avatarRoman Kisel <romank@linux.microsoft.com>
Reviewed-by: default avatarMichael Kelley <mhklinux@outlook.com>
Link: https://lore.kernel.org/r/20250428210742.435282-7-romank@linux.microsoft.com


Signed-off-by: default avatarWei Liu <wei.liu@kernel.org>
Message-ID: <20250428210742.435282-7-romank@linux.microsoft.com>
parent 1f5538a8
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -118,6 +118,8 @@ static int __init hyperv_init(void)
	if (ms_hyperv.priv_high & HV_ACCESS_PARTITION_ID)
		hv_get_partition_id();
	ms_hyperv.vtl = get_vtl();
	if (ms_hyperv.vtl > 0) /* non default VTL */
		pr_info("Linux runs in Hyper-V Virtual Trust Level %d\n", ms_hyperv.vtl);

	ms_hyperv_late_init();

+6 −1
Original line number Diff line number Diff line
@@ -55,7 +55,12 @@ static void __noreturn hv_vtl_restart(char __maybe_unused *cmd)

void __init hv_vtl_init_platform(void)
{
	pr_info("Linux runs in Hyper-V Virtual Trust Level\n");
	/*
	 * This function is a no-op if the VTL mode is not enabled.
	 * If it is, this function runs if and only the kernel boots in
	 * VTL2 which the x86 hv initialization path makes sure of.
	 */
	pr_info("Linux runs in Hyper-V Virtual Trust Level %d\n", ms_hyperv.vtl);

	x86_platform.realmode_reserve = x86_init_noop;
	x86_platform.realmode_init = x86_init_noop;