Skip to content

Commit 7e0815b

Browse files
committed
x86/pci/xen: Disable PCI/MSI[-X] masking for XEN_HVM guests
When a XEN_HVM guest uses the XEN PIRQ/Eventchannel mechanism, then PCI/MSI[-X] masking is solely controlled by the hypervisor, but contrary to XEN_PV guests this does not disable PCI/MSI[-X] masking in the PCI/MSI layer. This can lead to a situation where the PCI/MSI layer masks an MSI[-X] interrupt and the hypervisor grants the write despite the fact that it already requested the interrupt. As a consequence interrupt delivery on the affected device is not happening ever. Set pci_msi_ignore_mask to prevent that like it's done for XEN_PV guests already. Fixes: 809f926 ("xen: map MSIs into pirqs") Reported-by: Jeremi Piotrowski <jpiotrowski@linux.microsoft.com> Reported-by: Dusty Mabe <dustymabe@redhat.com> Reported-by: Salvatore Bonaccorso <carnil@debian.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Tested-by: Noah Meyerhans <noahm@debian.org> Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/87tuaduxj5.ffs@tglx
1 parent 1fa568e commit 7e0815b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

arch/x86/pci/xen.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,6 @@ static __init void xen_setup_pci_msi(void)
467467
else
468468
xen_msi_ops.setup_msi_irqs = xen_setup_msi_irqs;
469469
xen_msi_ops.teardown_msi_irqs = xen_pv_teardown_msi_irqs;
470-
pci_msi_ignore_mask = 1;
471470
} else if (xen_hvm_domain()) {
472471
xen_msi_ops.setup_msi_irqs = xen_hvm_setup_msi_irqs;
473472
xen_msi_ops.teardown_msi_irqs = xen_teardown_msi_irqs;
@@ -481,6 +480,11 @@ static __init void xen_setup_pci_msi(void)
481480
* in allocating the native domain and never use it.
482481
*/
483482
x86_init.irqs.create_pci_msi_domain = xen_create_pci_msi_domain;
483+
/*
484+
* With XEN PIRQ/Eventchannels in use PCI/MSI[-X] masking is solely
485+
* controlled by the hypervisor.
486+
*/
487+
pci_msi_ignore_mask = 1;
484488
}
485489

486490
#else /* CONFIG_PCI_MSI */

0 commit comments

Comments
 (0)