KVM: SVM: Delete IRTE link from previous vCPU before setting new IRTE

Delete the previous per-vCPU IRTE link prior to modifying the IRTE.  If
forcing the IRTE back to remapped mode fails, the IRQ is already broken;
keeping stale metadata won't change that, and the IOMMU should be
sufficiently paranoid to sanitize the IRTE when the IRQ is freed and
reallocated.

This will allow hoisting the vCPU tracking to common x86, which in turn
will allow most of the IRTE update code to be deduplicated.

Tested-by: Sairaj Kodilkar <sarunkod@amd.com>
Link: https://lore.kernel.org/r/20250611224604.313496-7-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
This commit is contained in:
Sean Christopherson
2025-06-11 15:45:08 -07:00
parent 05c5e23657
commit 0a917e9d4b
2 changed files with 14 additions and 47 deletions

View File

@@ -60,6 +60,7 @@ struct kvm_kernel_irqfd {
struct irq_bypass_consumer consumer;
struct irq_bypass_producer *producer;
struct kvm_vcpu *irq_bypass_vcpu;
struct list_head vcpu_list;
void *irq_bypass_data;
};