virtio-fs.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Stefano Garzarella <sgarzare@redhat.com>
To: Eugenio Perez Martin <eperezma@redhat.com>
Cc: "Jason Wang" <jasowang@redhat.com>,
	qemu-devel@nongnu.org, qemu-block@nongnu.org,
	virtio-fs@redhat.com, "Alex Bennée" <alex.bennee@linaro.org>,
	"Viresh Kumar" <viresh.kumar@linaro.org>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Fam Zheng" <fam@euphon.net>,
	"Mathieu Poirier" <mathieu.poirier@linaro.org>,
	"Raphael Norwitz" <raphael.norwitz@nutanix.com>,
	"Kevin Wolf" <kwolf@redhat.com>,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	"Stefan Hajnoczi" <stefanha@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Hanna Reitz" <hreitz@redhat.com>,
	kangjie.xu@linux.alibaba.com
Subject: Re: [Virtio-fs] [PATCH] vhost: mask VIRTIO_F_RING_RESET for vhost and vhost-user devices
Date: Wed, 23 Nov 2022 15:24:07 +0100	[thread overview]
Message-ID: <20221123142407.f6m4mo5exgjhgiix@sgarzare-redhat> (raw)
In-Reply-To: <CAJaqyWfAA7p9MB4DZ-qtshr28HG3o4uXcxyg+BPC6C+eeojnbA@mail.gmail.com>

On Tue, Nov 22, 2022 at 07:01:38PM +0100, Eugenio Perez Martin wrote:
>On Tue, Nov 22, 2022 at 4:13 AM Jason Wang <jasowang@redhat.com> wrote:
>>
>> On Mon, Nov 21, 2022 at 6:11 PM Stefano Garzarella <sgarzare@redhat.com> wrote:
>> >
>> > Commit 69e1c14aa2 ("virtio: core: vq reset feature negotation support")
>> > enabled VIRTIO_F_RING_RESET by default for all virtio devices.
>> >
>> > This feature is not currently emulated by QEMU, so for vhost and
>> > vhost-user devices we need to make sure it is supported by the offloaded
>> > device emulation (in-kernel or in another process).
>> > To do this we need to add VIRTIO_F_RING_RESET to the features bitmap
>> > passed to vhost_get_features(). This way it will be masked if the device
>> > does not support it.
>> >
>> > This issue was initially discovered with vhost-vsock and vhost-user-vsock,
>> > and then also tested with vhost-user-rng which confirmed the same issue.
>> > They fail when sending features through VHOST_SET_FEATURES ioctl or
>> > VHOST_USER_SET_FEATURES message, since VIRTIO_F_RING_RESET is negotiated
>> > by the guest (Linux >= v6.0), but not supported by the device.
>> >
>> > Fixes: 69e1c14aa2 ("virtio: core: vq reset feature negotation support")
>> > Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1318
>> > Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
>>
>> Acked-by: Jason Wang <jasowang@redhat.com>
>>
>> > ---
>> >
>> > To prevent this problem in the future, perhaps we should provide a function
>> > (e.g. vhost_device_get_features) where we go to mask all non-device-specific
>> > features (e.g VIRTIO_F_*, VIRTIO_RING_F_*) that are not emulated by QEMU but
>> > we expect them to be emulated by the vhost or vhost-user devices.
>>
>> Adding Eugenio, this might not be true if we want to use shadow
>> virtqueue for emulating some features?
>>
>
>I think we should be able to introduce that in the (hypothetical)
>vhost_device_get_features if SVQ starts emulating a ring feature,
>isn't it?

Yep, I think so. The idea is to have a single place where to do it.

> I think a first version not aware of SVQ is fine anyway, and
>to introduce it later should be easy.

Thanks for the feedbacks, I'll keep you CCed.

Thanks,
Stefano


  reply	other threads:[~2022-11-23 14:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-21 10:11 [Virtio-fs] [PATCH] vhost: mask VIRTIO_F_RING_RESET for vhost and vhost-user devices Stefano Garzarella
2022-11-21 16:20 ` Stefan Hajnoczi
2022-11-22  3:13 ` Jason Wang
2022-11-22 18:01   ` Eugenio Perez Martin
2022-11-23 14:24     ` Stefano Garzarella [this message]
2022-11-22  4:27 ` Raphael Norwitz

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=20221123142407.f6m4mo5exgjhgiix@sgarzare-redhat \
    --to=sgarzare@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=dgilbert@redhat.com \
    --cc=eperezma@redhat.com \
    --cc=fam@euphon.net \
    --cc=hreitz@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=kangjie.xu@linux.alibaba.com \
    --cc=kwolf@redhat.com \
    --cc=mathieu.poirier@linaro.org \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=raphael.norwitz@nutanix.com \
    --cc=stefanha@redhat.com \
    --cc=viresh.kumar@linaro.org \
    --cc=virtio-fs@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 read-only IMAP folder(s) and NNTP newsgroup(s).