From: Tim Deegan Subject: Re: [PATCH 6/6] x86/boot: Ensure the BSS is aligned on an 8 byte boundary Date: Thu, 9 Apr 2015 16:15:27 +0100 Message-ID: <20150409151527.GG34853@deinos.phlegethon.org> References: <1428427580-8854-1-git-send-email-andrew.cooper3@citrix.com> <1428427580-8854-7-git-send-email-andrew.cooper3@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1428427580-8854-7-git-send-email-andrew.cooper3@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper Cc: Keir Fraser , Jan Beulich , Xen-devel List-Id: xen-devel@lists.xenproject.org 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. > > /* 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, which the .bss.stack_aligned just below is relying on. So on the one hand this new alignment comment is sort-of-harmless, but on the other hand it distracts from the larger and more important alignment. Cheers, Tim. > __bss_start = .; > *(.bss.stack_aligned) > . = ALIGN(PAGE_SIZE); > @@ -175,6 +176,7 @@ SECTIONS > *(.bss.percpu.read_mostly) > . = ALIGN(SMP_CACHE_BYTES); > __per_cpu_data_end = .; > + . = ALIGN(8); > __bss_end = .; > } :text > _end = . ; > -- > 1.7.10.4 > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel