[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] [VMX] Replace vmx_load_cr2() with direct write to %cr2.



# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Node ID 1c506820c46864e337fcbe79f091ce38b4ec8c31
# Parent  1bf4f15c5141edb20bddacc09ec64db550236e05
[VMX] Replace vmx_load_cr2() with direct write to %cr2.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 xen/arch/x86/hvm/vmx/vmx.c          |    8 --------
 xen/arch/x86/hvm/vmx/x86_32/exits.S |    3 ++-
 xen/arch/x86/hvm/vmx/x86_64/exits.S |    3 ++-
 xen/arch/x86/x86_32/asm-offsets.c   |    1 +
 xen/arch/x86/x86_64/asm-offsets.c   |    1 +
 5 files changed, 6 insertions(+), 10 deletions(-)

diff -r 1bf4f15c5141 -r 1c506820c468 xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c        Tue Oct 31 12:42:50 2006 +0000
+++ b/xen/arch/x86/hvm/vmx/vmx.c        Tue Oct 31 13:26:49 2006 +0000
@@ -2419,14 +2419,6 @@ asmlinkage void vmx_vmexit_handler(struc
     }
 }
 
-asmlinkage void vmx_load_cr2(void)
-{
-    struct vcpu *v = current;
-
-    local_irq_disable();
-    asm volatile("mov %0,%%cr2": :"r" (v->arch.hvm_vmx.cpu_cr2));
-}
-
 asmlinkage void vmx_trace_vmentry(void)
 {
     TRACE_5D(TRC_VMX_VMENTRY + current->vcpu_id,
diff -r 1bf4f15c5141 -r 1c506820c468 xen/arch/x86/hvm/vmx/x86_32/exits.S
--- a/xen/arch/x86/hvm/vmx/x86_32/exits.S       Tue Oct 31 12:42:50 2006 +0000
+++ b/xen/arch/x86/hvm/vmx/x86_32/exits.S       Tue Oct 31 13:26:49 2006 +0000
@@ -105,7 +105,8 @@ ENTRY(vmx_asm_do_vmentry)
         jnz  vmx_process_softirqs
 
         call vmx_intr_assist
-        call vmx_load_cr2
+        movl VCPU_vmx_cr2(%ebx),%eax
+        movl %eax,%cr2
         call vmx_trace_vmentry
 
         cmpl $0,VCPU_vmx_launched(%ebx)
diff -r 1bf4f15c5141 -r 1c506820c468 xen/arch/x86/hvm/vmx/x86_64/exits.S
--- a/xen/arch/x86/hvm/vmx/x86_64/exits.S       Tue Oct 31 12:42:50 2006 +0000
+++ b/xen/arch/x86/hvm/vmx/x86_64/exits.S       Tue Oct 31 13:26:49 2006 +0000
@@ -115,7 +115,8 @@ ENTRY(vmx_asm_do_vmentry)
         jnz   vmx_process_softirqs
 
         call vmx_intr_assist
-        call vmx_load_cr2
+        movq VCPU_vmx_cr2(%rbx),%rax
+        movq %rax,%cr2
         call vmx_trace_vmentry
 
         cmpl $0,VCPU_vmx_launched(%rbx)
diff -r 1bf4f15c5141 -r 1c506820c468 xen/arch/x86/x86_32/asm-offsets.c
--- a/xen/arch/x86/x86_32/asm-offsets.c Tue Oct 31 12:42:50 2006 +0000
+++ b/xen/arch/x86/x86_32/asm-offsets.c Tue Oct 31 13:26:49 2006 +0000
@@ -86,6 +86,7 @@ void __dummy__(void)
     BLANK();
 
     OFFSET(VCPU_vmx_launched, struct vcpu, arch.hvm_vmx.launched);
+    OFFSET(VCPU_vmx_cr2, struct vcpu, arch.hvm_vmx.cpu_cr2);
     BLANK();
 
     OFFSET(VMCB_rax, struct vmcb_struct, rax);
diff -r 1bf4f15c5141 -r 1c506820c468 xen/arch/x86/x86_64/asm-offsets.c
--- a/xen/arch/x86/x86_64/asm-offsets.c Tue Oct 31 12:42:50 2006 +0000
+++ b/xen/arch/x86/x86_64/asm-offsets.c Tue Oct 31 13:26:49 2006 +0000
@@ -80,6 +80,7 @@ void __dummy__(void)
     BLANK();
 
     OFFSET(VCPU_vmx_launched, struct vcpu, arch.hvm_vmx.launched);
+    OFFSET(VCPU_vmx_cr2, struct vcpu, arch.hvm_vmx.cpu_cr2);
     BLANK();
 
     OFFSET(VMCB_rax, struct vmcb_struct, rax);

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.