ia64/xen-unstable

changeset 4037:8c5837440371

bitkeeper revision 1.1236.12.19 (422ecb2bc2t7QxV32i8WkcYdNFkamw)

A few x86/64 fixes for Jun.
Signed-off-by: Keir Fraser <keir.fraser@cl.cam.ac.uk>
author kaf24@firebug.cl.cam.ac.uk
date Wed Mar 09 10:08:43 2005 +0000 (2005-03-09)
parents 98506ea56438
children fac582936464 95895a9b2358 4956720124f8 4eb6fb3315e8
files xen/arch/x86/domain.c xen/arch/x86/x86_64/entry.S xen/include/public/arch-x86_64.h
line diff
     1.1 --- a/xen/arch/x86/domain.c	Wed Mar 09 09:11:26 2005 +0000
     1.2 +++ b/xen/arch/x86/domain.c	Wed Mar 09 10:08:43 2005 +0000
     1.3 @@ -697,7 +697,8 @@ long do_switch_to_user(void)
     1.4          regs->rcx = stu.rcx;
     1.5      }
     1.6      
     1.7 -    return regs->rax;
     1.8 +    /* Saved %rax gets written back to regs->rax in entry.S. */
     1.9 +    return stu.rax; 
    1.10  }
    1.11  
    1.12  #elif defined(__i386__)
     2.1 --- a/xen/arch/x86/x86_64/entry.S	Wed Mar 09 09:11:26 2005 +0000
     2.2 +++ b/xen/arch/x86/x86_64/entry.S	Wed Mar 09 10:08:43 2005 +0000
     2.3 @@ -243,6 +243,7 @@ FLT15:  movq  %rax,(%rsi)               
     2.4          movq  %rax,XREGS_rip+8(%rsp)
     2.5          movb  $0,TRAPBOUNCE_flags(%rdx)
     2.6          testb $TF_kernel_mode,EDOMAIN_thread_flags(%rbx)
     2.7 +        movq  %rbx,%rdi # toggle_guest_mode(current)
     2.8          jz    SYMBOL_NAME(toggle_guest_mode)
     2.9          ret
    2.10  .section .fixup,"ax"
     3.1 --- a/xen/include/public/arch-x86_64.h	Wed Mar 09 09:11:26 2005 +0000
     3.2 +++ b/xen/include/public/arch-x86_64.h	Wed Mar 09 10:08:43 2005 +0000
     3.3 @@ -95,18 +95,18 @@
     3.4  
     3.5  /*
     3.6   * int HYPERVISOR_switch_to_user(void)
     3.7 - *  All arguments are on the kernel stack, in the following format.
     3.8 + * All arguments are on the kernel stack, in the following format.
     3.9   * Never returns if successful. Current kernel context is lost.
    3.10   * If flags contains ECF_IN_SYSCALL:
    3.11 - *   Restore RIP, RFLAGS, RSP. 
    3.12 + *   Restore RAX, RIP, RFLAGS, RSP. 
    3.13   *   Discard R11, RCX, CS, SS.
    3.14   * Otherwise:
    3.15 - *   Restore R11, RCX, CS:RIP, RFLAGS, SS:RSP.
    3.16 + *   Restore RAX, R11, RCX, CS:RIP, RFLAGS, SS:RSP.
    3.17   * All other registers are saved on hypercall entry and restored to user.
    3.18   */
    3.19  struct switch_to_user {
    3.20      /* Top of stack (%rsp at point of hypercall). */
    3.21 -    u64 r11, rcx, flags, rip, cs, rflags, rsp, ss;
    3.22 +    u64 rax, r11, rcx, flags, rip, cs, rflags, rsp, ss;
    3.23      /* Bottom of switch_to_user stack frame. */
    3.24  } PACKED;
    3.25