linux/arch/x86/pci
Dan Streetman c74fd80f2f xen: do not re-use pirq number cached in pci device msi msg data
Revert the main part of commit:
af42b8d12f ("xen: fix MSI setup and teardown for PV on HVM guests")

That commit introduced reading the pci device's msi message data to see
if a pirq was previously configured for the device's msi/msix, and re-use
that pirq.  At the time, that was the correct behavior.  However, a
later change to Qemu caused it to call into the Xen hypervisor to unmap
all pirqs for a pci device, when the pci device disables its MSI/MSIX
vectors; specifically the Qemu commit:
c976437c7dba9c7444fb41df45468968aaa326ad
("qemu-xen: free all the pirqs for msi/msix when driver unload")

Once Qemu added this pirq unmapping, it was no longer correct for the
kernel to re-use the pirq number cached in the pci device msi message
data.  All Qemu releases since 2.1.0 contain the patch that unmaps the
pirqs when the pci device disables its MSI/MSIX vectors.

This bug is causing failures to initialize multiple NVMe controllers
under Xen, because the NVMe driver sets up a single MSIX vector for
each controller (concurrently), and then after using that to talk to
the controller for some configuration data, it disables the single MSIX
vector and re-configures all the MSIX vectors it needs.  So the MSIX
setup code tries to re-use the cached pirq from the first vector
for each controller, but the hypervisor has already given away that
pirq to another controller, and its initialization fails.

This is discussed in more detail at:
https://lists.xen.org/archives/html/xen-devel/2017-01/msg00447.html

Fixes: af42b8d12f ("xen: fix MSI setup and teardown for PV on HVM guests")
Signed-off-by: Dan Streetman <dan.streetman@canonical.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
2017-02-22 10:10:46 -05:00
..
acpi.c x86/PCI: Ignore _CRS on Supermicro X8DTH-i/6/iF/6F 2017-01-11 09:11:15 -06:00
amd_bus.c x86/pci/amd-bus: Convert to hotplug state machine 2016-11-22 23:34:43 +01:00
broadcom_bus.c x86/PCI: Fix Broadcom CNB20LE unintended sign extension 2014-04-25 11:01:08 -06:00
bus_numa.c x86/PCI/ACPI: Fix regression caused by commit 4d6b4e69a2 2015-12-02 02:30:15 +01:00
bus_numa.h x86/PCI: put busn resource in pci_root_info for native host bridge drivers 2012-06-13 15:42:24 -06:00
ce4100.c x86/ce4100: Fix PCI configuration register access for devices without interrupts 2012-10-30 10:16:47 +01:00
common.c x86/PCI: VMD: Request userspace control of PCIe hotplug indicators 2016-09-23 08:41:08 -05:00
direct.c x86: constify PCI raw ops structures 2011-10-14 09:05:28 -07:00
early.c x86/PCI: remove early PCI pr_debug statements 2009-11-24 15:25:19 -08:00
fixup.c PCI: Mark Haswell Power Control Unit as having non-compliant BARs 2016-09-01 08:52:29 -05:00
i386.c x86/mm/pat: Wrap pat_enabled into a function API 2015-05-27 14:41:01 +02:00
init.c x86, olpc: Use pci subarch init for OLPC 2010-02-25 19:26:23 -08:00
intel_mid_pci.c x86/pci: Use MRFLD abbreviation for Merrifield 2016-07-13 09:24:51 +02:00
irq.c Revert "PCI, x86: Implement pcibios_alloc_irq() and pcibios_free_irq()" 2016-02-27 08:52:20 -06:00
legacy.c x86/PCI: Make pci_subsys_init() static 2015-10-09 18:34:48 -05:00
Makefile x86/PCI: VMD: Move VMD driver to drivers/pci/host 2016-10-04 12:26:37 -05:00
mmconfig-shared.c ACPI and power management updates for v3.20-rc1 2015-02-10 15:09:41 -08:00
mmconfig_32.c ACPI: Clean up inclusions of ACPI header files 2013-12-07 01:03:14 +01:00
mmconfig_64.c X86: drivers: remove __dev* attributes. 2013-01-03 15:57:04 -08:00
numachip.c x86: numachip: APIC driver cleanups 2014-11-04 18:17:27 +01:00
olpc.c x86: constify PCI raw ops structures 2011-10-14 09:05:28 -07:00
pcbios.c x86: Apply more __ro_after_init and const 2016-08-10 14:55:05 +02:00
sta2x11-fixup.c dma-mapping: use unsigned long for dma_attrs 2016-08-04 08:50:07 -04:00
xen.c xen: do not re-use pirq number cached in pci device msi msg data 2017-02-22 10:10:46 -05:00