Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

x86/hyperv: Add VTL mode callback for restarting the system

The kernel runs as a firmware in the VTL mode, and the only way
to restart in the VTL mode on x86 is to triple fault. Thus, one
has to always supply "reboot=t" on the kernel command line in the
VTL mode, 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.

Signed-off-by: Roman Kisel <romank@linux.microsoft.com>
Link: https://lore.kernel.org/r/20250227214728.15672-3-romank@linux.microsoft.com
Signed-off-by: Wei Liu <wei.liu@kernel.org>
Message-ID: <20250227214728.15672-3-romank@linux.microsoft.com>

authored by

Roman Kisel and committed by
Wei Liu
07b74192 ced518ad

+11
+11
arch/x86/hyperv/hv_vtl.c
··· 44 44 } 45 45 } 46 46 47 + /* 48 + * The only way to restart in the VTL mode is to triple fault as the kernel runs 49 + * as firmware. 50 + */ 51 + static void __noreturn hv_vtl_restart(char __maybe_unused *cmd) 52 + { 53 + hv_vtl_emergency_restart(); 54 + } 55 + 47 56 void __init hv_vtl_init_platform(void) 48 57 { 49 58 pr_info("Linux runs in Hyper-V Virtual Trust Level\n"); ··· 267 258 int __init hv_vtl_early_init(void) 268 259 { 269 260 machine_ops.emergency_restart = hv_vtl_emergency_restart; 261 + machine_ops.restart = hv_vtl_restart; 262 + 270 263 /* 271 264 * `boot_cpu_has` returns the runtime feature support, 272 265 * and here is the earliest it can be used.