[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20221201232655.290720-5-seanjc@google.com>
Date: Thu, 1 Dec 2022 23:26:43 +0000
From: Sean Christopherson <seanjc@...gle.com>
To: Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
Sean Christopherson <seanjc@...gle.com>,
Paolo Bonzini <pbonzini@...hat.com>
Cc: "H. Peter Anvin" <hpa@...or.com>, linux-kernel@...r.kernel.org,
kvm@...r.kernel.org, Andrew Cooper <Andrew.Cooper3@...rix.com>
Subject: [PATCH 04/16] x86/reboot: Assert that IRQs are disabled when turning
off virtualization
Assert that IRQs are disabled when turning off virtualization in an
emergency. KVM enables hardware via on_each_cpu(), i.e. could re-enable
hardware if a pending IPI were delivered after disabling virtualization.
Signed-off-by: Sean Christopherson <seanjc@...gle.com>
---
arch/x86/kernel/reboot.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
index 78182b2969db..40ea16ecb3b8 100644
--- a/arch/x86/kernel/reboot.c
+++ b/arch/x86/kernel/reboot.c
@@ -838,6 +838,8 @@ int crashing_cpu = -1;
*/
void cpu_emergency_disable_virtualization(void)
{
+ lockdep_assert_irqs_disabled();
+
#if IS_ENABLED(CONFIG_KVM_INTEL)
cpu_crash_vmclear_loaded_vmcss();
#endif
--
2.39.0.rc0.267.gcb52ba06e7-goog
Powered by blists - more mailing lists