]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
x86/reboot: VMCLEAR active VMCSes before emergency reboot
authorSean Christopherson <seanjc@google.com>
Fri, 21 Jul 2023 20:18:41 +0000 (13:18 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Oct 2023 12:56:50 +0000 (14:56 +0200)
commit1375d9600c38c231163de584656b07aef9a27b0d
tree90a43be2748e5a6bdc8fbee92f721a07d3b6d842
parent85fafa7ef0ac44959fd8ec156da6eaf4bb2a0345
x86/reboot: VMCLEAR active VMCSes before emergency reboot

[ Upstream commit b23c83ad2c638420ec0608a9de354507c41bec29 ]

VMCLEAR active VMCSes before any emergency reboot, not just if the kernel
may kexec into a new kernel after a crash.  Per Intel's SDM, the VMX
architecture doesn't require the CPU to flush the VMCS cache on INIT.  If
an emergency reboot doesn't RESET CPUs, cached VMCSes could theoretically
be kept and only be written back to memory after the new kernel is booted,
i.e. could effectively corrupt memory after reboot.

Opportunistically remove the setting of the global pointer to NULL to make
checkpatch happy.

Cc: Andrew Cooper <Andrew.Cooper3@citrix.com>
Link: https://lore.kernel.org/r/20230721201859.2307736-2-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/x86/include/asm/kexec.h
arch/x86/include/asm/reboot.h
arch/x86/kernel/crash.c
arch/x86/kernel/reboot.c
arch/x86/kvm/vmx/vmx.c