RE: [PATCH v2] x86/hyper-v: Mark TLFS structures packed

2018-12-03 Thread Vitaly Kuznetsov
Michael Kelley writes: > From: Vitaly Kuznetsov Sent: Friday, November 30, 2018 > 4:54 AM >> >> @@ -466,7 +466,7 @@ union hv_message_flags { >> struct { >> __u8 msg_pending:1; >> __u8 reserved:7; >> -}; >> +} __packed; >> }; >> >> /* Define port ident

Re: [PATCH v2] x86/hyper-v: Mark TLFS structures packed

2018-12-02 Thread Roman Kagan
On Mon, Dec 03, 2018 at 12:35:35AM +0100, Vitaly Kuznetsov wrote: > Nadav Amit writes: > > [skip] > > > > > Having said that, something else is sort of strange in the TLFS definitions, > > I think (I really know little about this whole protocol). Look at the > > following definitions from hyperv

RE: [PATCH v2] x86/hyper-v: Mark TLFS structures packed

2018-12-02 Thread Michael Kelley
From: Vitaly Kuznetsov Sent: Friday, November 30, 2018 4:54 AM > > @@ -466,7 +466,7 @@ union hv_message_flags { > struct { > __u8 msg_pending:1; > __u8 reserved:7; > - }; > + } __packed; > }; > > /* Define port identifier type. */ I think __packed i

Re: [PATCH v2] x86/hyper-v: Mark TLFS structures packed

2018-12-02 Thread Vitaly Kuznetsov
Nadav Amit writes: [skip] > > Having said that, something else is sort of strange in the TLFS definitions, > I think (I really know little about this whole protocol). Look at the > following definitions from hyperv-tlfs.h: > >> struct hv_vpset { >> u64 format; >> u64 valid_bank_m

Re: [PATCH v2] x86/hyper-v: Mark TLFS structures packed

2018-11-30 Thread Nadav Amit
> On Nov 30, 2018, at 4:54 AM, Vitaly Kuznetsov wrote: > > The TLFS structures are used for hypervisor-guest communication and must > exactly meet the specification. > > Compilers can add alignment padding to structures or reorder struct members > for randomization and optimization, which would