aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/x86_64
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2012-09-12 10:20:18 +0200
committerJan Beulich <jbeulich@suse.com>2012-09-12 10:20:18 +0200
commit48baddaa861a8f0704586d449cf1655c87792610 (patch)
treec495831ad4a0aee61f18aede2eeb9da0dadeb923 /xen/arch/x86/x86_64
parent81da4016bfeb5bde06b79004bf5df8738259b1a3 (diff)
downloadxen-48baddaa861a8f0704586d449cf1655c87792610.tar.gz
xen-48baddaa861a8f0704586d449cf1655c87792610.tar.bz2
xen-48baddaa861a8f0704586d449cf1655c87792610.zip
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@suse.com> Acked-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/arch/x86/x86_64')
-rw-r--r--xen/arch/x86/x86_64/compat/entry.S8
-rw-r--r--xen/arch/x86/x86_64/entry.S12
2 files changed, 10 insertions, 10 deletions
diff --git a/xen/arch/x86/x86_64/compat/entry.S b/xen/arch/x86/x86_64/compat/entry.S
index f49ff2d72b..2f606ab925 100644
--- a/xen/arch/x86/x86_64/compat/entry.S
+++ b/xen/arch/x86/x86_64/compat/entry.S
@@ -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 --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index 997bc94c4e..8156827d41 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -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