From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Laurent Vivier <lvivier@redhat.com>, qemu-devel@nongnu.org
Cc: "Michael S. Tsirkin" <mst@redhat.com>, longpeng2@huawei.com
Subject: Re: [PATCH] vhost: fix vhost_dev_enable_notifiers() error case
Date: Fri, 2 Jun 2023 21:59:29 +0200 [thread overview]
Message-ID: <ab02963f-7d26-5140-b632-1628b3d9f5e3@linaro.org> (raw)
In-Reply-To: <20230602162735.3670785-1-lvivier@redhat.com>
On 2/6/23 18:27, Laurent Vivier wrote:
> in vhost_dev_enable_notifiers(), if virtio_bus_set_host_notifier(true)
> fails, we call vhost_dev_disable_notifiers() that executes
> virtio_bus_set_host_notifier(false) on all queues, even on queues that
> have failed to be initialized.
>
> This triggers a core dump in memory_region_del_eventfd():
>
> virtio_bus_set_host_notifier: unable to init event notifier: Too many open files (-24)
> vhost VQ 1 notifier binding failed: 24
> .../softmmu/memory.c:2611: memory_region_del_eventfd: Assertion `i != mr->ioeventfd_nb' failed.
>
> Fix the problem by providing to vhost_dev_disable_notifiers() the
> number of queues to disable.
>
> Fixes: 8771589b6f81 ("vhost: simplify vhost_dev_enable_notifiers")
> Cc: longpeng2@huawei.com
> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
> ---
> hw/virtio/vhost.c | 65 ++++++++++++++++++++++++++---------------------
> 1 file changed, 36 insertions(+), 29 deletions(-)
I'd rather have 2 patches, one factoring the new helper out
and the 2nd fixing the bug. If you ever need to respin...
Anyhow,
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
next prev parent reply other threads:[~2023-06-02 19:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-02 16:27 [PATCH] vhost: fix vhost_dev_enable_notifiers() error case Laurent Vivier
2023-06-02 19:59 ` Philippe Mathieu-Daudé [this message]
2023-06-07 9:32 ` Michael Tokarev
2023-06-23 5:26 ` Michael S. Tsirkin
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=ab02963f-7d26-5140-b632-1628b3d9f5e3@linaro.org \
--to=philmd@linaro.org \
--cc=longpeng2@huawei.com \
--cc=lvivier@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.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 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).