[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] x86 vmx: Streamline vmx_interrupt_blocked() to avoid a VMREAD if
# HG changeset patch # User Keir Fraser <keir.fraser@xxxxxxxxxx> # Date 1202920118 0 # Node ID 4c64376d439d3237e81f56b0fdfac7fe6601ec82 # Parent e56c9fe4a7e6d044d31a052072e6bfb06ee58535 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@xxxxxxxxxx> --- xen/arch/x86/hvm/vmx/vmx.c | 11 ++++++++--- 1 files changed, 8 insertions(+), 3 deletions(-) diff -r e56c9fe4a7e6 -r 4c64376d439d xen/arch/x86/hvm/vmx/vmx.c --- a/xen/arch/x86/hvm/vmx/vmx.c Wed Feb 13 16:25:32 2008 +0000 +++ b/xen/arch/x86/hvm/vmx/vmx.c Wed Feb 13 16:28:38 2008 +0000 @@ -917,6 +917,14 @@ static enum hvm_intblk vmx_interrupt_blo { unsigned long intr_shadow; + /* + * Test EFLAGS.IF first. It is often the most likely reason for interrupt + * blockage, and is the cheapest to test (because no VMREAD is required). + */ + if ( (intack.source != hvm_intsrc_nmi) && + !(guest_cpu_user_regs()->eflags & X86_EFLAGS_IF) ) + return hvm_intblk_rflags_ie; + intr_shadow = __vmread(GUEST_INTERRUPTIBILITY_INFO); if ( intr_shadow & (VMX_INTR_SHADOW_STI|VMX_INTR_SHADOW_MOV_SS) ) @@ -928,9 +936,6 @@ static enum hvm_intblk vmx_interrupt_blo ASSERT((intack.source == hvm_intsrc_pic) || (intack.source == hvm_intsrc_lapic)); - - if ( !(guest_cpu_user_regs()->eflags & X86_EFLAGS_IF) ) - return hvm_intblk_rflags_ie; return hvm_intblk_none; } _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |