Patch "KVM: x86: Do not change ICR on write to APIC_SELF_IPI" has been added to the 4.19-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: x86: Do not change ICR on write to APIC_SELF_IPI

to the 4.19-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-x86-do-not-change-icr-on-write-to-apic_self_ipi.patch
and it can be found in the queue-4.19 subdirectory.

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



commit 1013ff7442f5bb83000ba62161d5b8fdb1342023
Author: Paolo Bonzini <pbonzini@xxxxxxxxxx>
Date:   Thu Feb 24 09:53:36 2022 -0500

    KVM: x86: Do not change ICR on write to APIC_SELF_IPI
    
    [ Upstream commit d22a81b304a27fca6124174a8e842e826c193466 ]
    
    Emulating writes to SELF_IPI with a write to ICR has an unwanted side effect:
    the value of ICR in vAPIC page gets changed.  The lists SELF_IPI as write-only,
    with no associated MMIO offset, so any write should have no visible side
    effect in the vAPIC page.
    
    Reported-by: Chao Gao <chao.gao@xxxxxxxxx>
    Reviewed-by: Sean Christopherson <seanjc@xxxxxxxxxx>
    Signed-off-by: Paolo Bonzini <pbonzini@xxxxxxxxxx>
    Stable-dep-of: ba5838abb053 ("KVM: x86: Inject #GP if WRMSR sets reserved bits in APIC Self-IPI")
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index 81801b0c24e9a..47d25a696588e 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -1920,10 +1920,9 @@ int kvm_lapic_reg_write(struct kvm_lapic *apic, u32 reg, u32 val)
 		break;
 
 	case APIC_SELF_IPI:
-		if (apic_x2apic_mode(apic)) {
-			kvm_lapic_reg_write(apic, APIC_ICR,
-					    APIC_DEST_SELF | (val & APIC_VECTOR_MASK));
-		} else
+		if (apic_x2apic_mode(apic))
+			kvm_apic_send_ipi(apic, APIC_DEST_SELF | (val & APIC_VECTOR_MASK), 0);
+		else
 			ret = 1;
 		break;
 	default:



[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