WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] vmx realmode: Only check for pending inte

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] vmx realmode: Only check for pending interrupts every 16th
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 13 Feb 2008 15:10:11 -0800
Delivery-date: Wed, 13 Feb 2008 15:10:22 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1202926167 0
# Node ID e7085b40dc08d3bff167bcad05b509da22c64e04
# Parent  ec1fa84147ad8c72018f976c953341a5fb657eac
vmx realmode: Only check for pending interrupts every 16th
instruction, since it is a moderately expensive operation.
Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 xen/arch/x86/hvm/vmx/realmode.c |   18 +++++++++++++-----
 1 files changed, 13 insertions(+), 5 deletions(-)

diff -r ec1fa84147ad -r e7085b40dc08 xen/arch/x86/hvm/vmx/realmode.c
--- a/xen/arch/x86/hvm/vmx/realmode.c   Wed Feb 13 16:35:51 2008 +0000
+++ b/xen/arch/x86/hvm/vmx/realmode.c   Wed Feb 13 18:09:27 2008 +0000
@@ -781,7 +781,7 @@ void vmx_realmode(struct cpu_user_regs *
     struct vcpu *curr = current;
     struct realmode_emulate_ctxt rm_ctxt;
     unsigned long intr_info = __vmread(VM_ENTRY_INTR_INFO);
-    int i;
+    unsigned int i, emulations = 0;
 
     rm_ctxt.ctxt.regs = regs;
 
@@ -804,11 +804,19 @@ void vmx_realmode(struct cpu_user_regs *
 
     while ( curr->arch.hvm_vmx.vmxemul &&
             !softirq_pending(smp_processor_id()) &&
-            !curr->arch.hvm_vmx.real_mode_io_in_progress &&
-            /* Check for pending interrupts only in proper real mode. */
-            ((curr->arch.hvm_vcpu.guest_cr[0] & X86_CR0_PE) ||
-             !hvm_local_events_need_delivery(curr)) )
+            !curr->arch.hvm_vmx.real_mode_io_in_progress )
+    {
+        /*
+         * Check for pending interrupts only every 16 instructions, because
+         * hvm_local_events_need_delivery() is moderately expensive, and only
+         * in real mode, because we don't emulate protected-mode IDT vectoring.
+         */
+        if ( unlikely(!(++emulations & 15)) &&
+             !(curr->arch.hvm_vcpu.guest_cr[0] & X86_CR0_PE) &&
+             hvm_local_events_need_delivery(curr) )
+            break;
         realmode_emulate_one(&rm_ctxt);
+    }
 
     if ( !curr->arch.hvm_vmx.vmxemul )
     {

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] vmx realmode: Only check for pending interrupts every 16th, Xen patchbot-unstable <=