qemu/hw/i386/kvm
Peter Xu 64e184e260 pci-assign: sync MSI/MSI-X cap and table with PCIDevice
Since commit e1d4fb2d ("kvm-irqchip: x86: add msi route notify fn"),
kvm_irqchip_add_msi_route() starts to use pci_get_msi_message() to fetch
MSI info. This requires that we setup MSI related fields in PCIDevice.
For most devices, that won't be a problem, as long as we are using
general interfaces like msi_init()/msix_init().

However, for pci-assign devices, MSI/MSI-X is treated differently - PCI
assign devices are maintaining its own MSI table and cap information in
AssignedDevice struct. however that's not synced up with PCIDevice's
fields. That will leads to pci_get_msi_message() failed to find correct
MSI capability, even with an NULL msix_table.

A quick fix is to sync up the two places: both the capability bits and
table address for MSI/MSI-X.

Reported-by: Changlimin <changlimin@h3c.com>
Tested-by: Changlimin <changlimin@h3c.com>
Cc: qemu-stable@nongnu.org
Fixes: e1d4fb2d ("kvm-irqchip: x86: add msi route notify fn")
Signed-off-by: Peter Xu <peterx@redhat.com>

Message-Id: <1480042522-16551-1-git-send-email-peterx@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2016-11-28 15:11:17 +01:00
..
apic.c *_run_on_cpu: introduce run_on_cpu_data type 2016-10-31 15:00:25 +01:00
clock.c qemu-common: push cpu.h inclusion out of qemu-common.h 2016-05-19 16:42:29 +02:00
i8254.c Use #include "..." for our own headers, <...> for others 2016-07-12 16:19:16 +02:00
i8259.c pic: fix typo in error message: KVM_GET_IRQCHIP -> KVM_SET_IRQCHIP 2016-09-13 18:12:34 +03:00
ioapic.c x86: Clean up includes 2016-01-29 15:07:22 +00:00
Makefile.objs
pci-assign.c pci-assign: sync MSI/MSI-X cap and table with PCIDevice 2016-11-28 15:11:17 +01:00