kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>, qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Dmitry Fleytman <dmitry.fleytman@gmail.com>,
	Jason Wang <jasowang@redhat.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>,
	kvm@vger.kernel.org
Subject: Re: [PATCH RFC v2 06/13] virtio-pci: implement support for extended features
Date: Wed, 16 Jul 2025 11:14:34 +0200	[thread overview]
Message-ID: <59102a09-1e25-4c14-a681-7170c87df501@redhat.com> (raw)
In-Reply-To: <f1381483-a507-4420-a0c9-52bf8131e6e6@redhat.com>

On 7/15/25 6:21 PM, Paolo Abeni wrote:
> On 7/15/25 9:42 AM, Akihiko Odaki wrote:
>> On 2025/07/11 22:02, Paolo Abeni wrote:
>>> @@ -158,7 +159,10 @@ struct VirtIOPCIProxy {
>>>       uint32_t nvectors;
>>>       uint32_t dfselect;
>>>       uint32_t gfselect;
>>> -    uint32_t guest_features[2];
>>> +    union {
>>> +        uint32_t guest_features[2];
>>> +        uint32_t guest_features128[4];
>>> +    };
>>
>> I don't see anything preventing you from directly extending guest_features.
> 
> Uhmm... I have a vague memory of some interim revisions doing that and
> failing miserably (but I have no log of the actual details). I'll try to
> have another shot at it.

The VMSTATE_ARRAY() macro has explicit checks on the specified array
matching exactly the specified array size. Using a single:

	uint32_t guest_features[4];

variable, this statement

	 VMSTATE_UINT32_ARRAY(guest_features, VirtIOPCIProxy, 2),

causes the following build error:

--
include/migration/vmstate.h:259:48: error: invalid operands to binary -
(have ‘uint32_t (*)[2]’ {aka ‘unsigned int (*)[2]’} and ‘uint32_t
(*)[4]’ {aka ‘unsigned int (*)[4]’})
  259 | #define type_check_array(t1,t2,n) ((t1(*)[n])0 - (t2*)0)
      |                                                ^
include/migration/vmstate.h:282:6: note: in expansion of macro
‘type_check_array’
  282 |      type_check_array(_type, typeof_field(_state, _field), _num))
      |      ^~~~~~~~~~~~~~~~
include/migration/vmstate.h:373:19: note: in expansion of macro
‘vmstate_offset_array’
  373 |     .offset     = vmstate_offset_array(_state, _field, _type,
_num), \
      |                   ^~~~~~~~~~~~~~~~~~~~
include/migration/vmstate.h:1090:5: note: in expansion of macro
‘VMSTATE_ARRAY’
 1090 |     VMSTATE_ARRAY(_f, _s, _n, _v, vmstate_info_uint32, uint32_t)
      |     ^~~~~~~~~~~~~
include/migration/vmstate.h:1096:5: note: in expansion of macro
‘VMSTATE_UINT32_ARRAY_V’
 1096 |     VMSTATE_UINT32_ARRAY_V(_f, _s, _n, 0)
      |     ^~~~~~~~~~~~~~~~~~~~~~
../hw/virtio/virtio-pci.c:168:9: note: in expansion of macro
‘VMSTATE_UINT32_ARRAY’
  168 |         VMSTATE_UINT32_ARRAY(guest_features, VirtIOPCIProxy, 2),
      |         ^~~~~~~~~~~~~~~~~~~~
--

I'll keep the union here.

Thanks,

Paolo


  reply	other threads:[~2025-07-16  9:14 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-11 13:02 [PATCH RFC v2 00/13] virtio: introduce support for GSO over UDP tunnel Paolo Abeni
2025-07-11 13:02 ` [PATCH RFC v2 01/13] net: bundle all offloads in a single struct Paolo Abeni
2025-07-15  6:36   ` Akihiko Odaki
2025-07-15 14:52     ` Paolo Abeni
2025-07-16 11:32       ` Akihiko Odaki
2025-07-11 13:02 ` [PATCH RFC v2 02/13] linux-headers: Update to Linux ~v6.16-rc5 net-next Paolo Abeni
2025-07-11 13:02 ` [PATCH RFC v2 03/13] virtio: introduce extended features type Paolo Abeni
2025-07-15  6:57   ` Akihiko Odaki
2025-07-11 13:02 ` [PATCH RFC v2 04/13] virtio: serialize extended features state Paolo Abeni
2025-07-15  7:24   ` Akihiko Odaki
2025-07-15 15:40     ` Paolo Abeni
2025-07-16 11:52       ` Akihiko Odaki
2025-07-11 13:02 ` [PATCH RFC v2 05/13] virtio: add support for negotiating extended features Paolo Abeni
2025-07-11 13:02 ` [PATCH RFC v2 06/13] virtio-pci: implement support for " Paolo Abeni
2025-07-15  7:42   ` Akihiko Odaki
2025-07-15 16:21     ` Paolo Abeni
2025-07-16  9:14       ` Paolo Abeni [this message]
2025-07-16 11:55         ` Akihiko Odaki
2025-07-11 13:02 ` [PATCH RFC v2 07/13] vhost: add support for negotiating " Paolo Abeni
2025-07-11 13:02 ` [PATCH RFC v2 08/13] qmp: update virtio features map to support " Paolo Abeni
2025-07-15  7:59   ` Akihiko Odaki
2025-07-15 15:43     ` Paolo Abeni
2025-07-16 12:00       ` Akihiko Odaki
2025-07-11 13:02 ` [PATCH RFC v2 09/13] vhost-backend: implement extended features support Paolo Abeni
2025-07-11 13:02 ` [PATCH RFC v2 10/13] vhost-net: " Paolo Abeni
2025-07-11 13:02 ` [PATCH RFC v2 11/13] virtio-net: " Paolo Abeni
2025-07-11 13:02 ` [PATCH RFC v2 12/13] net: implement tunnel probing Paolo Abeni
2025-07-15  8:05   ` Akihiko Odaki
2025-07-15 15:49     ` Paolo Abeni
2025-07-18  4:38       ` Akihiko Odaki
2025-07-11 13:02 ` [PATCH RFC v2 13/13] net: implement UDP tunnel features offloading Paolo Abeni
2025-07-15  8:07   ` Akihiko Odaki
2025-07-16 10:13     ` Paolo Abeni
2025-07-16 12:04       ` Akihiko Odaki
2025-07-14  8:43 ` [PATCH RFC v2 00/13] virtio: introduce support for GSO over UDP tunnel Lei Yang
2025-07-14  9:05   ` Paolo Abeni
2025-07-14  9:09     ` 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=59102a09-1e25-4c14-a681-7170c87df501@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=kvm@vger.kernel.org \
    --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 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).