Skip to content

virtio/vhost: Add checks for uninitialized VQs

Nicholas A. Bellinger kvm qemu-devel virtualization 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 3 repliesIn review
  2. v13 patches 11 repliesSuperseded

Changes in v2 from the cover letter

- Remove now unnecessary virtio_queue_get_num() calls in virtio-pci.c
- Add virtio_queue_valid() calls in vhost_virtqueue_[start,stop]()

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3virtio: add API to check that ring is setuphw/virtio.c hw/virtio.h+6 -00 replies
2/3virtio-pci: Add virtio_queue_valid checks ahead of virtio_queue_get_numhw/virtio-pci.c+15 -190 replies
3/3vhost: Skip uninitialized VQs in vhost_virtqueue_[start,stop]hw/vhost.c+12 -00 replies
3/3vhost: Skip uninitialized VQs in vhost_virtqueue_[start, stop]hw/vhost.c+12 -00 replies

Reviews trailers per patch

None of the 4 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchMichael S. Tsirkin
SeriesA-b A-b
1/3
2/3
3/3
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH-v2 0/3] virtio/vhost: Add checks for uninitialized VQs

From: Nicholas Bellinger <[email protected]>

Hi folks,

This series adds a virtio_queue_valid() for use by virtio-pci code in order to prevent opreations upon uninitialized VQs, which is currently expected to occur during seabios setup of virtio-scsi with in-flight vhost-scsi-pci device code.

On the vhost side, it also adds virtio_queue_valid() sanity checks in vhost_virtqueue_[start,stop]() and vhost_verify_ring_mappings() in order to skip the same uninitialized VQs.

Changes from v1:
- Remove now unnecessary virtio_queue_get_num() calls in virtio-pci.c
- Add virtio_queue_valid() calls in vhost_virtqueue_[start,stop]()

Please review.

--nab

Michael S. Tsirkin (1):
virtio: add API to check that ring is setup

Nicholas Bellinger (2):
virtio-pci: Add virtio_queue_valid checks ahead of
virtio_queue_get_num
vhost: Skip uninitialized VQs in vhost_virtqueue_[start,stop]

 hw/vhost.c      |   12 ++++++++++++
 hw/virtio-pci.c |   34 +++++++++++++++-------------------
 hw/virtio.c     |    5 +++++
 hw/virtio.h     |    1 +
 4 files changed, 33 insertions(+), 19 deletions(-)
Signature · 1 line
1.7.2.5