[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-3.1-testing] x86/64: Do not clobber %r11 (user rflags) on syscall from guest



# HG changeset patch
# User Keir Fraser <keir@xxxxxxxxxxxxx>
# Date 1192611422 -3600
# Node ID c28a2e489db8214d96a2ea8645b8a4dfd39a75f4
# Parent  632552e133534c0294a7ea23b1b83fbe3a8f0b03
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@xxxxxxxxxxxxx>
xen-unstable changeset:   16110:c918a68617c9d562fb697165ea6ddbe665b92aae
xen-unstable date:        Mon Oct 15 12:13:41 2007 +0100
---
 xen/arch/x86/x86_64/entry.S |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)

diff -r 632552e13353 -r c28a2e489db8 xen/arch/x86/x86_64/entry.S
--- a/xen/arch/x86/x86_64/entry.S       Wed Oct 17 09:56:34 2007 +0100
+++ b/xen/arch/x86/x86_64/entry.S       Wed Oct 17 09:57:02 2007 +0100
@@ -106,7 +106,7 @@ restore_all_xen:
  * When entering SYSCALL from kernel mode:
  *  %rax                            = hypercall vector
  *  %rdi, %rsi, %rdx, %r10, %r8, %9 = hypercall arguments
- *  %r11, %rcx                      = SYSCALL-saved %rflags and %rip
+ *  %rcx                            = SYSCALL-saved %rip
  *  NB. We must move %r10 to %rcx for C function-calling ABI.
  *
  * When entering SYSCALL from user mode:
@@ -125,6 +125,7 @@ ENTRY(syscall_enter)
         pushq %rcx
         pushq $0
         movl  $TRAP_syscall,4(%rsp)
+        movq  24(%rsp),%r11 /* Re-load user RFLAGS into %r11 before SAVE_ALL */
         SAVE_ALL
         GET_CURRENT(%rbx)
         testb $TF_kernel_mode,VCPU_thread_flags(%rbx)

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.