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-30 17:02:30 +0100
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2005-12-30 17:02:30 +0100
commite9ac3bbccab099e2079da5201a05a448da1978ce (patch)
tree00dd421c18129f6d7ae52dec48a6527726134d31 /xen/arch/x86/boot/x86_64.S
parentaafd5e14e1c1f65d237574655668cefa3db32154 (diff)
downloadxen-e9ac3bbccab099e2079da5201a05a448da1978ce.tar.gz
xen-e9ac3bbccab099e2079da5201a05a448da1978ce.tar.bz2
xen-e9ac3bbccab099e2079da5201a05a448da1978ce.zip
Move initial stack-pointer adjustment into assembly
bootstrap code. Avoids need for indirection thru reset_stack_and_jump() in C code (which was incorrect for secondary CPUs since nothing was pushed on the stack on that initial call, hence the masking operation had no effect and we ended up running on a bogus stack pointer). 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.S10
1 files changed, 6 insertions, 4 deletions
diff --git a/xen/arch/x86/boot/x86_64.S b/xen/arch/x86/boot/x86_64.S
index d89b7bf51a..3ab012aad8 100644
--- a/xen/arch/x86/boot/x86_64.S
+++ b/xen/arch/x86/boot/x86_64.S
@@ -1,5 +1,6 @@
#include <xen/config.h>
#include <public/xen.h>
+#include <asm/asm_defns.h>
#include <asm/desc.h>
#include <asm/page.h>
#include <asm/msr.h>
@@ -121,7 +122,8 @@ skip_boot_checks:
mov %rcx,%cr4
mov stack_start(%rip),%rsp
-
+ or $(STACK_SIZE-CPUINFO_sizeof),%rsp
+
/* Reset EFLAGS (subsumes CLI and CLD). */
pushq $0
popf
@@ -140,9 +142,9 @@ __high_start:
mov %ecx,%ss
lidt idt_descr(%rip)
-
+
cmp $(SECONDARY_CPU_FLAG),%ebx
- je init_secondary
+ je start_secondary
/* Initialize BSS (no nasty surprises!) */
lea __bss_start(%rip),%rdi
@@ -219,7 +221,7 @@ idt:
.quad idt_table
ENTRY(stack_start)
- .quad cpu0_stack + STACK_SIZE
+ .quad cpu0_stack
high_start:
.quad __high_start