ia64/xen-unstable
changeset 4277:9f302fdb83a9
bitkeeper revision 1.1236.1.119 (42419642x9bxSKNyV0KCEA1fUnjaDg)
Fix create_bounce_frame() for both x86/32 and x86/64 (each was broken
in a different way).
Signed-off-by: Keir Fraser <keir@xensource.com>
Fix create_bounce_frame() for both x86/32 and x86/64 (each was broken
in a different way).
Signed-off-by: Keir Fraser <keir@xensource.com>
author | kaf24@firebug.cl.cam.ac.uk |
---|---|
date | Wed Mar 23 16:16:02 2005 +0000 (2005-03-23) |
parents | 5c8a42bc39b3 |
children | 467573b27a0e |
files | xen/arch/x86/x86_32/asm-offsets.c xen/arch/x86/x86_32/entry.S xen/arch/x86/x86_64/entry.S |
line diff
1.1 --- a/xen/arch/x86/x86_32/asm-offsets.c Wed Mar 23 13:43:21 2005 +0000 1.2 +++ b/xen/arch/x86/x86_32/asm-offsets.c Wed Mar 23 16:16:02 2005 +0000 1.3 @@ -47,6 +47,8 @@ void __dummy__(void) 1.4 OFFSET(EDOMAIN_failsafe_addr, struct exec_domain, arch.failsafe_address); 1.5 OFFSET(EDOMAIN_trap_bounce, struct exec_domain, arch.trap_bounce); 1.6 OFFSET(EDOMAIN_thread_flags, struct exec_domain, arch.flags); 1.7 + OFFSET(EDOMAIN_kernel_ss, struct exec_domain, arch.kernel_ss); 1.8 + OFFSET(EDOMAIN_kernel_sp, struct exec_domain, arch.kernel_sp); 1.9 BLANK(); 1.10 1.11 OFFSET(VCPUINFO_upcall_pending, vcpu_info_t, evtchn_upcall_pending);
2.1 --- a/xen/arch/x86/x86_32/entry.S Wed Mar 23 13:43:21 2005 +0000 2.2 +++ b/xen/arch/x86/x86_32/entry.S Wed Mar 23 16:16:02 2005 +0000 2.3 @@ -299,23 +299,15 @@ process_softirqs: 2.4 2.5 /* CREATE A BASIC EXCEPTION FRAME ON GUEST OS (RING-1) STACK: */ 2.6 /* {EIP, CS, EFLAGS, [ESP, SS]} */ 2.7 -/* %edx == trap_bounce, %ebx == task_struct */ 2.8 +/* %edx == trap_bounce, %ebx == struct exec_domain */ 2.9 /* %eax,%ecx are clobbered. %gs:%esi contain new XREGS_ss/XREGS_esp. */ 2.10 create_bounce_frame: 2.11 movl XREGS_eflags+4(%esp),%ecx 2.12 movb XREGS_cs+4(%esp),%cl 2.13 testl $(2|X86_EFLAGS_VM),%ecx 2.14 jz ring1 /* jump if returning to an existing ring-1 activation */ 2.15 - /* obtain ss/esp from TSS -- no current ring-1 activations */ 2.16 - movl EDOMAIN_processor(%ebx),%eax 2.17 - /* next 4 lines multiply %eax by 8320, which is sizeof(tss_struct) */ 2.18 - movl %eax, %ecx 2.19 - shll $7, %ecx 2.20 - shll $13, %eax 2.21 - addl %ecx,%eax 2.22 - addl $init_tss + 12,%eax 2.23 - movl (%eax),%esi /* tss->esp1 */ 2.24 -FLT6: movl 4(%eax),%gs /* tss->ss1 */ 2.25 + movl EDOMAIN_kernel_sp(%ebx),%esi 2.26 +FLT6: movl EDOMAIN_kernel_ss(%ebx),%gs 2.27 testl $X86_EFLAGS_VM,XREGS_eflags+4(%esp) 2.28 jz nvm86_1 2.29 subl $16,%esi /* push ES/DS/FS/GS (VM86 stack frame) */
3.1 --- a/xen/arch/x86/x86_64/entry.S Wed Mar 23 13:43:21 2005 +0000 3.2 +++ b/xen/arch/x86/x86_64/entry.S Wed Mar 23 16:16:02 2005 +0000 3.3 @@ -165,11 +165,11 @@ create_bounce_frame: 3.4 testb $TF_kernel_mode,EDOMAIN_thread_flags(%rbx) 3.5 jnz 1f 3.6 /* Push new frame at registered guest-OS stack base. */ 3.7 - movq EDOMAIN_kernel_sp(%rbx),%rsi 3.8 pushq %rdx 3.9 movq %rbx,%rdi 3.10 call SYMBOL_NAME(toggle_guest_mode) 3.11 popq %rdx 3.12 + movq EDOMAIN_kernel_sp(%rbx),%rsi 3.13 jmp 2f 3.14 1: /* In kernel context already: push new frame at existing %rsp. */ 3.15 movq XREGS_rsp+8(%rsp),%rsi