Skip to content

Commit 6ae44e0

Browse files
committed
KVM: x86: Force kvm_rebooting=true during emergency reboot/crash
Set kvm_rebooting when virtualization is disabled in an emergency so that KVM eats faults on virtualization instructions even if kvm_reboot() isn't reached. Reviewed-by: Kai Huang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sean Christopherson <[email protected]>
1 parent 76ab816 commit 6ae44e0

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

arch/x86/kvm/svm/svm.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,8 @@ static inline void kvm_cpu_svm_disable(void)
605605

606606
static void svm_emergency_disable(void)
607607
{
608+
kvm_rebooting = true;
609+
608610
kvm_cpu_svm_disable();
609611
}
610612

arch/x86/kvm/vmx/vmx.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -752,6 +752,8 @@ static void vmx_emergency_disable(void)
752752
int cpu = raw_smp_processor_id();
753753
struct loaded_vmcs *v;
754754

755+
kvm_rebooting = true;
756+
755757
list_for_each_entry(v, &per_cpu(loaded_vmcss_on_cpu, cpu),
756758
loaded_vmcss_on_cpu_link)
757759
vmcs_clear(v->vmcs);

0 commit comments

Comments
 (0)