diff options
author | Marcelo Tosatti <mtosatti@redhat.com> | 2011-06-06 17:27:47 (GMT) |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2011-06-19 16:23:13 (GMT) |
commit | 5233dd51ece1615d54ab96c4cbe9ac3cc595e955 (patch) | |
tree | 291485af225c96727476f120c5f00abb731aced3 /arch | |
parent | b72336355bb4c92d4a2be3f975dbea47089c83c1 (diff) | |
download | linux-5233dd51ece1615d54ab96c4cbe9ac3cc595e955.tar.xz |
KVM: VMX: do not overwrite uptodate vcpu->arch.cr3 on KVM_SET_SREGS
Only decache guest CR3 value if vcpu->arch.cr3 is stale.
Fixes loadvm with live guest.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Tested-by: Markus Schade <markus.schade@gmail.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kvm/vmx.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 4c3fa0f..d48ec60 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -2047,7 +2047,8 @@ static void ept_update_paging_mode_cr0(unsigned long *hw_cr0, unsigned long cr0, struct kvm_vcpu *vcpu) { - vmx_decache_cr3(vcpu); + if (!test_bit(VCPU_EXREG_CR3, (ulong *)&vcpu->arch.regs_avail)) + vmx_decache_cr3(vcpu); if (!(cr0 & X86_CR0_PG)) { /* From paging/starting to nonpaging */ vmcs_write32(CPU_BASED_VM_EXEC_CONTROL, |