Skip to content

Commit

Permalink
KVM: Hoist kvm_mmu_reload() out of the critical section
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Shaohua Li authored and Avi Kivity committed Oct 13, 2007
1 parent 310bc76 commit 9ae0448
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/kvm/vmx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down

0 comments on commit 9ae0448

Please sign in to comment.