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

[Xen-devel] [PATCH 3/4] x86: slightly streamline __prepare_to_wait() inline assembly


  • To: "xen-devel" <xen-devel@xxxxxxxxxxxxx>
  • From: "Jan Beulich" <JBeulich@xxxxxxxx>
  • Date: Fri, 21 Sep 2012 13:22:02 +0100
  • Delivery-date: Fri, 21 Sep 2012 12:22:19 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

--- a/xen/common/wait.c
+++ b/xen/common/wait.c
@@ -143,15 +143,13 @@ static void __prepare_to_wait(struct wai
         "push %%rax; push %%rbx; push %%rdx; "
         "push %%rbp; push %%r8; push %%r9; push %%r10; push %%r11; "
         "push %%r12; push %%r13; push %%r14; push %%r15; call 1f; "
-        "1: mov %%rsp,%%rsi; addq $2f-1b,(%%rsp); "
-        "sub %%rsi,%%rcx; cmp %3,%%rcx; jbe 2f; "
-        "xor %%esi,%%esi; jmp 3f; "
-        "2: rep movsb; mov %%rsp,%%rsi; 3: pop %%rax; "
+        "1: addq $2f-1b,(%%rsp); sub %%esp,%%ecx; cmp %3,%%ecx; jbe 3f; "
+        "mov %%rsp,%%rsi; 2: rep movsb; mov %%rsp,%%rsi; 3: pop %%rax; "
         "pop %%r15; pop %%r14; pop %%r13; pop %%r12; "
         "pop %%r11; pop %%r10; pop %%r9; pop %%r8; "
         "pop %%rbp; pop %%rdx; pop %%rbx; pop %%rax"
         : "=&S" (wqv->esp), "=&c" (dummy), "=&D" (dummy)
-        : "i" (PAGE_SIZE), "1" (cpu_info), "2" (wqv->stack)
+        : "i" (PAGE_SIZE), "0" (0), "1" (cpu_info), "2" (wqv->stack)
         : "memory" );
 
     if ( unlikely(wqv->esp == 0) )



Attachment: x86-wait-simplify.patch
Description: Text document

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

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