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

[Xen-changelog] [xen-unstable] x86-64: drop updating of UREGS_rip when converting sysenter to #GP


  • To: xen-changelog@xxxxxxxxxxxxxxxxxxx
  • From: Xen patchbot-unstable <patchbot@xxxxxxx>
  • Date: Sat, 28 Jul 2012 03:00:28 +0000
  • Delivery-date: Sat, 28 Jul 2012 03:00:34 +0000
  • List-id: "Change log for Mercurial \(receive only\)" <xen-changelog.lists.xen.org>

# HG changeset patch
# User Jan Beulich <jbeulich@xxxxxxxx>
# Date 1343376012 -7200
# Node ID fab4434f514532dba54ff4eec8b8ffa230f8330f
# Parent  70cf2aa3083ca69d4568b11e3b1243cff670422b
x86-64: drop updating of UREGS_rip when converting sysenter to #GP

This was set to zero immediately before the #GP injection code, since
SYSENTER doesn't really have a return address.

Reported-by: Ian Campbell <Ian.Campbell@xxxxxxxxxx>

Furthermore, UREGS_cs and UREGS_rip don't need to be written a second
time, as the PUSHes above already can/do take care of putting in place
the intended values.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Acked-by: Keir Fraser <keir@xxxxxxx>
---


diff -r 70cf2aa3083c -r fab4434f5145 xen/arch/x86/x86_64/entry.S
--- a/xen/arch/x86/x86_64/entry.S       Fri Jul 27 09:59:25 2012 +0200
+++ b/xen/arch/x86/x86_64/entry.S       Fri Jul 27 10:00:12 2012 +0200
@@ -275,15 +275,13 @@ ENTRY(sysenter_entry)
         pushfq
         .globl sysenter_eflags_saved
 sysenter_eflags_saved:
-        pushq $0
-        pushq $0
+        pushq $3 /* ring 3 null cs */
+        pushq $0 /* null rip */
         pushq $0
         movl  $TRAP_syscall,4(%rsp)
         SAVE_ALL
         GET_CURRENT(%rbx)
         cmpb  $0,VCPU_sysenter_disables_events(%rbx)
-        movq  $0,UREGS_rip(%rsp) /* null rip */
-        movl  $3,UREGS_cs(%rsp)  /* ring 3 null cs */
         movq  VCPU_sysenter_addr(%rbx),%rax
         setne %cl
         leaq  VCPU_trap_bounce(%rbx),%rdx
@@ -292,7 +290,6 @@ sysenter_eflags_saved:
 UNLIKELY_START(z, sysenter_gpf)
         movq  VCPU_trap_ctxt(%rbx),%rsi
         movl  $TRAP_gp_fault,UREGS_entry_vector(%rsp)
-        subq  $2,UREGS_rip(%rsp)
         movl  %eax,TRAPBOUNCE_error_code(%rdx)
         movq  TRAP_gp_fault * TRAPINFO_sizeof + TRAPINFO_eip(%rsi),%rax
         testb $4,TRAP_gp_fault * TRAPINFO_sizeof + TRAPINFO_flags(%rsi)

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
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®.