aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/pci
diff options
context:
space:
mode:
authorYijing Wang <wangyijing@huawei.com>2014-10-26 22:44:36 -0400
committerBjorn Helgaas <bhelgaas@google.com>2014-11-06 18:34:39 -0500
commit38737d82f9f0168955f9944c3f8bd3bb262c7e88 (patch)
treed43a3bc4a84dad0e3a178f74478ea6996c0773c8 /arch/x86/pci
parentf114040e3ea6e07372334ade75d1ee0775c355e1 (diff)
PCI/MSI: Add pci_msi_ignore_mask to prevent writes to MSI/MSI-X Mask Bits
MSI-X vector Mask Bits are in MSI-X Tables in PCI memory space. Xen PV guests can't write to those tables. MSI vector Mask Bits are in PCI configuration space. Xen PV guests can write to config space, but those writes are ignored. Commit 0e4ccb1505a9 ("PCI: Add x86_msi.msi_mask_irq() and msix_mask_irq()") added a way to override default_mask_msi_irqs() and default_mask_msix_irqs() so they can be no-ops in Xen guests, but this is more complicated than necessary. Add "pci_msi_ignore_mask" in the core PCI MSI code. If set, default_mask_msi_irqs() and default_mask_msix_irqs() return without doing anything. This is less flexible, but much simpler. [bhelgaas: changelog] Signed-off-by: Yijing Wang <wangyijing@huawei.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: David Vrabel <david.vrabel@citrix.com> CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> CC: xen-devel@lists.xenproject.org
Diffstat (limited to 'arch/x86/pci')
-rw-r--r--arch/x86/pci/xen.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/x86/pci/xen.c b/arch/x86/pci/xen.c
index 093f5f4272d3..5ef62ed20ba4 100644
--- a/arch/x86/pci/xen.c
+++ b/arch/x86/pci/xen.c
@@ -427,6 +427,7 @@ int __init pci_xen_init(void)
427 x86_msi.teardown_msi_irqs = xen_teardown_msi_irqs; 427 x86_msi.teardown_msi_irqs = xen_teardown_msi_irqs;
428 x86_msi.msi_mask_irq = xen_nop_msi_mask_irq; 428 x86_msi.msi_mask_irq = xen_nop_msi_mask_irq;
429 x86_msi.msix_mask_irq = xen_nop_msix_mask_irq; 429 x86_msi.msix_mask_irq = xen_nop_msix_mask_irq;
430 pci_msi_ignore_mask = 1;
430#endif 431#endif
431 return 0; 432 return 0;
432} 433}
@@ -508,6 +509,7 @@ int __init pci_xen_initial_domain(void)
508 x86_msi.restore_msi_irqs = xen_initdom_restore_msi_irqs; 509 x86_msi.restore_msi_irqs = xen_initdom_restore_msi_irqs;
509 x86_msi.msi_mask_irq = xen_nop_msi_mask_irq; 510 x86_msi.msi_mask_irq = xen_nop_msi_mask_irq;
510 x86_msi.msix_mask_irq = xen_nop_msix_mask_irq; 511 x86_msi.msix_mask_irq = xen_nop_msix_mask_irq;
512 pci_msi_ignore_mask = 1;
511#endif 513#endif
512 xen_setup_acpi_sci(); 514 xen_setup_acpi_sci();
513 __acpi_register_gsi = acpi_register_gsi_xen; 515 __acpi_register_gsi = acpi_register_gsi_xen;