linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] vhost: Reset batched descriptors on SET_VRING_BASE call
@ 2020-03-29 11:33 Eugenio Pérez
  2020-03-29 11:33 ` [PATCH 1/6] tools/virtio: Add --batch option Eugenio Pérez
                   ` (7 more replies)
  0 siblings, 8 replies; 15+ messages in thread
From: Eugenio Pérez @ 2020-03-29 11:33 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: virtualization, Halil Pasic, Eugenio Pérez,
	Stephen Rothwell, Linux Next Mailing List, kvm list,
	Cornelia Huck, Christian Borntraeger, linux-kernel

Vhost did not reset properly the batched descriptors on SET_VRING_BASE event. Because of that, is possible to return an invalid descriptor to the guest.

This series ammend this, and creates a test to assert correct behavior. To do that, they need to expose a new function in virtio_ring, virtqueue_reset_free_head. Not sure if this can be avoided.

Also, change from https://lkml.org/lkml/2020/3/27/108 is not included, that avoids to update a variable in a loop where it can be updated once.

This is meant to be applied on top of eccb852f1fe6bede630e2e4f1a121a81e34354ab in git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git, and some commits should be squashed with that series.

Eugenio Pérez (6):
  tools/virtio: Add --batch option
  tools/virtio: Add --batch=random option
  tools/virtio: Add --reset=random
  tools/virtio: Make --reset reset ring idx
  vhost: Delete virtqueue batch_descs member
  fixup! vhost: batching fetches

 drivers/vhost/test.c         |  57 ++++++++++++++++
 drivers/vhost/test.h         |   1 +
 drivers/vhost/vhost.c        |  12 +++-
 drivers/vhost/vhost.h        |   1 -
 drivers/virtio/virtio_ring.c |  18 +++++
 include/linux/virtio.h       |   2 +
 tools/virtio/linux/virtio.h  |   2 +
 tools/virtio/virtio_test.c   | 123 +++++++++++++++++++++++++++++++----
 8 files changed, 201 insertions(+), 15 deletions(-)

-- 
2.18.1


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2020-03-30  9:16 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-29 11:33 [PATCH 0/6] vhost: Reset batched descriptors on SET_VRING_BASE call Eugenio Pérez
2020-03-29 11:33 ` [PATCH 1/6] tools/virtio: Add --batch option Eugenio Pérez
2020-03-29 11:33 ` [PATCH 2/6] tools/virtio: Add --batch=random option Eugenio Pérez
2020-03-29 11:33 ` [PATCH 3/6] tools/virtio: Add --reset=random Eugenio Pérez
2020-03-29 11:33 ` [PATCH 4/6] tools/virtio: Make --reset reset ring idx Eugenio Pérez
2020-03-29 12:36   ` Michael S. Tsirkin
2020-03-29 11:33 ` [PATCH 5/6] vhost: Delete virtqueue batch_descs member Eugenio Pérez
2020-03-29 11:33 ` [PATCH 6/6] fixup! vhost: batching fetches Eugenio Pérez
2020-03-29 11:49 ` [PATCH 0/6] vhost: Reset batched descriptors on SET_VRING_BASE call Michael S. Tsirkin
2020-03-29 12:19   ` Eugenio Perez Martin
2020-03-29 12:25     ` Michael S. Tsirkin
2020-03-30  7:13 ` Christian Borntraeger
2020-03-30  7:18   ` Eugenio Perez Martin
2020-03-30  7:34     ` Christian Borntraeger
2020-03-30  9:15       ` Eugenio Perez Martin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).