summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/pmu.c
diff options
context:
space:
mode:
authorMaxim Levitsky <mlevitsk@redhat.com>2022-02-08 06:48:42 -0500
committerPaolo Bonzini <pbonzini@redhat.com>2022-02-11 12:53:02 -0500
commit66fa226c131fb89287f8f7d004a46e39a859fbf6 (patch)
treee4cef04d0981cbbf4128773c7a76435ff5a0e07e /arch/x86/kvm/pmu.c
parent30811174f0dbe17fd58eba5c22c50292c083c75b (diff)
downloadlinux-stable-66fa226c131fb89287f8f7d004a46e39a859fbf6.tar.gz
linux-stable-66fa226c131fb89287f8f7d004a46e39a859fbf6.tar.bz2
linux-stable-66fa226c131fb89287f8f7d004a46e39a859fbf6.zip
KVM: SVM: fix race between interrupt delivery and AVIC inhibition
If svm_deliver_avic_intr is called just after the target vcpu's AVIC got inhibited, it might read a stale value of vcpu->arch.apicv_active which can lead to the target vCPU not noticing the interrupt. To fix this use load-acquire/store-release so that, if the target vCPU is IN_GUEST_MODE, we're guaranteed to see a previous disabling of the AVIC. If AVIC has been disabled in the meanwhile, proceed with the KVM_REQ_EVENT-based delivery. Incomplete IPI vmexit has the same races as svm_deliver_avic_intr, and in fact it can be handled in exactly the same way; the only difference lies in who has set IRR, whether svm_deliver_interrupt or the processor. Therefore, svm_complete_interrupt_delivery can be used to fix incomplete IPI vmexits as well. Co-developed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/pmu.c')
0 files changed, 0 insertions, 0 deletions