]> err.no Git - linux-2.6/commitdiff
KVM: Hoist kvm_mmu_reload() out of the critical section
authorShaohua Li <shaohua.li@intel.com>
Mon, 23 Jul 2007 06:51:32 +0000 (14:51 +0800)
committerAvi Kivity <avi@qumranet.com>
Sat, 13 Oct 2007 08:18:19 +0000 (10:18 +0200)
vmx_cpu_run doesn't handle error correctly and kvm_mmu_reload might
sleep with mutex changes, so I move it above.

Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
drivers/kvm/vmx.c

index 2c4f01bea1fb8a7e563f2baf0877e6e893246aa0..79674a7a92bb551146baa30225e53b45daadad35 100644 (file)
@@ -1999,16 +1999,16 @@ preempted:
                kvm_guest_debug_pre(vcpu);
 
 again:
+       r = kvm_mmu_reload(vcpu);
+       if (unlikely(r))
+               goto out;
+
        if (!vcpu->mmio_read_completed)
                do_interrupt_requests(vcpu, kvm_run);
 
        vmx_save_host_state(vcpu);
        kvm_load_guest_fpu(vcpu);
 
-       r = kvm_mmu_reload(vcpu);
-       if (unlikely(r))
-               goto out;
-
        /*
         * Loading guest fpu may have cleared host cr0.ts
         */