linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/8] vhost: Reset batched descriptors on SET_VRING_BASE call
@ 2020-03-31 19:27 Eugenio Pérez
  2020-03-31 19:27 ` [PATCH v3 1/8] vhost: Create accessors for virtqueues private_data Eugenio Pérez
                   ` (9 more replies)
  0 siblings, 10 replies; 15+ messages in thread
From: Eugenio Pérez @ 2020-03-31 19:27 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: linux-kernel, Stephen Rothwell, kvm list,
	Linux Next Mailing List, virtualization, Eugenio Pérez,
	Christian Borntraeger, Halil Pasic, Cornelia Huck

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, resetting them every time backend changes, 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, only
on test code.

Another useful thing would be to check if mutex is properly get in
vq private_data accessors. Not sure if mutex debug code allow that,
similar to C++ unique lock::owns_lock. Not acquiring in the function
because caller code holds the mutex in order to perform more actions.

v3:
* Rename accesors functions.
* Make scsi and test use the accesors too.

v2:
* Squashed commits.
* Create vq private_data accesors (mst).

This is meant to be applied on top of
c4f1c41a6094582903c75c0dcfacb453c959d457 in
git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git.

Eugenio Pérez (5):
  vhost: Create accessors for virtqueues private_data
  tools/virtio: Add --batch option
  tools/virtio: Add --batch=random option
  tools/virtio: Add --reset=random
  tools/virtio: Make --reset reset ring idx

Michael S. Tsirkin (3):
  vhost: option to fetch descriptors through an independent struct
  vhost: use batched version by default
  vhost: batching fetches

 drivers/vhost/net.c          |  28 ++--
 drivers/vhost/scsi.c         |  14 +-
 drivers/vhost/test.c         |  69 ++++++++-
 drivers/vhost/test.h         |   1 +
 drivers/vhost/vhost.c        | 271 +++++++++++++++++++++++------------
 drivers/vhost/vhost.h        |  44 +++++-
 drivers/vhost/vsock.c        |  14 +-
 drivers/virtio/virtio_ring.c |  29 ++++
 tools/virtio/linux/virtio.h  |   2 +
 tools/virtio/virtio_test.c   | 123 ++++++++++++++--
 10 files changed, 456 insertions(+), 139 deletions(-)

-- 
2.18.1


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

end of thread, other threads:[~2020-04-02  8:17 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-31 19:27 [PATCH v3 0/8] vhost: Reset batched descriptors on SET_VRING_BASE call Eugenio Pérez
2020-03-31 19:27 ` [PATCH v3 1/8] vhost: Create accessors for virtqueues private_data Eugenio Pérez
2020-03-31 19:27 ` [PATCH v3 2/8] vhost: option to fetch descriptors through an independent struct Eugenio Pérez
2020-03-31 19:27 ` [PATCH v3 3/8] vhost: use batched version by default Eugenio Pérez
2020-03-31 19:28 ` [PATCH v3 4/8] vhost: batching fetches Eugenio Pérez
2020-03-31 19:28 ` [PATCH v3 5/8] tools/virtio: Add --batch option Eugenio Pérez
2020-03-31 19:28 ` [PATCH v3 6/8] tools/virtio: Add --batch=random option Eugenio Pérez
2020-03-31 19:28 ` [PATCH v3 7/8] tools/virtio: Add --reset=random Eugenio Pérez
2020-03-31 19:28 ` [PATCH v3 8/8] tools/virtio: Make --reset reset ring idx Eugenio Pérez
2020-03-31 19:51 ` [PATCH v3 0/8] vhost: Reset batched descriptors on SET_VRING_BASE call Michael S. Tsirkin
2020-04-01  7:19 ` Christian Borntraeger
2020-04-01 18:40   ` Eugenio Perez Martin
2020-04-01 18:44     ` Christian Borntraeger
2020-04-01 19:13       ` Christian Borntraeger
2020-04-02  8:17         ` 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).