From: Eric Farman <farman@linux.ibm.com>
To: qemu-devel@nongnu.org
Cc: qemu-s390x@nongnu.org, Matthew Rosato <mjrosato@linux.ibm.com>,
Cornelia Huck <cohuck@redhat.com>,
"'Michael S . Tsirkin'" <mst@redhat.com>,
Stefano Garzarella <sgarzare@redhat.com>,
Eric Farman <farman@linux.ibm.com>,
Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>,
Konstantin Shkolnyy <kshk@linux.ibm.com>
Subject: [PULL for v11.2 1/1] vhost: only use config notifier when exists/initialized
Date: Mon, 9 Nov 2026 09:43:43 -0500 [thread overview]
Message-ID: <20261109144344.847531-2-farman@linux.ibm.com> (raw)
In-Reply-To: <20261109144344.847531-1-farman@linux.ibm.com>
Commit e3b12d0c55e4 ("util/event_notifier: more strict API") added an
assert for an uninitialized file descriptor in event_notifier_get_fd(),
but it presumes that such a thing always exists.
On s390x, where a config notifier does not exist, this is a breaking
change for any vhost-backed device such as virtio-net. To remedy this,
move the acquisition of the file descriptor within the guard against
vhost_set_config_call and expand the guard to ensure the notifier is
initialized before being used.
Fixes: e3b12d0c55e4 ("util/event_notifier: more strict API")
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Tested-by: Konstantin Shkolnyy <kshk@linux.ibm.com>
Link: https://lore.kernel.org/qemu-devel/20261103172732.837511-1-farman@linux.ibm.com
Signed-off-by: Eric Farman <farman@linux.ibm.com>
---
hw/virtio/vhost.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
index b25919c5c7..189ac54117 100644
--- a/hw/virtio/vhost.c
+++ b/hw/virtio/vhost.c
@@ -2119,8 +2119,9 @@ static void vhost_start_config_intr(struct vhost_dev *dev)
virtio_config_get_guest_notifier(dev->vdev);
assert(dev->vhost_ops);
- int fd = event_notifier_get_fd(config_notifier);
- if (dev->vhost_ops->vhost_set_config_call) {
+ if (dev->vhost_ops->vhost_set_config_call &&
+ event_notifier_initialized(config_notifier)) {
+ int fd = event_notifier_get_fd(config_notifier);
r = dev->vhost_ops->vhost_set_config_call(dev, fd);
if (!r) {
event_notifier_set(config_notifier);
--
2.56.0
next prev parent reply other threads:[~2026-11-09 14:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-09 14:43 [PULL for v11.2 0/1] s390/vhost fix Eric Farman
2026-11-09 14:43 ` Eric Farman [this message]
2026-11-09 19:19 ` Richard Henderson
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=20261109144344.847531-2-farman@linux.ibm.com \
--to=farman@linux.ibm.com \
--cc=cohuck@redhat.com \
--cc=kshk@linux.ibm.com \
--cc=mjrosato@linux.ibm.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=sgarzare@redhat.com \
--cc=vsementsov@yandex-team.ru \
/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.