aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/boot/x86_64.S
diff options
context:
space:
mode:
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2005-12-02 18:00:49 +0100
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2005-12-02 18:00:49 +0100
commit773ded42218d434302b31aa4501649534c62e6d0 (patch)
treed1ef2697f559ee16b2ba5135ed98eae906997866 /xen/arch/x86/boot/x86_64.S
parent9b08b0371d509d9465bacb4dd14fc99b01183d02 (diff)
downloadxen-773ded42218d434302b31aa4501649534c62e6d0.tar.gz
xen-773ded42218d434302b31aa4501649534c62e6d0.tar.bz2
xen-773ded42218d434302b31aa4501649534c62e6d0.zip
Move cpu0_stack out of Xen text section and into BSS. This
avoids getting loads of bogus cpu0_stack lines in call backtraces from non-debug builds. Doing this requires greater alignment of the BSS section, which reveals a bug in ld where the alignment padding is not added to the program segment's memsz field. We get around this by finding the address of the last symbol in the image, and increasing our load image's memsz to include that symbol. Also some cleanups to the linker scripts. Signed-off-by: Keir Fraser <keir@xensource.com>
Diffstat (limited to 'xen/arch/x86/boot/x86_64.S')
-rw-r--r--xen/arch/x86/boot/x86_64.S19
1 files changed, 11 insertions, 8 deletions
diff --git a/xen/arch/x86/boot/x86_64.S b/xen/arch/x86/boot/x86_64.S
index fbe5311124..126850a0f8 100644
--- a/xen/arch/x86/boot/x86_64.S
+++ b/xen/arch/x86/boot/x86_64.S
@@ -249,13 +249,8 @@ ENTRY(idle_pg_table_4)
ENTRY(idle_pg_table_l3)
.quad idle_pg_table_l2 - __PAGE_OFFSET + 7
- .org 0x4000
-/* Maximum STACK_ORDER for x86/64 is 2. We must therefore ensure that the */
-/* CPU0 stack is aligned on a 4-page boundary. */
-ENTRY(cpu0_stack)
-
/* Initial PDE -- level-2 page table. Maps first 64MB physical memory. */
- .org 0x4000 + STACK_SIZE
+ .org 0x4000
ENTRY(idle_pg_table_l2)
.macro identmap from=0, count=32
.if \count-1
@@ -265,7 +260,15 @@ ENTRY(idle_pg_table_l2)
.quad 0x00000000000001e3 + \from
.endif
.endm
- identmap /* Too orangey for crows :-) */
+ identmap
- .org 0x4000 + STACK_SIZE + PAGE_SIZE
+ .org 0x4000 + PAGE_SIZE
.code64
+
+#if (STACK_ORDER == 0)
+.section ".bss.page_aligned","w"
+#else
+.section ".bss.twopage_aligned","w"
+#endif
+ENTRY(cpu0_stack)
+ .fill STACK_SIZE,1,0