x86: slightly streamline __prepare_to_wait() inline assembly
authorJan Beulich <jbeulich@suse.com>
Wed, 26 Sep 2012 09:51:27 +0000 (11:51 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 26 Sep 2012 09:51:27 +0000 (11:51 +0200)
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen/common/wait.c

index aaeabc9bcca879742cda0834ce711f9da27cffb3..26de48cede2fc167fa127fb401d7d96e3a3bd062 100644 (file)
@@ -143,15 +143,13 @@ static void __prepare_to_wait(struct waitqueue_vcpu *wqv)
         "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) )