lkml.org 
[lkml]   [2018]   [Nov]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] x86/hyper-v: define structures from TLFS as packed
On Fri, 30 Nov 2018, Roman Kagan wrote:

> On Fri, Nov 30, 2018 at 01:15:11PM +0100, Vitaly Kuznetsov wrote:
> > Without 'packed' compiler is free to add optimization paddings and re-order
> > structure fields for randomization/optimization. And structures from
> > hyperv-tlfs.h are used for hypervisor-guest communication, we need to
> > ultimately forbid such practices.
>
> Note that __packed also reduces the structure alignment to 1, which is
> not necessarily what you want.
>
> E.g. some of these structures are passed by pointer to the hypercall,
> which requires its arguments to be 8byte-aligned. I'm also not sure
> that passing unaligned argument to [rw]msr is ok, need to double-check.

If you have alignment requirements then you need to express them too.

Thanks,

tglx

\
 
 \ /
  Last update: 2018-11-30 14:39    [W:0.050 / U:10.196 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site