qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] msix: Assert that specified vector is in range


From: Yuval Shaia
Subject: Re: [PATCH] msix: Assert that specified vector is in range
Date: Mon, 24 Oct 2022 09:28:04 +0300



On Mon, 29 Aug 2022 at 11:35, Akihiko Odaki <akihiko.odaki@gmail.com> wrote:
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:
Reviewed-by: Yuval Shaia <yuval.shaia.ml@gmail.com>

 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(-)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]