mirror_ubuntu-kernels/arch/x86/kvm/svm
Sean Christopherson b652de1e3d KVM: SVM: Disable preemption across AVIC load/put during APICv refresh
Disable preemption when loading/putting the AVIC during an APICv refresh.
If the vCPU task is preempted and migrated ot a different pCPU, the
unprotected avic_vcpu_load() could set the wrong pCPU in the physical ID
cache/table.

Pull the necessary code out of avic_vcpu_{,un}blocking() and into a new
helper to reduce the probability of introducing this exact bug a third
time.

Fixes: df7e4827c5 ("KVM: SVM: call avic_vcpu_load/avic_vcpu_put when enabling/disabling AVIC")
Cc: stable@vger.kernel.org
Reported-by: Maxim Levitsky <mlevitsk@redhat.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-03-01 12:21:23 -05:00
..
avic.c KVM: SVM: Disable preemption across AVIC load/put during APICv refresh 2022-03-01 12:21:23 -05:00
hyperv.h KVM: nSVM: Split off common definitions for Hyper-V on KVM and KVM on Hyper-V 2022-02-10 13:50:45 -05:00
nested.c KVM: x86/mmu: load new PGD after the shadow MMU is initialized 2022-02-25 08:20:18 -05:00
pmu.c KVM: x86: Provide per VM capability for disabling PMU virtualization 2022-02-25 08:20:14 -05:00
sev.c KVM: SVM: Exit to userspace on ENOMEM/EFAULT GHCB errors 2022-03-01 10:04:03 -05:00
svm_onhyperv.c KVM: SVM: hyper-v: Direct Virtual Flush support 2021-06-17 13:09:38 -04:00
svm_onhyperv.h KVM: nSVM: Split off common definitions for Hyper-V on KVM and KVM on Hyper-V 2022-02-10 13:50:45 -05:00
svm_ops.h x86/kvm: Always inline vmload() / vmsave() 2021-09-15 15:51:45 +02:00
svm.c KVM: SVM: Disable preemption across AVIC load/put during APICv refresh 2022-03-01 12:21:23 -05:00
svm.h KVM: SVM: Disable preemption across AVIC load/put during APICv refresh 2022-03-01 12:21:23 -05:00
vmenter.S x86: Prepare asm files for straight-line-speculation 2021-12-08 12:25:37 +01:00