> -----Original Message-----
> From: Xen-devel [mailto:[email protected]] On Behalf Of
> Jan Beulich
> Sent: 13 March 2019 13:15
> To: Paul Durrant <[email protected]>
> Cc: Stefano Stabellini <[email protected]>; Wei Liu
> <[email protected]>; Konrad Rzeszutek Wilk
> <[email protected]>; George Dunlap <[email protected]>; Andrew
> Cooper
> <[email protected]>; Ian Jackson <[email protected]>; Tim
> (Xen.org) <[email protected]>; Julien
> Grall <[email protected]>; xen-devel <[email protected]>;
> Roger Pau Monne
> <[email protected]>
> Subject: Re: [Xen-devel] [PATCH v5 09/11] viridian: add implementation of
> synthetic interrupt MSRs
>
> >>> On 11.03.19 at 14:41, <[email protected]> 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. It's also written
that way in the spec. so I'd rather leave it as-is.
Paul
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel