diff options
author | Sean Christopherson <seanjc@google.com> | 2023-07-21 13:18:48 -0700 |
---|---|---|
committer | Sean Christopherson <seanjc@google.com> | 2023-08-03 15:37:14 -0700 |
commit | 261cd5ed934e6923187cf1c9eaa6cb63f2b81212 (patch) | |
tree | cbcaeaba2153745a6407923778d6703f60fcfd57 /arch/x86/kernel/reboot.c | |
parent | x86/reboot: Disable virtualization during reboot iff callback is registered (diff) | |
download | wireguard-linux-261cd5ed934e6923187cf1c9eaa6cb63f2b81212.tar.xz wireguard-linux-261cd5ed934e6923187cf1c9eaa6cb63f2b81212.zip |
x86/reboot: Expose VMCS crash hooks if and only if KVM_{INTEL,AMD} is enabled
Expose the crash/reboot hooks used by KVM to disable virtualization in
hardware and unblock INIT only if there's a potential in-tree user,
i.e. either KVM_INTEL or KVM_AMD is enabled.
Reviewed-by: Kai Huang <kai.huang@intel.com>
Link: https://lore.kernel.org/r/20230721201859.2307736-9-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'arch/x86/kernel/reboot.c')
-rw-r--r-- | arch/x86/kernel/reboot.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c index 98e5db3fd7f4..830425e6d38e 100644 --- a/arch/x86/kernel/reboot.c +++ b/arch/x86/kernel/reboot.c @@ -529,6 +529,7 @@ static inline void kb_wait(void) static inline void nmi_shootdown_cpus_on_restart(void); +#if IS_ENABLED(CONFIG_KVM_INTEL) || IS_ENABLED(CONFIG_KVM_AMD) /* RCU-protected callback to disable virtualization prior to reboot. */ static cpu_emergency_virt_cb __rcu *cpu_emergency_virt_callback; @@ -596,7 +597,9 @@ static void emergency_reboot_disable_virtualization(void) nmi_shootdown_cpus_on_restart(); } } - +#else +static void emergency_reboot_disable_virtualization(void) { } +#endif /* CONFIG_KVM_INTEL || CONFIG_KVM_AMD */ void __attribute__((weak)) mach_reboot_fixups(void) { |