qemu/include/hw/pci
Akihiko Odaki 15377f6e79 msix: Assert that specified vector is in range
There were several different ways to deal with the situation where the
vector specified for a msix function is out of bound:
- early return a function and keep progresssing
- propagate the error to the caller
- mark msix unusable
- assert it is in bound
- just ignore

An out-of-bound vector should not be specified if the device
implementation is correct so let msix functions always assert that the
specified vector is in range.

An exceptional case is virtio-pci, which allows the guest to configure
vectors. For virtio-pci, it is more appropriate to introduce its own
checks because it is sometimes too late to check the vector range in
msix functions.

Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Message-Id: <20220829083524.143640-1-akihiko.odaki@daynix.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Yuval Shaia <yuval.shaia.ml@gmail.com>
Signed-off-by: Akihiko Odaki &lt;<a href="mailto:akihiko.odaki@daynix.com" target="_blank">akihiko.odaki@daynix.com</a>&gt;<br>
2022-11-07 14:08:17 -05:00
..
msi.h vfio-user: handle device interrupts 2022-06-15 16:43:42 +01:00
msix.h msix: Assert that specified vector is in range 2022-11-07 14:08:17 -05:00
pci_bridge.h acpi/cxl: Create the CEDT (9.14.1) 2022-05-13 06:13:36 -04:00
pci_bus.h hw/pci/cxl: Create a CXL bus type 2022-05-13 06:13:36 -04:00
pci_host.h hw/pci/pci_host: Allow PCI host to bypass iommu 2021-07-16 11:10:45 -04:00
pci_ids.h hw/pci: PCIe Data Object Exchange emulation 2022-11-07 13:12:19 -05:00
pci_regs.h pcie: Add 1.2 version token for the Power Management Capability 2022-03-06 05:08:23 -05:00
pci.h pci: cleanup virtio ids. 2022-10-13 13:55:53 -04:00
pcie_aer.h Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
pcie_doe.h hw/pci: PCIe Data Object Exchange emulation 2022-11-07 13:12:19 -05:00
pcie_host.h include/hw/pci/pcie_host: Correct PCIE_MMCFG_SIZE_MAX 2022-05-16 16:15:40 -04:00
pcie_port.h pci/pcie_port: Add pci_find_port_by_pn() 2022-05-13 07:57:26 -04:00
pcie_regs.h hw/pci: PCIe Data Object Exchange emulation 2022-11-07 13:12:19 -05:00
pcie_sriov.h pcie: Add a helper to the SR/IOV API 2022-03-06 05:08:23 -05:00
pcie.h hw/pci: PCIe Data Object Exchange emulation 2022-11-07 13:12:19 -05:00
shpc.h Include migration/vmstate.h less 2019-08-16 13:31:52 +02:00
slotid_cap.h