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

[Xen-changelog] [xen-unstable] x86: use only a single branch for upcall-pending exit path checks


  • To: xen-changelog@xxxxxxxxxxxxxxxxxxx
  • From: Xen patchbot-unstable <patchbot@xxxxxxx>
  • Date: Fri, 14 Sep 2012 10:55:29 +0000
  • Delivery-date: Fri, 14 Sep 2012 10:55:54 +0000
  • List-id: "Change log for Mercurial \(receive only\)" <xen-changelog.lists.xen.org>

# HG changeset patch
# User Jan Beulich <jbeulich@xxxxxxxx>
# Date 1347438018 -7200
# Node ID dd40b43f16bc5bebd833d4cd2691a5b2a5fbef27
# Parent  8c0aa97d529a55de2ab96be1a5a6e9ed6a9c6bf0
x86: use only a single branch for upcall-pending exit path checks

This utilizes the fact that the two bytes of interest are adjacent to
one another and that the resulting 16-bit values of interest are within
a contiguous range of numbers.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
Acked-by: Keir Fraser <keir@xxxxxxx>
---


diff -r 8c0aa97d529a -r dd40b43f16bc xen/arch/x86/x86_32/entry.S
--- a/xen/arch/x86/x86_32/entry.S       Wed Sep 12 10:19:34 2012 +0200
+++ b/xen/arch/x86/x86_32/entry.S       Wed Sep 12 10:20:18 2012 +0200
@@ -219,10 +219,10 @@ test_all_events:
         jnz  process_nmi
 test_guest_events:
         movl VCPU_vcpu_info(%ebx),%eax
-        testb $0xFF,VCPUINFO_upcall_mask(%eax)
-        jnz  restore_all_guest
-        testb $0xFF,VCPUINFO_upcall_pending(%eax)
-        jz   restore_all_guest
+        movzwl VCPUINFO_upcall_pending(%eax),%eax
+        decl %eax
+        cmpl $0xfe,%eax
+        ja   restore_all_guest
 /*process_guest_events:*/
         sti
         leal VCPU_trap_bounce(%ebx),%edx
diff -r 8c0aa97d529a -r dd40b43f16bc xen/arch/x86/x86_64/compat/entry.S
--- a/xen/arch/x86/x86_64/compat/entry.S        Wed Sep 12 10:19:34 2012 +0200
+++ b/xen/arch/x86/x86_64/compat/entry.S        Wed Sep 12 10:20:18 2012 +0200
@@ -108,10 +108,10 @@ ENTRY(compat_test_all_events)
         jnz   compat_process_nmi
 compat_test_guest_events:
         movq  VCPU_vcpu_info(%rbx),%rax
-        testb $0xFF,COMPAT_VCPUINFO_upcall_mask(%rax)
-        jnz   compat_restore_all_guest
-        testb $0xFF,COMPAT_VCPUINFO_upcall_pending(%rax)
-        jz    compat_restore_all_guest
+        movzwl COMPAT_VCPUINFO_upcall_pending(%rax),%eax
+        decl  %eax
+        cmpl  $0xfe,%eax
+        ja    compat_restore_all_guest
 /*compat_process_guest_events:*/
         sti
         leaq  VCPU_trap_bounce(%rbx),%rdx
diff -r 8c0aa97d529a -r dd40b43f16bc xen/arch/x86/x86_64/entry.S
--- a/xen/arch/x86/x86_64/entry.S       Wed Sep 12 10:19:34 2012 +0200
+++ b/xen/arch/x86/x86_64/entry.S       Wed Sep 12 10:20:18 2012 +0200
@@ -199,8 +199,8 @@ test_all_events:
         movl  VCPU_processor(%rbx),%eax
         shl   $IRQSTAT_shift,%rax
         leaq  irq_stat(%rip),%rcx
-        testl $~0,(%rcx,%rax,1)
-        jnz   process_softirqs
+        cmpl  $0,(%rcx,%rax,1)
+        jne   process_softirqs
         testb $1,VCPU_mce_pending(%rbx)
         jnz   process_mce
 .Ltest_guest_nmi:
@@ -208,10 +208,10 @@ test_all_events:
         jnz   process_nmi
 test_guest_events:
         movq  VCPU_vcpu_info(%rbx),%rax
-        testb $0xFF,VCPUINFO_upcall_mask(%rax)
-        jnz   restore_all_guest
-        testb $0xFF,VCPUINFO_upcall_pending(%rax)
-        jz    restore_all_guest
+        movzwl VCPUINFO_upcall_pending(%rax),%eax
+        decl  %eax
+        cmpl  $0xfe,%eax
+        ja    restore_all_guest
 /*process_guest_events:*/
         sti
         leaq  VCPU_trap_bounce(%rbx),%rdx

_______________________________________________
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®.