debuggers.hg
changeset 17077:4c64376d439d
x86 vmx: Streamline vmx_interrupt_blocked() to avoid a VMREAD if
interrupt delivery is blocked by EFLAGS.IF. This speeds up real-mode
emulation in some cases (where we are currently executing
hvm_local_events_need_delivery() after every instruction).
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
interrupt delivery is blocked by EFLAGS.IF. This speeds up real-mode
emulation in some cases (where we are currently executing
hvm_local_events_need_delivery() after every instruction).
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author | Keir Fraser <keir.fraser@citrix.com> |
---|---|
date | Wed Feb 13 16:28:38 2008 +0000 (2008-02-13) |
parents | e56c9fe4a7e6 |
children | ec1fa84147ad |
files | xen/arch/x86/hvm/vmx/vmx.c |
line diff
1.1 --- a/xen/arch/x86/hvm/vmx/vmx.c Wed Feb 13 16:25:32 2008 +0000 1.2 +++ b/xen/arch/x86/hvm/vmx/vmx.c Wed Feb 13 16:28:38 2008 +0000 1.3 @@ -917,6 +917,14 @@ static enum hvm_intblk vmx_interrupt_blo 1.4 { 1.5 unsigned long intr_shadow; 1.6 1.7 + /* 1.8 + * Test EFLAGS.IF first. It is often the most likely reason for interrupt 1.9 + * blockage, and is the cheapest to test (because no VMREAD is required). 1.10 + */ 1.11 + if ( (intack.source != hvm_intsrc_nmi) && 1.12 + !(guest_cpu_user_regs()->eflags & X86_EFLAGS_IF) ) 1.13 + return hvm_intblk_rflags_ie; 1.14 + 1.15 intr_shadow = __vmread(GUEST_INTERRUPTIBILITY_INFO); 1.16 1.17 if ( intr_shadow & (VMX_INTR_SHADOW_STI|VMX_INTR_SHADOW_MOV_SS) ) 1.18 @@ -929,9 +937,6 @@ static enum hvm_intblk vmx_interrupt_blo 1.19 ASSERT((intack.source == hvm_intsrc_pic) || 1.20 (intack.source == hvm_intsrc_lapic)); 1.21 1.22 - if ( !(guest_cpu_user_regs()->eflags & X86_EFLAGS_IF) ) 1.23 - return hvm_intblk_rflags_ie; 1.24 - 1.25 return hvm_intblk_none; 1.26 } 1.27