qemu-e2k/hw/i386
Peter Xu 4a94b3aa6d pci: fix pci_requester_id()
This fix SID verification failure when IOMMU IR is enabled with PCI
bridges. Existing pci_requester_id() is more like getting BDF info
only. Renaming it to pci_get_bdf(). Meanwhile, we provide the correct
implementation to get requester ID. VT-d spec 5.1.1 is a good reference
to go, though it talks only about interrupt delivery, the rule works
exactly the same for non-interrupt cases.

Currently, there are three use cases for pci_requester_id():

- PCIX status bits: here we need BDF only, not requester ID. Replacing
  with pci_get_bdf().
- PCIe Error injection and MSI delivery: for both these cases, we are
  looking for requester IDs. Here we should use the new impl.

To avoid a PCI walk every time we send MSI message, one requester_id
cache field is added to PCIDevice to cache the result when initialize
PCI device.

Signed-off-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2016-06-17 03:28:02 +03:00
..
kvm pci: fix pci_requester_id() 2016-06-17 03:28:02 +03:00
xen include/qemu/osdep.h: Don't include qapi/error.h 2016-03-22 22:20:15 +01:00
Makefile.objs pc: acpi: remove unused ASL templates and related blobs/utils 2016-01-09 23:20:19 +02:00
acpi-build.c all: Remove unnecessary glib.h includes 2016-06-07 18:19:24 +03:00
acpi-build.h Use scripts/clean-includes to drop redundant qemu/typedefs.h 2016-03-22 22:20:16 +01:00
intel_iommu.c intel_iommu: large page support 2016-02-06 20:44:10 +02:00
intel_iommu_internal.h intel_iommu: large page support 2016-02-06 20:44:10 +02:00
kvmvapic.c cpu-exec: Rename cpu_resume_from_signal() to cpu_loop_exit_noexc() 2016-06-09 15:55:02 +01:00
multiboot.c hw: explicitly include qemu-common.h and cpu.h 2016-03-22 22:20:17 +01:00
multiboot.h refer to FWCfgState explicitly 2013-06-02 18:14:02 +03:00
pc.c * max-ram-below-4g improvement (Gerd) 2016-06-08 14:45:28 +01:00
pc_piix.c vl: Eliminate usb_enabled() 2016-06-13 13:24:41 +02:00
pc_q35.c vl: Eliminate usb_enabled() 2016-06-13 13:24:41 +02:00
pc_sysfw.c include/qemu/osdep.h: Don't include qapi/error.h 2016-03-22 22:20:15 +01:00
pci-assign-load-rom.c include/qemu/osdep.h: Don't include qapi/error.h 2016-03-22 22:20:15 +01:00