Skip to content

Commit 1a519dc

Browse files
marmarekKAGA-KOKO
authored andcommitted
PCI/MSI: Skip masking MSI-X on Xen PV
When running as Xen PV guest, masking MSI-X is a responsibility of the hypervisor. The guest has no write access to the relevant BAR at all - when it tries to, it results in a crash like this: BUG: unable to handle page fault for address: ffffc9004069100c #PF: supervisor write access in kernel mode #PF: error_code(0x0003) - permissions violation RIP: e030:__pci_enable_msix_range.part.0+0x26b/0x5f0 e1000e_set_interrupt_capability+0xbf/0xd0 [e1000e] e1000_probe+0x41f/0xdb0 [e1000e] local_pci_probe+0x42/0x80 (...) The recently introduced function msix_mask_all() does not check the global variable pci_msi_ignore_mask which is set by XEN PV to bypass the masking of MSI[-X] interrupts. Add the check to make this function XEN PV compatible. Fixes: 7d5ec3d ("PCI/MSI: Mask all unused MSI-X entries") Signed-off-by: Marek Marczykowski-Górecki <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Acked-by: Bjorn Helgaas <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected]
1 parent e22ce8e commit 1a519dc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/pci/msi.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -776,6 +776,9 @@ static void msix_mask_all(void __iomem *base, int tsize)
776776
u32 ctrl = PCI_MSIX_ENTRY_CTRL_MASKBIT;
777777
int i;
778778

779+
if (pci_msi_ignore_mask)
780+
return;
781+
779782
for (i = 0; i < tsize; i++, base += PCI_MSIX_ENTRY_SIZE)
780783
writel(ctrl, base + PCI_MSIX_ENTRY_VECTOR_CTRL);
781784
}

0 commit comments

Comments
 (0)