From: Hanna Czenczek <hreitz@redhat.com>
To: qemu-devel@nongnu.org
Cc: Hanna Czenczek <hreitz@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>,
"Michael S . Tsirkin" <mst@redhat.com>
Subject: [PATCH v2 0/2] virtio: Always reset vhost devices
Date: Tue, 23 Jul 2024 18:39:38 +0200 [thread overview]
Message-ID: <20240723163941.48775-1-hreitz@redhat.com> (raw)
Hi,
As explained in patch 2 (the main one) of this series, we currently
don’t issue the RESET_DEVICE command to vhost back-ends, even though we
fully intend to do so.
The problem is that sending this command is gated behind a vhost_started
check, but at that point (during the device reset process), the device
is actually stopped, and so vhost_started is false. We still want to
send RESET_DEVICE there, so patch 2 removes the vhost_started condition.
This means that we need to be able to call VirtioDeviceClass.get_vhost()
when vhost_started is false. For most .get_vhost() implementations,
that’s perfectly fine; but three of them (crypto, gpu, net) dereference
some pointers, so if any of them is NULL, we have to explicitly return
NULL in those implementations. That’s what patch 1 is for.
This time, I’ve run `make check` with ubsan; I can confirm that v1
generated errors for vhost-net, but with patch 1 added, it’s clean.
I’ve also run the CI pipeline:
https://gitlab.com/hreitz/qemu/-/pipelines/1384524949
Specifically, clang-system passed:
https://gitlab.com/hreitz/qemu/-/jobs/7406688234
The only failure is msys2-64bit, which timed out (re-tried repeatedly),
but judging from https://gitlab.com/qemu-project/qemu/-/pipelines, I
think that’s expected.
v2: Added patch 1, left patch 2 unchanged.
Hanna Czenczek (2):
virtio: Allow .get_vhost() without vhost_started
virtio: Always reset vhost devices
include/hw/virtio/virtio.h | 1 +
hw/display/vhost-user-gpu.c | 2 +-
hw/net/virtio-net.c | 19 +++++++++++++++++--
hw/virtio/virtio-crypto.c | 18 +++++++++++++++---
hw/virtio/virtio.c | 8 ++++++--
5 files changed, 40 insertions(+), 8 deletions(-)
--
2.45.2
next reply other threads:[~2024-07-23 16:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-23 16:39 Hanna Czenczek [this message]
2024-07-23 16:39 ` [PATCH v2 1/2] virtio: Allow .get_vhost() without vhost_started Hanna Czenczek
2024-07-30 16:53 ` Stefan Hajnoczi
2024-07-23 16:39 ` [PATCH v2 2/2] virtio: Always reset vhost devices Hanna Czenczek
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=20240723163941.48775-1-hreitz@redhat.com \
--to=hreitz@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/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 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).