qemu-e2k/hw/virtio
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
..
Kconfig hw/virtio: add boilerplate for vhost-user-gpio device 2022-10-07 09:41:51 -04:00
meson.build qmp: add QMP command x-query-virtio 2022-10-09 16:38:45 -04:00
trace-events hw/virtio: add boilerplate for vhost-user-gpio device 2022-10-07 09:41:51 -04:00
trace.h
vhost-backend.c vhost: add method vhost_set_vring_err 2022-06-27 18:53:18 -04:00
vhost-iova-tree.c util: accept iova_tree_remove_parameter by value 2022-09-02 10:22:39 +08:00
vhost-iova-tree.h util: accept iova_tree_remove_parameter by value 2022-09-02 10:22:39 +08:00
vhost-scsi-pci.c
vhost-shadow-virtqueue.c vhost: Accept event idx flag 2022-10-28 13:28:52 +08:00
vhost-shadow-virtqueue.h vhost: Add svq avail_handler callback 2022-07-20 16:58:08 +08:00
vhost-stub.c
vhost-user-blk-pci.c
vhost-user-fs-pci.c
vhost-user-fs.c hw/virtio: move vhd->started check into helper and add FIXME 2022-10-07 09:41:51 -04:00
vhost-user-gpio-pci.c hw/virtio: add vhost-user-gpio-pci boilerplate 2022-10-07 09:41:51 -04:00
vhost-user-gpio.c hw/virtio: add boilerplate for vhost-user-gpio device 2022-10-07 09:41:51 -04:00
vhost-user-i2c-pci.c
vhost-user-i2c.c hw/virtio: move vhd->started check into helper and add FIXME 2022-10-07 09:41:51 -04:00
vhost-user-input-pci.c
vhost-user-rng-pci.c
vhost-user-rng.c hw/virtio: move vhd->started check into helper and add FIXME 2022-10-07 09:41:51 -04:00
vhost-user-scsi-pci.c
vhost-user-vsock-pci.c
vhost-user-vsock.c hw/virtio: move vhd->started check into helper and add FIXME 2022-10-07 09:41:51 -04:00
vhost-user.c vhost-user: Fix out of order vring host notification handling 2022-11-07 13:12:20 -05:00
vhost-vdpa.c vdpa: Delete CVQ migration blocker 2022-09-02 10:22:39 +08:00
vhost-vsock-common.c hw/virtio: move vhd->started check into helper and add FIXME 2022-10-07 09:41:51 -04:00
vhost-vsock-pci.c
vhost-vsock.c hw/virtio: move vhd->started check into helper and add FIXME 2022-10-07 09:41:51 -04:00
vhost.c vhost: expose vhost_virtqueue_stop() 2022-11-07 13:12:20 -05:00
virtio-9p-pci.c
virtio-balloon-pci.c
virtio-balloon.c virtio: drop name parameter for virtio_init() 2022-05-16 04:38:40 -04:00
virtio-blk-pci.c
virtio-bus.c virtio: stop ioeventfd on reset 2022-06-14 16:50:30 +02:00
virtio-crypto-pci.c
virtio-crypto.c virtio-crypto: Support asynchronous mode 2022-11-02 06:56:32 -04:00
virtio-input-host-pci.c
virtio-input-pci.c
virtio-iommu-pci.c hw/virtio/virtio-iommu-pci: Enforce the device is plugged on the root bus 2022-11-07 13:12:19 -05:00
virtio-iommu.c hw/virtio/virtio-iommu: Enforce power-of-two notify for both MAP and UNMAP 2022-07-26 15:33:29 -04:00
virtio-mem-pci.c pci-ids: drop PCI_DEVICE_ID_VIRTIO_MEM 2022-10-12 12:01:11 +02:00
virtio-mem-pci.h
virtio-mem.c util: Make qemu_prealloc_mem() optionally consume a ThreadContext 2022-10-27 11:00:56 +02:00
virtio-mmio.c virtio-mmio: cleanup reset 2022-06-14 16:50:30 +02:00
virtio-net-pci.c
virtio-pci.c msix: Assert that specified vector is in range 2022-11-07 14:08:17 -05:00
virtio-pmem-pci.c pci-ids: drop PCI_DEVICE_ID_VIRTIO_PMEM 2022-10-12 12:01:11 +02:00
virtio-pmem-pci.h
virtio-pmem.c virtio: drop name parameter for virtio_init() 2022-05-16 04:38:40 -04:00
virtio-rng-pci.c virtio-rng-pci: Allow setting nvectors, so we can use MSI-X 2022-11-07 13:12:20 -05:00
virtio-rng.c virtio: drop name parameter for virtio_init() 2022-05-16 04:38:40 -04:00
virtio-scsi-pci.c
virtio-serial-pci.c
virtio-stub.c qmp: add QMP command x-query-virtio-queue-element 2022-10-09 16:38:45 -04:00
virtio.c virtio: introduce virtio_queue_enable() 2022-11-07 13:12:20 -05:00