[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] x86: drop unneeded __packed attributes



On Mon, Mar 06, 2017 at 09:57:23AM -0700, Jan Beulich wrote:
> >>> On 06.03.17 at 17:42, <roger.pau@xxxxxxxxxx> wrote:
> > There where a couple of unneeded packed attributes in several x86-specific
> > structures, that are obviously aligned. The only non-trivial one is
> > vmcb_struct, which has been checked to have the same layout with and without
> > the packed attribute using pahole. In that case add a build-time size check 
> > to
> > be on the safe side.
> > 
> > No functional change is expected as a result of this commit.
> > 
> > Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
> 
> Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
> albeit ...
> 
> > --- a/xen/arch/x86/hvm/svm/vmcb.c
> > +++ b/xen/arch/x86/hvm/svm/vmcb.c
> > @@ -71,6 +71,9 @@ static int construct_vmcb(struct vcpu *v)
> >      struct arch_svm_struct *arch_svm = &v->arch.hvm_svm;
> >      struct vmcb_struct *vmcb = arch_svm->vmcb;
> >  
> > +    /* Build-time check of the size of VMCB AMD structure. */
> > +    BUILD_BUG_ON(sizeof(*vmcb) != 4096);
> 
> ... I wonder whether this wouldn't better be PAGE_SIZE.

I wondered the same, but then if we ever bump PAGE_SIZE to something else
(which is not likely to happen), this still needs to be 4096. Feel free to
change this to PAGE_SIZE if you prefer.

Roger.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.