KVM: Hoist kvm_mmu_reload() out of the critical section

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>
This commit is contained in:
Shaohua Li 2007-07-23 14:51:32 +08:00 committed by Avi Kivity
parent 310bc76c2b
commit 9ae0448f53

View 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
*/