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: Use per-cpu vmcs pointer to avoid un

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] vmx: Use per-cpu vmcs pointer to avoid unnecessary vmcs loading in
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 03 Jul 2007 13:31:33 -0700
Delivery-date: Tue, 03 Jul 2007 13:29:49 -0700
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 kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1183454995 -3600
# Node ID b528cb182cc74fb002953466037ba56d6b9772aa
# Parent  1e04c4be12aa1cac4736b8f7c40df2155ff84f11
vmx: Use per-cpu vmcs pointer to avoid unnecessary vmcs loading in
vmx_do_resume().
Signed-off-by: Eric Liu <eric.e.liu@xxxxxxxxx>
---
 xen/arch/x86/hvm/vmx/vmcs.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletion(-)

diff -r 1e04c4be12aa -r b528cb182cc7 xen/arch/x86/hvm/vmx/vmcs.c
--- a/xen/arch/x86/hvm/vmx/vmcs.c       Tue Jul 03 10:21:21 2007 +0100
+++ b/xen/arch/x86/hvm/vmx/vmcs.c       Tue Jul 03 10:29:55 2007 +0100
@@ -45,6 +45,8 @@ u32 vmx_vmentry_control __read_mostly;
 u32 vmx_vmentry_control __read_mostly;
 bool_t cpu_has_vmx_ins_outs_instr_info __read_mostly;
 
+static DEFINE_PER_CPU(struct vmcs_struct *, current_vmcs);
+
 static u32 vmcs_revision_id __read_mostly;
 
 static u32 adjust_vmx_controls(u32 ctl_min, u32 ctl_opt, u32 msr)
@@ -180,6 +182,9 @@ static void __vmx_clear_vmcs(void *info)
 
     v->arch.hvm_vmx.active_cpu = -1;
     v->arch.hvm_vmx.launched   = 0;
+
+    if ( v->arch.hvm_vmx.vmcs == this_cpu(current_vmcs) )
+        this_cpu(current_vmcs) = NULL;
 }
 
 static void vmx_clear_vmcs(struct vcpu *v)
@@ -199,6 +204,7 @@ static void vmx_load_vmcs(struct vcpu *v
 {
     __vmptrld(virt_to_maddr(v->arch.hvm_vmx.vmcs));
     v->arch.hvm_vmx.active_cpu = smp_processor_id();
+    this_cpu(current_vmcs) = v->arch.hvm_vmx.vmcs;
 }
 
 void vmx_vmcs_enter(struct vcpu *v)
@@ -512,7 +518,8 @@ void vmx_do_resume(struct vcpu *v)
 
     if ( v->arch.hvm_vmx.active_cpu == smp_processor_id() )
     {
-        vmx_load_vmcs(v);
+        if ( v->arch.hvm_vmx.vmcs != this_cpu(current_vmcs) )
+            vmx_load_vmcs(v);
     }
     else
     {

_______________________________________________
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: Use per-cpu vmcs pointer to avoid unnecessary vmcs loading in, Xen patchbot-unstable <=