>>> On 13.03.19 at 17:13, <paul.durr...@citrix.com> wrote:
>>  -----Original Message-----
>> From: Xen-devel [mailto:xen-devel-boun...@lists.xenproject.org] On Behalf Of 
> Jan Beulich
>> Sent: 13 March 2019 13:15
>> To: Paul Durrant <paul.durr...@citrix.com>
>> Cc: Stefano Stabellini <sstabell...@kernel.org>; Wei Liu 
>> <wei.l...@citrix.com>; 
> Konrad Rzeszutek Wilk
>> <konrad.w...@oracle.com>; George Dunlap <george.dun...@citrix.com>; Andrew 
> Cooper
>> <andrew.coop...@citrix.com>; Ian Jackson <ian.jack...@citrix.com>; Tim 
>> (Xen.org) 
> <t...@xen.org>; Julien
>> Grall <julien.gr...@arm.com>; xen-devel <xen-devel@lists.xenproject.org>; 
>> Roger 
> Pau Monne
>> <roger....@citrix.com>
>> Subject: Re: [Xen-devel] [PATCH v5 09/11] viridian: add implementation of 
> synthetic interrupt MSRs
>> 
>> >>> On 11.03.19 at 14:41, <paul.durr...@citrix.com> wrote:
>> > @@ -28,6 +29,32 @@ typedef union _HV_VP_ASSIST_PAGE
>> >      uint8_t ReservedZBytePadding[PAGE_SIZE];
>> >  } HV_VP_ASSIST_PAGE;
>> >
>> > +typedef enum HV_MESSAGE_TYPE {
>> > +    HvMessageTypeNone,
>> > +    HvMessageTimerExpired = 0x80000010,
>> > +} HV_MESSAGE_TYPE;
>> > +
>> > +typedef struct HV_MESSAGE_FLAGS {
>> > +    uint8_t MessagePending:1;
>> > +    uint8_t Reserved:7;
>> > +} HV_MESSAGE_FLAGS;
>> > +
>> > +typedef struct HV_MESSAGE_HEADER {
>> > +    HV_MESSAGE_TYPE MessageType;
>> > +    uint16_t Reserved1;
>> > +    HV_MESSAGE_FLAGS MessageFlags;
>> > +    uint8_t PayloadSize;
>> > +    uint64_t Reserved2;
>> > +} HV_MESSAGE_HEADER;
>> > +
>> > +#define HV_MESSAGE_SIZE 256
>> > +#define HV_MESSAGE_MAX_PAYLOAD_QWORD_COUNT 30
>> 
> 
> Missed this one before...
> 
>> Is this defined this way, or (given ...
>> 
>> > +typedef struct HV_MESSAGE {
>> > +    HV_MESSAGE_HEADER Header;
>> > +    uint64_t Payload[HV_MESSAGE_MAX_PAYLOAD_QWORD_COUNT];
>> > +} HV_MESSAGE;
>> 
>> ... this) isn't it rather
>> 
>> #define HV_MESSAGE_MAX_PAYLOAD_QWORD_COUNT \
>>     ((HV_MESSAGE_SIZE - sizeof(HV_MESSAGE_HEADER) / 8)
>> 
> 
> I need the definition for the array in the struct so that sizeof(HV_MESSAGE) 
> == HV_MESSAGE_SIZE (for which there is a BUILD_BUG_ON()) later.

I don't understand this part - I'm not asking to ditch the #define.
As to the BUILD_BUG_ON() - I see now, but that's only in patch
10, and in a specific message handler. I think this would belong
here, and in the main viridian.c file.

> It's also written that way in the spec. so I'd rather leave it as-is.

Well, okay then - I was sort of expecting this to be spelled out
there in such a way. That doesn't change my overall opinion,
but I can see your point of wanting to match the spec, and you
being the maintainer I have no basis to insist anyway.

Jan



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reply via email to