diff options
author | Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com> | 2021-08-26 19:03:42 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-09-22 11:47:57 +0200 |
commit | 34b23fc32c05f14fd21caa32544f3720e1527a8d (patch) | |
tree | fdd7113591fe66f46396bf997730b0c3c8bc03d2 | |
parent | 20c1d98ca96be6b2b583806a01899b1a8d88924b (diff) | |
download | linux-stable-34b23fc32c05f14fd21caa32544f3720e1527a8d.tar.gz linux-stable-34b23fc32c05f14fd21caa32544f3720e1527a8d.tar.bz2 linux-stable-34b23fc32c05f14fd21caa32544f3720e1527a8d.zip |
PCI/MSI: Skip masking MSI-X on Xen PV
commit 1a519dc7a73c977547d8b5108d98c6e769c89f4b upstream.
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: 7d5ec3d36123 ("PCI/MSI: Mask all unused MSI-X entries")
Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20210826170342.135172-1-marmarek@invisiblethingslab.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/pci/msi.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c index bc80b0f0ea1b..f65800d63856 100644 --- a/drivers/pci/msi.c +++ b/drivers/pci/msi.c @@ -754,6 +754,9 @@ static void msix_mask_all(void __iomem *base, int tsize) u32 ctrl = PCI_MSIX_ENTRY_CTRL_MASKBIT; int i; + if (pci_msi_ignore_mask) + return; + for (i = 0; i < tsize; i++, base += PCI_MSIX_ENTRY_SIZE) writel(ctrl, base + PCI_MSIX_ENTRY_VECTOR_CTRL); } |