aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/hyperv
diff options
context:
space:
mode:
authorRoman Kisel <romank@linux.microsoft.com>2025-04-28 14:07:37 -0700
committerWei Liu <wei.liu@kernel.org>2025-05-23 16:30:55 +0000
commite956ee9491d90c4107ca6e7c4f2210d806c89f9b (patch)
tree43d71761e446274340f7f3344f762b20226c9171 /arch/x86/hyperv
parentarm64: hyperv: Initialize the Virtual Trust Level field (diff)
downloadlinux-e956ee9491d90c4107ca6e7c4f2210d806c89f9b.tar.gz
linux-e956ee9491d90c4107ca6e7c4f2210d806c89f9b.zip
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: Roman Kisel <romank@linux.microsoft.com> Reviewed-by: Michael Kelley <mhklinux@outlook.com> Link: https://lore.kernel.org/r/20250428210742.435282-7-romank@linux.microsoft.com Signed-off-by: Wei Liu <wei.liu@kernel.org> Message-ID: <20250428210742.435282-7-romank@linux.microsoft.com>
Diffstat (limited to 'arch/x86/hyperv')
-rw-r--r--arch/x86/hyperv/hv_vtl.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/x86/hyperv/hv_vtl.c b/arch/x86/hyperv/hv_vtl.c
index 13242ed8ff16..ac3d27a766d5 100644
--- a/arch/x86/hyperv/hv_vtl.c
+++ b/arch/x86/hyperv/hv_vtl.c
@@ -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;