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

[Xen-devel] clear redunadant IRQ disable



Clear the redundant code in vmx_load_cr2 and use got "%EBX" for current
vcpu pointer.


Signed-off-by: Eddie Dong <eddie.dong@xxxxxxxxx>


diff -r b21246720fde xen/arch/x86/hvm/vmx/io.c
--- a/xen/arch/x86/hvm/vmx/io.c Mon Oct 30 17:35:11 2006 +0000
+++ b/xen/arch/x86/hvm/vmx/io.c Tue Oct 31 13:27:15 2006 +0800
@@ -90,12 +90,11 @@ static void update_tpr_threshold(struct 
 #define update_tpr_threshold(v) ((void)0)
 #endif
 
-asmlinkage void vmx_intr_assist(void)
+asmlinkage void vmx_intr_assist(struct vcpu *v)
 {
     int intr_type = 0;
     int highest_vector;
     unsigned long eflags;
-    struct vcpu *v = current;
     struct vlapic *vlapic = VLAPIC(v);
     struct hvm_domain *plat=&v->domain->arch.hvm_domain;
     struct periodic_time *pt = &plat->pl_time.periodic_tm;
diff -r b21246720fde xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c        Mon Oct 30 17:35:11 2006 +0000
+++ b/xen/arch/x86/hvm/vmx/vmx.c        Tue Oct 31 14:01:30 2006 +0800
@@ -2419,11 +2419,8 @@ asmlinkage void vmx_vmexit_handler(struc
     }
 }
 
-asmlinkage void vmx_load_cr2(void)
-{
-    struct vcpu *v = current;
-
-    local_irq_disable();
+asmlinkage void vmx_load_cr2(struct vcpu *v)
+{
     asm volatile("mov %0,%%cr2": :"r" (v->arch.hvm_vmx.cpu_cr2));
 }
 
diff -r b21246720fde xen/arch/x86/hvm/vmx/x86_32/exits.S
--- a/xen/arch/x86/hvm/vmx/x86_32/exits.S       Mon Oct 30 17:35:11 2006
+0000
+++ b/xen/arch/x86/hvm/vmx/x86_32/exits.S       Tue Oct 31 15:55:32 2006
+0800
@@ -104,8 +104,11 @@ ENTRY(vmx_asm_do_vmentry)
         cmpl $0,irq_stat(%eax,1)
         jnz  vmx_process_softirqs
 
+        push %ebx
         call vmx_intr_assist
+        push %ebx
         call vmx_load_cr2
+        addl $8,%esp
         call vmx_trace_vmentry
 
         cmpl $0,VCPU_vmx_launched(%ebx)
diff -r b21246720fde xen/arch/x86/hvm/vmx/x86_64/exits.S
--- a/xen/arch/x86/hvm/vmx/x86_64/exits.S       Mon Oct 30 17:35:11 2006
+0000
+++ b/xen/arch/x86/hvm/vmx/x86_64/exits.S       Tue Oct 31 15:04:45 2006
+0800
@@ -114,7 +114,9 @@ ENTRY(vmx_asm_do_vmentry)
         cmpl  $0,(%rdx,%rax,1)
         jnz   vmx_process_softirqs
 
+        movq %rbx,%rdi
         call vmx_intr_assist
+        movq %rbx,%rdi
         call vmx_load_cr2
         call vmx_trace_vmentry
 
diff -r b21246720fde xen/include/asm-x86/hvm/vmx/vmx.h
--- a/xen/include/asm-x86/hvm/vmx/vmx.h Mon Oct 30 17:35:11 2006 +0000
+++ b/xen/include/asm-x86/hvm/vmx/vmx.h Tue Oct 31 14:01:27 2006 +0800
@@ -28,7 +28,8 @@
 
 extern void vmx_asm_vmexit_handler(struct cpu_user_regs);
 extern void vmx_asm_do_vmentry(void);
-extern void vmx_intr_assist(void);
+extern void vmx_intr_assist(struct vcpu *v);
+extern void vmx_load_cr2(struct vcpu *v);
 extern void vmx_migrate_timers(struct vcpu *v);
 extern void arch_vmx_do_launch(struct vcpu *);
 extern void arch_vmx_do_resume(struct vcpu *);

Attachment: redunant.patch
Description: redunant.patch

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

 


Rackspace

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