Commit ee6ee49f authored by Keith Busch's avatar Keith Busch Committed by Bjorn Helgaas

x86/PCI: VMD: Synchronize with RCU freeing MSI IRQ descs

Fix a potential race when disabling MSI/MSI-X on a VMD domain device.  If
the VMD interrupt service is running, it may see a disabled IRQ.  We can
synchronize RCU just before freeing the MSI descriptor.  This is safe since
the irq_desc lock isn't held, and the descriptor is valid even though it is
disabled.  After vmd_msi_free(), though, the handler is reinitialized to
handle_bad_irq(), so we can't let the VMD ISR's list iteration see the
disabled IRQ after this.
Signed-off-by: default avatarKeith Busch <keith.busch@intel.com>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Acked-by Jon Derrick: <jonathan.derrick@intel.com>
parent b3182227
...@@ -218,6 +218,8 @@ static void vmd_msi_free(struct irq_domain *domain, ...@@ -218,6 +218,8 @@ static void vmd_msi_free(struct irq_domain *domain,
struct vmd_irq *vmdirq = irq_get_chip_data(virq); struct vmd_irq *vmdirq = irq_get_chip_data(virq);
unsigned long flags; unsigned long flags;
synchronize_rcu();
/* XXX: Potential optimization to rebalance */ /* XXX: Potential optimization to rebalance */
raw_spin_lock_irqsave(&list_lock, flags); raw_spin_lock_irqsave(&list_lock, flags);
vmdirq->irq->count--; vmdirq->irq->count--;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment