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>
---
hw/net/e1000e.c | 15 ++-------
hw/net/rocker/rocker.c | 23 ++------------
hw/net/vmxnet3.c | 27 +++-------------
hw/nvme/ctrl.c | 5 +--
hw/pci/msix.c | 24 ++++++--------
hw/rdma/vmw/pvrdma_main.c | 7 +---
For the pvrdma stuff:
hw/remote/vfio-user-obj.c | 9 +-----
hw/virtio/virtio-pci.c | 67 ++++++++++++++++++++++++++++-----------
include/hw/pci/msix.h | 4 +--
9 files changed, 74 insertions(+), 107 deletions(-)