提交 9ae0448f 编写于 作者: S Shaohua Li 提交者: 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: NShaohua Li <shaohua.li@intel.com>
Signed-off-by: NAvi Kivity <avi@qumranet.com>
上级 310bc76c
......@@ -1999,16 +1999,16 @@ static int vmx_vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
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
*/
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册