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

Re: [Xen-devel] [PATCH 6/6] x86/boot: Ensure the BSS is aligned on an 8 byte boundary



At 16:34 +0100 on 09 Apr (1428597298), Andrew Cooper wrote:
> On 09/04/15 16:15, Tim Deegan wrote:
> > At 18:26 +0100 on 07 Apr (1428431180), Andrew Cooper wrote:
> >> --- a/xen/arch/x86/boot/head.S
> >> +++ b/xen/arch/x86/boot/head.S
> >> @@ -127,7 +127,8 @@ __start:
> >>          mov     $sym_phys(__bss_end),%ecx
> >>          sub     %edi,%ecx
> >>          xor     %eax,%eax
> >> -        rep     stosb
> >> +        shr     $2,%ecx
> >> +        rep     stosl
> > Should this be shr $3 and stosq?  You are aligning to 8 bytes in the
> > linker runes.
> 
> It is still 32bit code here, so no stosq available.

Fair enough. :)

> I do however happen to know that the impending multiboot2 entry point is
> 64bit and is able to clear the BSS with stosq.

OK.

> >>          /* Interrogate CPU extended features via CPUID. */
> >>          mov     $0x80000000,%eax
> >> diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S
> >> index 4699a04..b1926e3 100644
> >> --- a/xen/arch/x86/xen.lds.S
> >> +++ b/xen/arch/x86/xen.lds.S
> >> @@ -163,6 +163,7 @@ SECTIONS
> >>    __init_end = .;
> >>  
> >>    .bss : {                     /* BSS */
> >> +       . = ALIGN(8);
> > Here, we're already aligned to STACK_SIZE
> 
> So we are - that should be fixed up.
> 
> That alignment is not relevant to .init, but is relevant to .bss

Yeah, I'm not sure whether it's a problem if __init_end != .bss; if
not the alignment could just be moved down a bit.

Cheers,

Tim.

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


 


Rackspace

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