Patch "KVM: nVMX: Ignore SIPI that arrives in L2 when vCPU is not in WFS" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    KVM: nVMX: Ignore SIPI that arrives in L2 when vCPU is not in WFS

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     kvm-nvmx-ignore-sipi-that-arrives-in-l2-when-vcpu-is.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 51b10feea42fbc06adb530d6ff180f2ab0473d48
Author: Sean Christopherson <seanjc@xxxxxxxxxx>
Date:   Tue Aug 30 23:15:57 2022 +0000

    KVM: nVMX: Ignore SIPI that arrives in L2 when vCPU is not in WFS
    
    [ Upstream commit c2086eca86585bfd8132dd91e802497a202185c8 ]
    
    Fall through to handling other pending exception/events for L2 if SIPI
    is pending while the CPU is not in Wait-for-SIPI.  KVM correctly ignores
    the event, but incorrectly returns immediately, e.g. a SIPI coincident
    with another event could lead to KVM incorrectly routing the event to L1
    instead of L2.
    
    Fixes: bf0cd88ce363 ("KVM: x86: emulate wait-for-SIPI and SIPI-VMExit")
    Signed-off-by: Sean Christopherson <seanjc@xxxxxxxxxx>
    Reviewed-by: Maxim Levitsky <mlevitsk@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20220830231614.3580124-11-seanjc@xxxxxxxxxx
    Signed-off-by: Paolo Bonzini <pbonzini@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c
index f28085b89f47..94b4b3d306ce 100644
--- a/arch/x86/kvm/vmx/nested.c
+++ b/arch/x86/kvm/vmx/nested.c
@@ -3931,10 +3931,12 @@ static int vmx_check_nested_events(struct kvm_vcpu *vcpu)
 			return -EBUSY;
 
 		clear_bit(KVM_APIC_SIPI, &apic->pending_events);
-		if (vcpu->arch.mp_state == KVM_MP_STATE_INIT_RECEIVED)
+		if (vcpu->arch.mp_state == KVM_MP_STATE_INIT_RECEIVED) {
 			nested_vmx_vmexit(vcpu, EXIT_REASON_SIPI_SIGNAL, 0,
 						apic->sipi_vector & 0xFFUL);
-		return 0;
+			return 0;
+		}
+		/* Fallthrough, the SIPI is completely ignored. */
 	}
 
 	/*



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux