diff options
author | Shaohua Li <shaohua.li@intel.com> | 2007-07-23 02:51:32 -0400 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2007-10-13 04:18:19 -0400 |
commit | 9ae0448f53324b3c476f68bd134d97ac4ec27e0c (patch) | |
tree | 90b5c3c166bd9ce9c9b415c6a6246c2fdb53693c /drivers | |
parent | 310bc76c2b6829cd280def4927b7ccf8b8c795df (diff) |
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/kvm/vmx.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c index 2c4f01bea1fb..79674a7a92bb 100644 --- a/drivers/kvm/vmx.c +++ b/drivers/kvm/vmx.c | |||
@@ -1999,16 +1999,16 @@ preempted: | |||
1999 | kvm_guest_debug_pre(vcpu); | 1999 | kvm_guest_debug_pre(vcpu); |
2000 | 2000 | ||
2001 | again: | 2001 | again: |
2002 | r = kvm_mmu_reload(vcpu); | ||
2003 | if (unlikely(r)) | ||
2004 | goto out; | ||
2005 | |||
2002 | if (!vcpu->mmio_read_completed) | 2006 | if (!vcpu->mmio_read_completed) |
2003 | do_interrupt_requests(vcpu, kvm_run); | 2007 | do_interrupt_requests(vcpu, kvm_run); |
2004 | 2008 | ||
2005 | vmx_save_host_state(vcpu); | 2009 | vmx_save_host_state(vcpu); |
2006 | kvm_load_guest_fpu(vcpu); | 2010 | kvm_load_guest_fpu(vcpu); |
2007 | 2011 | ||
2008 | r = kvm_mmu_reload(vcpu); | ||
2009 | if (unlikely(r)) | ||
2010 | goto out; | ||
2011 | |||
2012 | /* | 2012 | /* |
2013 | * Loading guest fpu may have cleared host cr0.ts | 2013 | * Loading guest fpu may have cleared host cr0.ts |
2014 | */ | 2014 | */ |