[Devel] [PATCH RHEL9 COMMIT] ms/x86/reboot: Disable SVM, not just VMX, when stopping CPUs

Konstantin Khorenko khorenko at virtuozzo.com
Wed Nov 1 16:42:32 MSK 2023


The commit is pushed to "branch-rh9-5.14.0-284.25.1.vz9.30.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh9-5.14.0-284.25.1.vz9.30.6
------>
commit 025904b9457801bac5e4c6368384926cacc38d81
Author: Maxim Levitsky <mlevitsk at redhat.com>
Date:   Mon May 1 10:12:17 2023 +0300

    ms/x86/reboot: Disable SVM, not just VMX, when stopping CPUs
    
    Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2177720
    
    commit a2b07fa7b93321c059af0c6d492cc9a4f1e390aa
    Author: Sean Christopherson <seanjc at google.com>
    Date:   Wed Nov 30 23:36:50 2022 +0000
    
        x86/reboot: Disable SVM, not just VMX, when stopping CPUs
    
        Disable SVM and more importantly force GIF=1 when halting a CPU or
        rebooting the machine.  Similar to VMX, SVM allows software to block
        INITs via CLGI, and thus can be problematic for a crash/reboot.  The
        window for failure is smaller with SVM as INIT is only blocked while
        GIF=0, i.e. between CLGI and STGI, but the window does exist.
    
        Fixes: fba4f472b33a ("x86/reboot: Turn off KVM when halting a CPU")
        Cc: stable at vger.kernel.org
        Reviewed-by: Thomas Gleixner <tglx at linutronix.de>
        Link: https://lore.kernel.org/r/20221130233650.1404148-5-seanjc@google.com
        Signed-off-by: Sean Christopherson <seanjc at google.com>
    
    Signed-off-by: Maxim Levitsky <mlevitsk at redhat.com>
    
    (cherry picked from CentOS 9 Stream commit 15bab493bef9)
    https://pmc.acronis.work/browse/VSTOR-76102
    Signed-off-by: Konstantin Khorenko <khorenko at virtuozzo.com>
    
    Feature: fix ms/KVM
---
 arch/x86/kernel/smp.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/smp.c b/arch/x86/kernel/smp.c
index 06db901fabe8..375b33ecafa2 100644
--- a/arch/x86/kernel/smp.c
+++ b/arch/x86/kernel/smp.c
@@ -32,7 +32,7 @@
 #include <asm/mce.h>
 #include <asm/trace/irq_vectors.h>
 #include <asm/kexec.h>
-#include <asm/virtext.h>
+#include <asm/reboot.h>
 
 /*
  *	Some notes on x86 processor bugs affecting SMP operation:
@@ -122,7 +122,7 @@ static int smp_stop_nmi_callback(unsigned int val, struct pt_regs *regs)
 	if (raw_smp_processor_id() == atomic_read(&stopping_cpu))
 		return NMI_HANDLED;
 
-	cpu_emergency_vmxoff();
+	cpu_emergency_disable_virtualization();
 	stop_this_cpu(NULL);
 
 	return NMI_HANDLED;
@@ -134,7 +134,7 @@ static int smp_stop_nmi_callback(unsigned int val, struct pt_regs *regs)
 DEFINE_IDTENTRY_SYSVEC(sysvec_reboot)
 {
 	ack_APIC_irq();
-	cpu_emergency_vmxoff();
+	cpu_emergency_disable_virtualization();
 	stop_this_cpu(NULL);
 }
 


More information about the Devel mailing list