[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [virtio-comment] Re: [PATCH v3 4/4] Add CCW configuration field "indirect_num"
On Sat, Mar 19 2022, Christian Schoenebeck <qemu_oss@crudebyte.com> wrote: > On Freitag, 18. MÃrz 2022 17:06:25 CET Halil Pasic wrote: >> I agree that the "including" is important, but I'm not sure about the >> "its contents are undefined". I don't really understand why should we use >> a plural here. What speaks against specifying that in SHOULD be stored >> as 0 by the device, and MUST be ignored by the driver? > > Both solutions would be viable. Personally I would just use something like > "Should be zero" if there is a value in recommending that, but I don't see a > value in recommending to set something to zero and at the same time requiring > to not access it in the first place. > >> Currently we say that \field{max_indirect_num} exists like a be32 field >> even if VIRTIO_RING_F_INDIRECT_SIZE is not negotiated. Which kind of >> implies that at least type invariants should hold. Of course, there is >> none here (i.e. every bits value is also a be32 value), but for something >> like an enum interesting corner cases can pop up. > > I can't follow you on that one. What has that do with enums in this case? > > Anyway, I won't persist on my suggestion to use the (IMO more compact form) > "undefined". If you guys prefer the more specific solution "SHOULD be 0 and > MUST not be accessed" then I will go that way. I'm not sure what mandating 0 and non-access would buy us here... the driver can of course read the field (e.g. when copying the structure wholesale); it just can't make use of the contents when it did not negotiate the feature (but why would it do so in that case anyway?) Also, I think junk remains junk, whether it is a be32 field or interpreted as an enum. It is simply not valid, even if it might by accident end up to be a defined enum value. So I think "undefined" should be fine.
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]