[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20250117210702.1529580-3-romank@linux.microsoft.com>
Date: Fri, 17 Jan 2025 13:07:02 -0800
From: Roman Kisel <romank@...ux.microsoft.com>
To: bp@...en8.de,
dave.hansen@...ux.intel.com,
decui@...rosoft.com,
haiyangz@...rosoft.com,
hpa@...or.com,
kys@...rosoft.com,
mingo@...hat.com,
ssengar@...ux.microsoft.com,
tglx@...utronix.de,
wei.liu@...nel.org,
linux-hyperv@...r.kernel.org,
linux-kernel@...r.kernel.org,
x86@...nel.org
Cc: apais@...rosoft.com,
benhill@...rosoft.com,
sunilmut@...rosoft.com,
vdso@...bites.dev
Subject: [PATCH hyperv-next 2/2] x86/hyperv: VTL mode callback for restarting the system
The kernel runs as a firmware in the VTL mode, and the only way
to restart on x86 is to triple fault. Thus, one has to always
supply "reboot=t" on the kernel command line, and missing that
renders rebooting not working.
Define the machine restart callback to always use the triple
fault to provide the robust configuration by default.
Cc: stable@...r.kernel.org
Signed-off-by: Roman Kisel <romank@...ux.microsoft.com>
---
arch/x86/hyperv/hv_vtl.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/arch/x86/hyperv/hv_vtl.c b/arch/x86/hyperv/hv_vtl.c
index 8931fc186a5f..eb402362d738 100644
--- a/arch/x86/hyperv/hv_vtl.c
+++ b/arch/x86/hyperv/hv_vtl.c
@@ -44,6 +44,12 @@ static void __noreturn hv_vtl_emergency_restart(void)
}
}
+/* The only way to restart is triple fault */
+static void __noreturn hv_vtl_restart(char *)
+{
+ hv_vtl_emergency_restart();
+}
+
void __init hv_vtl_init_platform(void)
{
pr_info("Linux runs in Hyper-V Virtual Trust Level\n");
@@ -269,6 +275,7 @@ int __init hv_vtl_early_init(void)
apic_update_callback(wakeup_secondary_cpu_64, hv_vtl_wakeup_secondary_cpu);
machine_ops.emergency_restart = hv_vtl_emergency_restart;
+ machine_ops.restart = hv_vtl_restart;
return 0;
}
--
2.34.1
Powered by blists - more mailing lists