From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Tim Deegan <tim@xen.org>
Cc: Keir Fraser <keir@xen.org>, Jan Beulich <JBeulich@suse.com>,
Xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH 6/6] x86/boot: Ensure the BSS is aligned on an 8 byte boundary
Date: Thu, 9 Apr 2015 16:34:58 +0100 [thread overview]
Message-ID: <55269C22.9080208@citrix.com> (raw)
In-Reply-To: <20150409151527.GG34853@deinos.phlegethon.org>
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.
I do however happen to know that the impending multiboot2 entry point is
64bit and is able to clear the BSS with stosq.
>
>>
>> /* 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
> , 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.
I will see about fixing this up differently, but with the same overall
effect that stosl/stosq can be used.
~Andrew
next prev parent reply other threads:[~2015-04-09 15:34 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-07 17:26 [PATCH 0/6] xen/x86: Misc x86 improvements Andrew Cooper
2015-04-07 17:26 ` [PATCH 1/6] x86/link: Discard the alternatives ".discard" sections Andrew Cooper
2015-04-09 14:58 ` Tim Deegan
2015-04-07 17:26 ` [PATCH 2/6] x86/numa: Correct the extern of cpu_to_node Andrew Cooper
2015-04-08 10:24 ` Dario Faggioli
2015-04-09 15:00 ` Tim Deegan
2015-04-09 15:05 ` Andrew Cooper
2015-04-09 15:18 ` Tim Deegan
2015-04-07 17:26 ` [PATCH 3/6] x86/smp: Clean up use of memflags in cpu_smpboot_alloc() Andrew Cooper
2015-04-08 10:15 ` Dario Faggioli
2015-04-09 15:02 ` Tim Deegan
2015-04-09 15:07 ` Andrew Cooper
2015-04-07 17:26 ` [PATCH 4/6] x86/link: Introduce and use __bss_end Andrew Cooper
2015-04-09 15:03 ` Tim Deegan
2015-04-07 17:26 ` [PATCH 5/6] x86/smp: Allocate pcpu stacks on their local numa node Andrew Cooper
2015-04-08 10:16 ` Dario Faggioli
2015-04-09 15:05 ` Tim Deegan
2015-04-07 17:26 ` [PATCH 6/6] x86/boot: Ensure the BSS is aligned on an 8 byte boundary Andrew Cooper
2015-04-09 15:15 ` Tim Deegan
2015-04-09 15:34 ` Andrew Cooper [this message]
2015-04-09 17:32 ` Tim Deegan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55269C22.9080208@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=JBeulich@suse.com \
--cc=keir@xen.org \
--cc=tim@xen.org \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.