ia64/xen-unstable

changeset 16131:c918a68617c9

x86/64: Do not clobber %r11 (user rflags) on syscall from guest
userspace to guest kernel. The flags are saved on the guest kernel
stack anyway, but some guests rely on %r11 instead.
Signed-off-by: Keir Fraser <keir@xensource.com>
author Keir Fraser <keir@xensource.com>
date Mon Oct 15 12:13:41 2007 +0100 (2007-10-15)
parents 415beae13d06
children c19c51317eeb
files xen/arch/x86/x86_64/entry.S
line diff
     1.1 --- a/xen/arch/x86/x86_64/entry.S	Mon Oct 15 09:28:14 2007 +0100
     1.2 +++ b/xen/arch/x86/x86_64/entry.S	Mon Oct 15 12:13:41 2007 +0100
     1.3 @@ -106,7 +106,7 @@ restore_all_xen:
     1.4   * When entering SYSCALL from kernel mode:
     1.5   *  %rax                            = hypercall vector
     1.6   *  %rdi, %rsi, %rdx, %r10, %r8, %9 = hypercall arguments
     1.7 - *  %r11, %rcx                      = SYSCALL-saved %rflags and %rip
     1.8 + *  %rcx                            = SYSCALL-saved %rip
     1.9   *  NB. We must move %r10 to %rcx for C function-calling ABI.
    1.10   *
    1.11   * When entering SYSCALL from user mode:
    1.12 @@ -125,6 +125,7 @@ ENTRY(syscall_enter)
    1.13          pushq %rcx
    1.14          pushq $0
    1.15          movl  $TRAP_syscall,4(%rsp)
    1.16 +        movq  24(%rsp),%r11 /* Re-load user RFLAGS into %r11 before SAVE_ALL */
    1.17          SAVE_ALL
    1.18          GET_CURRENT(%rbx)
    1.19          testb $TF_kernel_mode,VCPU_thread_flags(%rbx)