x86/reboot: KVM: Handle VMXOFF in KVM's reboot callback
authorSean Christopherson <seanjc@google.com>
Fri, 21 Jul 2023 20:18:43 +0000 (13:18 -0700)
committerSean Christopherson <seanjc@google.com>
Thu, 3 Aug 2023 22:37:14 +0000 (15:37 -0700)
commit119b5cb4ffd0166f3e98e9ee042f5046f7744f28
tree06589a358bee13b5b6bae25c3ce159f191f71ea0
parent5e408396c60cd0f0b53a43713016b6d6af8d69e0
x86/reboot: KVM: Handle VMXOFF in KVM's reboot callback

Use KVM VMX's reboot/crash callback to do VMXOFF in an emergency instead
of manually and blindly doing VMXOFF.  There's no need to attempt VMXOFF
if a hypervisor, i.e. KVM, isn't loaded/active, i.e. if the CPU can't
possibly be post-VMXON.

Reviewed-by: Kai Huang <kai.huang@intel.com>
Link: https://lore.kernel.org/r/20230721201859.2307736-4-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/include/asm/virtext.h
arch/x86/kernel/reboot.c
arch/x86/kvm/vmx/vmx.c