From: "Michael S. Tsirkin" <mst@redhat.com>
To: zhaoguohan@kylinos.cn
Cc: qemu-devel@nongnu.org, Stefano Garzarella <sgarzare@redhat.com>
Subject: Re: [PATCH] hw/virtio/vdpa-dev: pass set_config buffer to vhost backend
Date: Thu, 9 Jul 2026 03:35:16 -0400 [thread overview]
Message-ID: <20260709033448-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20260709073225.2341642-1-zhaoguohan@kylinos.cn>
On Thu, Jul 09, 2026 at 03:32:25PM +0800, zhaoguohan@kylinos.cn wrote:
> From: GuoHan Zhao <zhaoguohan@kylinos.cn>
>
> vhost_vdpa_device_set_config() receives the updated config buffer, but
> forwards s->config to the vhost backend. Since s->config is refreshed by
> get_config(), it may contain stale backend state.
>
could you be a bit more specific pls? a real scenario where you
see an issue? thanks!
> Pass the supplied config buffer to vhost_dev_set_config() instead.
>
> Fixes: b430a2bd2303 ("vdpa: add vdpa-dev support")
> Signed-off-by: GuoHan Zhao <zhaoguohan@kylinos.cn>
> ---
> hw/virtio/vdpa-dev.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/virtio/vdpa-dev.c b/hw/virtio/vdpa-dev.c
> index 089a77f4d0b9..6dc684ab096a 100644
> --- a/hw/virtio/vdpa-dev.c
> +++ b/hw/virtio/vdpa-dev.c
> @@ -212,7 +212,7 @@ vhost_vdpa_device_set_config(VirtIODevice *vdev, const uint8_t *config)
> VhostVdpaDevice *s = VHOST_VDPA_DEVICE(vdev);
> int ret;
>
> - ret = vhost_dev_set_config(&s->dev, s->config, 0, s->config_size,
> + ret = vhost_dev_set_config(&s->dev, config, 0, s->config_size,
> VHOST_SET_CONFIG_TYPE_FRONTEND);
> if (ret) {
> error_report("set device config space failed");
> --
> 2.43.0
next prev parent reply other threads:[~2026-07-09 7:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-09 7:32 [PATCH] hw/virtio/vdpa-dev: pass set_config buffer to vhost backend zhaoguohan
2026-07-09 7:35 ` Michael S. Tsirkin [this message]
2026-07-10 2:50 ` zhaoguohan
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=20260709033448-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=sgarzare@redhat.com \
--cc=zhaoguohan@kylinos.cn \
/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.