]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
x86/reboot: KVM: Handle VMXOFF in KVM's reboot callback
authorSean Christopherson <seanjc@google.com>
Thu, 24 Jul 2025 17:07:24 +0000 (13:07 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Aug 2025 14:26:13 +0000 (16:26 +0200)
commit4bbf1931a33e49730185ed45a4d3a7fcc4ec7b42
tree887969cece30a661aff526edaffb38b6a40391d1
parent9aa5d870967b3472e410dbbbd682890fdf8ab448
x86/reboot: KVM: Handle VMXOFF in KVM's reboot callback

[ Upstream commit 119b5cb4ffd0166f3e98e9ee042f5046f7744f28 ]

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>
Stable-dep-of: a0ee1d5faff1 ("KVM: VMX: Flush shadow VMCS on emergency reboot")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/include/asm/virtext.h
arch/x86/kernel/reboot.c
arch/x86/kvm/vmx/vmx.c