From: "Eugenio Pérez" <eperezma@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"Eugenio Pérez" <eperezma@redhat.com>,
"kvm list" <kvm@vger.kernel.org>,
"Halil Pasic" <pasic@linux.ibm.com>,
"virtualization@lists.linux-foundation.org"
<virtualization@lists.linux-foundation.org>,
"Linux Next Mailing List" <linux-next@vger.kernel.org>,
"Cornelia Huck" <cohuck@redhat.com>,
"Stephen Rothwell" <sfr@canb.auug.org.au>,
"Christian Borntraeger" <borntraeger@de.ibm.com>
Subject: [PATCH v2 0/8] vhost: Reset batched descriptors on SET_VRING_BASE call
Date: Tue, 31 Mar 2020 19:59:58 +0200 [thread overview]
Message-ID: <20200331180006.25829-1-eperezma@redhat.com> (raw)
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.
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/test.c | 59 +++++++-
drivers/vhost/test.h | 1 +
drivers/vhost/vhost.c | 271 +++++++++++++++++++++++------------
drivers/vhost/vhost.h | 45 +++++-
drivers/vhost/vsock.c | 14 +-
drivers/virtio/virtio_ring.c | 29 ++++
tools/virtio/linux/virtio.h | 2 +
tools/virtio/virtio_test.c | 123 ++++++++++++++--
9 files changed, 445 insertions(+), 127 deletions(-)
--
2.18.1
next reply other threads:[~2020-03-31 18:01 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-31 17:59 Eugenio Pérez [this message]
2020-03-31 17:59 ` [PATCH v2 1/8] vhost: Create accessors for virtqueues private_data Eugenio Pérez
2020-03-31 18:14 ` Michael S. Tsirkin
2020-03-31 19:29 ` Eugenio Perez Martin
2020-03-31 18:28 ` Michael S. Tsirkin
2020-03-31 19:28 ` Eugenio Perez Martin
2020-03-31 18:00 ` [PATCH v2 2/8] vhost: option to fetch descriptors through an independent struct Eugenio Pérez
2020-03-31 18:00 ` [PATCH v2 3/8] vhost: use batched version by default Eugenio Pérez
2020-03-31 18:00 ` [PATCH v2 4/8] vhost: batching fetches Eugenio Pérez
2020-03-31 18:00 ` [PATCH v2 5/8] tools/virtio: Add --batch option Eugenio Pérez
2020-03-31 18:00 ` [PATCH v2 6/8] tools/virtio: Add --batch=random option Eugenio Pérez
2020-03-31 18:00 ` [PATCH v2 7/8] tools/virtio: Add --reset=random Eugenio Pérez
2020-03-31 18:00 ` [PATCH v2 8/8] tools/virtio: Make --reset reset ring idx Eugenio Pérez
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200331180006.25829-1-eperezma@redhat.com \
--to=eperezma@redhat.com \
--cc=borntraeger@de.ibm.com \
--cc=cohuck@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=mst@redhat.com \
--cc=pasic@linux.ibm.com \
--cc=sfr@canb.auug.org.au \
--cc=virtualization@lists.linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.