Skip to contentSkip to conversation

x86/pci/xen: Disable PCI/MSI[-X] masking for XEN_HVM guests

PATCH New Thomas Gleixner 1 participant 1 message May 24, 2022 Stable branch

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/pci/xen: Disable PCI/MSI[-X] masking for XEN_HVM guests

commit 7e0815b3e09986d2fe651199363e135b9358132a upstream.

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.

---
 arch/x86/pci/xen.c | 5 +++++
 1 file changed, 5 insertions(+)
arch/x86/pci/xen.c +5 -0
index 22da9bfd8a45..bacf8d988f65 100644
@@ -441,6 +441,11 @@ void __init xen_msi_init(void)
 
 	x86_msi.setup_msi_irqs = xen_hvm_setup_msi_irqs;
 	x86_msi.teardown_msi_irq = xen_teardown_msi_irq;
+	/*
+	 * With XEN PIRQ/Eventchannels in use PCI/MSI[-X] masking is solely
+	 * controlled by the hypervisor.
+	 */
+	pci_msi_ignore_mask = 1;
 }
 #endif
 
Signature · 1 line
2.25.1