From: Paolo Abeni <pabeni@redhat.com>
To: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>,
qemu-devel@nongnu.org, Jason Wang <jasowang@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
Dmitry Fleytman <dmitry.fleytman@gmail.com>,
Sriram Yagnaraman <sriram.yagnaraman@ericsson.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
Stefano Garzarella <sgarzare@redhat.com>,
Cornelia Huck <cohuck@redhat.com>,
Luigi Rizzo <lrizzo@google.com>,
Giuseppe Lettieri <g.lettieri@iet.unipi.it>,
Vincenzo Maffione <v.maffione@gmail.com>,
Eric Blake <eblake@redhat.com>,
Markus Armbruster <armbru@redhat.com>
Subject: Re: [RFC PATCH v4 07/14] virtio-pci: implement support for extended features
Date: Thu, 7 Aug 2025 22:18:37 +0200 [thread overview]
Message-ID: <7c7c3f2c-e643-46ad-810c-aefdd486ad78@redhat.com> (raw)
In-Reply-To: <de3c69a8-d874-44a3-bd47-91b6b298e184@rsg.ci.i.u-tokyo.ac.jp>
On 7/26/25 1:52 PM, Akihiko Odaki wrote:
> On 2025/07/24 4:31, Paolo Abeni wrote:
>> @@ -1477,6 +1509,13 @@ int virtio_pci_add_shm_cap(VirtIOPCIProxy *proxy,
>> return virtio_pci_add_mem_cap(proxy, &cap.cap);
>> }
>>
>> +static int virtio_pci_select_max(const VirtIODevice *vdev)
>> +{
>> + return virtio_features_use_ex(vdev->host_features_ex) ?
>> + VIRTIO_FEATURES_NU32S :
>> + 2;
>
> This function could be simplified by replacing VIRTIO_FEATURES_NU32S
> without any functional difference:
>
> 1. For writes: virtio_set_features_ex() already ignores extended
> features when !virtio_features_use_ex(vdev->host_features_ex)
> 2. For reads: When !virtio_features_use_ex(vdev->host_features_ex), the
> upper bits of host_features_ex are zero, and guest_features upper bits
> remain zero (since they can't be set per point 1)
>
> So the conditional logic is redundant here.
This is to satisfy a request from Jason:
https://lists.gnu.org/archive/html/qemu-devel/2025-07/msg05291.html
https://lists.gnu.org/archive/html/qemu-devel/2025-07/msg05423.html
I agree there will not be functional differences always accessing the
full space, but the guest could still be able to notice, i.e. the
extended space will be zeroed on read with that patched qemu and
untouched by the current code and this patch. To be on the safe side I
think it would be better to avoid such difference, as suggested by Jason.
Does the above make sense to you?
Thanks,
Paolo
next prev parent reply other threads:[~2025-08-07 20:19 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-23 19:31 [RFC PATCH v4 00/14] virtio: introduce support for GSO over UDP tunnel Paolo Abeni
2025-07-23 19:31 ` [RFC PATCH v4 01/14] net: bundle all offloads in a single struct Paolo Abeni
2025-07-23 19:31 ` [RFC PATCH v4 02/14] linux-headers: deal with counted_by annotation Paolo Abeni
2025-07-23 19:31 ` [RFC PATCH v4 03/14] linux-headers: Update to Linux ~v6.16-rc7 net-next Paolo Abeni
2025-07-23 19:31 ` [RFC PATCH v4 04/14] virtio: introduce extended features type Paolo Abeni
2025-07-25 6:44 ` Akihiko Odaki
2025-07-23 19:31 ` [RFC PATCH v4 05/14] virtio: serialize extended features state Paolo Abeni
2025-07-23 19:31 ` [RFC PATCH v4 06/14] virtio: add support for negotiating extended features Paolo Abeni
2025-07-25 6:51 ` Akihiko Odaki
2025-07-23 19:31 ` [RFC PATCH v4 07/14] virtio-pci: implement support for " Paolo Abeni
2025-07-26 11:52 ` Akihiko Odaki
2025-08-07 20:18 ` Paolo Abeni [this message]
2025-08-08 4:50 ` Akihiko Odaki
2025-08-12 4:01 ` Jason Wang
2025-08-12 8:03 ` Akihiko Odaki
2025-08-13 5:55 ` Jason Wang
2025-08-13 6:59 ` Paolo Abeni
2025-07-23 19:31 ` [RFC PATCH v4 08/14] vhost: add support for negotiating " Paolo Abeni
2025-07-23 19:31 ` [RFC PATCH v4 09/14] qmp: update virtio features map to support " Paolo Abeni
2025-07-23 19:31 ` [RFC PATCH v4 10/14] vhost-backend: implement extended features support Paolo Abeni
2025-07-23 19:31 ` [RFC PATCH v4 11/14] vhost-net: " Paolo Abeni
2025-07-23 19:31 ` [RFC PATCH v4 12/14] virtio-net: " Paolo Abeni
2025-07-23 19:31 ` [RFC PATCH v4 13/14] net: implement tunnel probing Paolo Abeni
2025-07-23 19:31 ` [RFC PATCH v4 14/14] net: implement UDP tunnel features offloading Paolo Abeni
2025-07-25 9:24 ` [RFC PATCH v4 00/14] virtio: introduce support for GSO over UDP tunnel Lei Yang
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=7c7c3f2c-e643-46ad-810c-aefdd486ad78@redhat.com \
--to=pabeni@redhat.com \
--cc=armbru@redhat.com \
--cc=cohuck@redhat.com \
--cc=dmitry.fleytman@gmail.com \
--cc=eblake@redhat.com \
--cc=g.lettieri@iet.unipi.it \
--cc=jasowang@redhat.com \
--cc=lrizzo@google.com \
--cc=mst@redhat.com \
--cc=odaki@rsg.ci.i.u-tokyo.ac.jp \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=sgarzare@redhat.com \
--cc=sriram.yagnaraman@ericsson.com \
--cc=v.maffione@gmail.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 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.