bitkeeper revision 1.1236.12.19 (422ecb2bc2t7QxV32i8WkcYdNFkamw)
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Wed, 9 Mar 2005 10:08:43 +0000 (10:08 +0000)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Wed, 9 Mar 2005 10:08:43 +0000 (10:08 +0000)
A few x86/64 fixes for Jun.
Signed-off-by: Keir Fraser <keir.fraser@cl.cam.ac.uk>
xen/arch/x86/domain.c
xen/arch/x86/x86_64/entry.S
xen/include/public/arch-x86_64.h

index 4be8043bef3c494ab5367de8fda0c29c7f5a5bde..c19bc39bcdae43e46350ddb0247263ecbb578058 100644 (file)
@@ -697,7 +697,8 @@ long do_switch_to_user(void)
         regs->rcx = stu.rcx;
     }
     
-    return regs->rax;
+    /* Saved %rax gets written back to regs->rax in entry.S. */
+    return stu.rax; 
 }
 
 #elif defined(__i386__)
index 181e2e3ce40a43a9dd02bcbde6deac34af1cc83e..93bd397386bfa36f7a12a871543fef9f120b7de7 100644 (file)
@@ -243,6 +243,7 @@ FLT15:  movq  %rax,(%rsi)               # RCX
         movq  %rax,XREGS_rip+8(%rsp)
         movb  $0,TRAPBOUNCE_flags(%rdx)
         testb $TF_kernel_mode,EDOMAIN_thread_flags(%rbx)
+        movq  %rbx,%rdi # toggle_guest_mode(current)
         jz    SYMBOL_NAME(toggle_guest_mode)
         ret
 .section .fixup,"ax"
index 21299c974c206bf8985ac9120fb570aad60f9330..6a9ee1dcf70027aa72e857486c6ab192ade42c17 100644 (file)
 
 /*
  * int HYPERVISOR_switch_to_user(void)
- *  All arguments are on the kernel stack, in the following format.
+ * All arguments are on the kernel stack, in the following format.
  * Never returns if successful. Current kernel context is lost.
  * If flags contains ECF_IN_SYSCALL:
- *   Restore RIP, RFLAGS, RSP. 
+ *   Restore RAX, RIP, RFLAGS, RSP. 
  *   Discard R11, RCX, CS, SS.
  * Otherwise:
- *   Restore R11, RCX, CS:RIP, RFLAGS, SS:RSP.
+ *   Restore RAX, R11, RCX, CS:RIP, RFLAGS, SS:RSP.
  * All other registers are saved on hypercall entry and restored to user.
  */
 struct switch_to_user {
     /* Top of stack (%rsp at point of hypercall). */
-    u64 r11, rcx, flags, rip, cs, rflags, rsp, ss;
+    u64 rax, r11, rcx, flags, rip, cs, rflags, rsp, ss;
     /* Bottom of switch_to_user stack frame. */
 } PACKED;