LKML Archive on
help / color / mirror / Atom feed
From: "tip-bot2 for Marek Marczykowski-Górecki" <>
	Thomas Gleixner <>,
	Bjorn Helgaas <>,,,,
Subject: [tip: irq/urgent] PCI/MSI: Skip masking MSI-X on Xen PV
Date: Thu, 26 Aug 2021 22:33:29 -0000	[thread overview]
Message-ID: <163001720943.25758.17463061644086046608.tip-bot2@tip-bot2> (raw)
In-Reply-To: <>

The following commit has been merged into the irq/urgent branch of tip:

Commit-ID:     1a519dc7a73c977547d8b5108d98c6e769c89f4b
Author:        Marek Marczykowski-Górecki <>
AuthorDate:    Thu, 26 Aug 2021 19:03:42 +02:00
Committer:     Thomas Gleixner <>
CommitterDate: Fri, 27 Aug 2021 00:27:15 +02:00

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]

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 <>
Signed-off-by: Thomas Gleixner <>
Acked-by: Bjorn Helgaas <>
 drivers/pci/msi.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index e5e7533..3a9f4f8 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -776,6 +776,9 @@ static void msix_mask_all(void __iomem *base, int tsize)
 	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);

      parent reply	other threads:[~2021-08-26 22:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-26 17:03 [PATCH v2] " Marek Marczykowski-Górecki
2021-08-26 20:56 ` Bjorn Helgaas
2021-08-26 22:33 ` tip-bot2 for Marek Marczykowski-Górecki [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=163001720943.25758.17463061644086046608.tip-bot2@tip-bot2 \ \ \ \ \ \ \ \ \ \
    --subject='Re: [tip: irq/urgent] PCI/MSI: Skip masking MSI-X on Xen PV' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).