Skip to content

Commit 6c79699

Browse files
committed
x86/pci/xen: Fixup fallout from the PCI/MSI overhaul
David reported that the recent PCI/MSI rework results in MSI descriptor leakage under XEN. This is caused by: 1) The missing MSI_FLAG_FREE_MSI_DESCS flag in the XEN MSI domain info, which is required now that PCI/MSI delegates descriptor freeing to the core MSI code. 2) Not disassociating the interrupts on teardown, by setting the msi_desc::irq to 0. This was not required before because the teardown was unconditional and did not check whether a MSI descriptor was still connected to a Linux interrupt. On further inspection it came to light that the MSI_FLAG_DEV_SYSFS is missing in the XEN MSI domain info as well to restore the pre 6.2 status quo. Add the missing MSI flags and disassociate the MSI descriptor from the Linux interrupt in the XEN specific teardown function. Fixes: b2bdda2 ("PCI/MSI: Let the MSI core free descriptors") Fixes: 2f2940d ("genirq/msi: Remove filter from msi_free_descs_free_range()") Fixes: ffd8448 ("PCI/MSI: Let the irq code handle sysfs groups") Reported-by: David Woodhouse <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Tested-by: David Woodhouse <[email protected]> Link: https://lore.kernel.org/r/871qnunycr.ffs@tglx
1 parent 0a3a58d commit 6c79699

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

arch/x86/pci/xen.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,7 @@ static void xen_teardown_msi_irqs(struct pci_dev *dev)
392392
msi_for_each_desc(msidesc, &dev->dev, MSI_DESC_ASSOCIATED) {
393393
for (i = 0; i < msidesc->nvec_used; i++)
394394
xen_destroy_irq(msidesc->irq + i);
395+
msidesc->irq = 0;
395396
}
396397
}
397398

@@ -433,7 +434,7 @@ static struct msi_domain_ops xen_pci_msi_domain_ops = {
433434
};
434435

435436
static struct msi_domain_info xen_pci_msi_domain_info = {
436-
.flags = MSI_FLAG_PCI_MSIX,
437+
.flags = MSI_FLAG_PCI_MSIX | MSI_FLAG_FREE_MSI_DESCS | MSI_FLAG_DEV_SYSFS,
437438
.ops = &xen_pci_msi_domain_ops,
438439
};
439440

0 commit comments

Comments
 (0)