Commit 9ae0448f authored by Shaohua Li's avatar Shaohua Li Committed by Avi Kivity

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: default avatarShaohua Li <shaohua.li@intel.com>
Signed-off-by: default avatarAvi Kivity <avi@qumranet.com>
parent 310bc76c
...@@ -1999,16 +1999,16 @@ static int vmx_vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) ...@@ -1999,16 +1999,16 @@ static int vmx_vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
kvm_guest_debug_pre(vcpu); kvm_guest_debug_pre(vcpu);
again: again:
r = kvm_mmu_reload(vcpu);
if (unlikely(r))
goto out;
if (!vcpu->mmio_read_completed) if (!vcpu->mmio_read_completed)
do_interrupt_requests(vcpu, kvm_run); do_interrupt_requests(vcpu, kvm_run);
vmx_save_host_state(vcpu); vmx_save_host_state(vcpu);
kvm_load_guest_fpu(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 * Loading guest fpu may have cleared host cr0.ts
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment