aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/x86_64/entry.S
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2010-07-13 18:12:15 +0100
committerKeir Fraser <keir.fraser@citrix.com>2010-07-13 18:12:15 +0100
commit917335d8b352cb59b5d54592693d80f160582d83 (patch)
tree6f0a58884f1bd6e942f9d49995cf09630cab20ae /xen/arch/x86/x86_64/entry.S
parentf65bd343b074358ce3222e9aebd70908d0362f25 (diff)
downloadxen-917335d8b352cb59b5d54592693d80f160582d83.tar.gz
xen-917335d8b352cb59b5d54592693d80f160582d83.tar.bz2
xen-917335d8b352cb59b5d54592693d80f160582d83.zip
x86: Avoid assumptions about C struct layouts from asm code.
Largely this involves avoiding assumptions about 'struct cpu_info'. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Diffstat (limited to 'xen/arch/x86/x86_64/entry.S')
-rw-r--r--xen/arch/x86/x86_64/entry.S17
1 files changed, 3 insertions, 14 deletions
diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index 4cb902ec09..8bb3e228c1 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -12,17 +12,6 @@
#include <asm/page.h>
#include <public/xen.h>
-#define GET_GUEST_REGS(reg) \
- movq $~(STACK_SIZE-1),reg; \
- andq %rsp,reg; \
- orq $(STACK_SIZE-CPUINFO_sizeof),reg;
-
-#define GET_CURRENT(reg) \
- movq $STACK_SIZE-8, reg; \
- orq %rsp, reg; \
- andq $~7,reg; \
- movq (reg),reg;
-
ALIGN
/* %rbx: struct vcpu */
switch_to_kernel:
@@ -434,10 +423,10 @@ domain_crash_synchronous_string:
ENTRY(domain_crash_synchronous)
# Get out of the guest-save area of the stack.
- GET_GUEST_REGS(%rax)
+ GET_CPUINFO_FIELD(CPUINFO_guest_cpu_user_regs,%rax)
movq %rax,%rsp
# create_bounce_frame() temporarily clobbers CS.RPL. Fix up.
- movq CPUINFO_current_vcpu(%rax),%rax
+ GET_CURRENT(%rax)
movq VCPU_domain(%rax),%rax
testb $1,DOMAIN_is_32bit_pv(%rax)
setz %al
@@ -610,7 +599,7 @@ handle_ist_exception:
testb $3,UREGS_cs(%rsp)
jz 1f
/* Interrupted guest context. Copy the context to stack bottom. */
- GET_GUEST_REGS(%rdi)
+ GET_CPUINFO_FIELD(CPUINFO_guest_cpu_user_regs,%rdi)
movq %rsp,%rsi
movl $UREGS_kernel_sizeof/8,%ecx
movq %rdi,%rsp