]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
KVM: SVM: Take and hold ir_list_lock across IRTE updates in IOMMU
authorSean Christopherson <seanjc@google.com>
Wed, 11 Jun 2025 22:45:41 +0000 (15:45 -0700)
committerSean Christopherson <seanjc@google.com>
Mon, 23 Jun 2025 16:50:36 +0000 (09:50 -0700)
commitc3d591c91f9c99a35f8cf80d28ea689214a1acf3
tree3212d97b9877ede9ecdda301210e69f6212024f1
parent71d6b3b8e69d8a212c53df1150e559b101d6768b
KVM: SVM: Take and hold ir_list_lock across IRTE updates in IOMMU

Now that svm_ir_list_add() isn't overloaded with all manner of weird
things, fold it into avic_pi_update_irte(), and more importantly take
ir_list_lock across the irq_set_vcpu_affinity() calls to ensure the info
that's shoved into the IRTE is fresh.  While preemption (and IRQs) is
disabled on the task performing the IRTE update, thanks to irqfds.lock,
that task doesn't hold the vCPU's mutex, i.e. preemption being disabled
is irrelevant.

Link: https://lore.kernel.org/r/20250611224604.313496-40-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/svm/avic.c