qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Hanna Czenczek <hreitz@redhat.com>, qemu-devel@nongnu.org
Cc: Stefano Garzarella <sgarzare@redhat.com>,
	"Michael S . Tsirkin" <mst@redhat.com>
Subject: Re: [PATCH-for-10.2] vhost: Always initialize cached vring data
Date: Tue, 9 Dec 2025 08:10:25 +0100	[thread overview]
Message-ID: <c644d007-263a-4963-9e52-c532b9c4e902@linaro.org> (raw)
In-Reply-To: <20251208113008.153249-1-hreitz@redhat.com>

On 8/12/25 12:30, Hanna Czenczek wrote:
> vhost_virtqueue_start() can exit early if the descriptor ring address is
> 0, assuming the virtqueue isn’t ready to start.
> 
> In this case, all cached vring information (size, physical address,
> pointer) is left as-is.  This is OK at first startup, when that info is
> still initialized to 0, but after a reset, it will retain old (outdated)
> information.
> 
> vhost_virtqueue_start() must make sure these values are (re-)set
> properly before exiting.
> 
> (When using an IOMMU, these outdated values can stall the device:
> vhost_dev_start() deliberately produces an IOMMU miss event for each
> used vring.  If used_phys contains an outdated value, the resulting
> lookup may fail, forcing the device to be stopped.)
> 
> Cc: qemu-stable@nongnu.org
> Signed-off-by: Hanna Czenczek <hreitz@redhat.com>
> ---
>   hw/virtio/vhost.c | 38 +++++++++++++++++++++++---------------
>   1 file changed, 23 insertions(+), 15 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>



      reply	other threads:[~2025-12-09  7:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-08 11:30 [PATCH] vhost: Always initialize cached vring data Hanna Czenczek
2025-12-09  7:10 ` Philippe Mathieu-Daudé [this message]

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=c644d007-263a-4963-9e52-c532b9c4e902@linaro.org \
    --to=philmd@linaro.org \
    --cc=hreitz@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=sgarzare@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).