diff options
author | Joerg Roedel <joerg.roedel@amd.com> | 2010-02-24 12:59:11 -0500 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2010-04-25 06:53:01 -0400 |
commit | 0e5cbe368b366f02cf3fe707aea2c0efac1bf70e (patch) | |
tree | 3c652974ca75df9b8b06504760362e9335f634a2 /arch/x86/kvm/svm.c | |
parent | e02317153e77150fed9609c3212c98204ec3ea74 (diff) |
KVM: SVM: Reset MMU on nested_svm_vmrun for NPT too
Without resetting the MMU the gva_to_pga function will not
work reliably when the vcpu is running in nested context.
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/svm.c')
-rw-r--r-- | arch/x86/kvm/svm.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 44679530ad5d..ef40b90219f6 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c | |||
@@ -1877,10 +1877,12 @@ static bool nested_svm_vmrun(struct vcpu_svm *svm) | |||
1877 | if (npt_enabled) { | 1877 | if (npt_enabled) { |
1878 | svm->vmcb->save.cr3 = nested_vmcb->save.cr3; | 1878 | svm->vmcb->save.cr3 = nested_vmcb->save.cr3; |
1879 | svm->vcpu.arch.cr3 = nested_vmcb->save.cr3; | 1879 | svm->vcpu.arch.cr3 = nested_vmcb->save.cr3; |
1880 | } else { | 1880 | } else |
1881 | kvm_set_cr3(&svm->vcpu, nested_vmcb->save.cr3); | 1881 | kvm_set_cr3(&svm->vcpu, nested_vmcb->save.cr3); |
1882 | kvm_mmu_reset_context(&svm->vcpu); | 1882 | |
1883 | } | 1883 | /* Guest paging mode is active - reset mmu */ |
1884 | kvm_mmu_reset_context(&svm->vcpu); | ||
1885 | |||
1884 | svm->vmcb->save.cr2 = svm->vcpu.arch.cr2 = nested_vmcb->save.cr2; | 1886 | svm->vmcb->save.cr2 = svm->vcpu.arch.cr2 = nested_vmcb->save.cr2; |
1885 | kvm_register_write(&svm->vcpu, VCPU_REGS_RAX, nested_vmcb->save.rax); | 1887 | kvm_register_write(&svm->vcpu, VCPU_REGS_RAX, nested_vmcb->save.rax); |
1886 | kvm_register_write(&svm->vcpu, VCPU_REGS_RSP, nested_vmcb->save.rsp); | 1888 | kvm_register_write(&svm->vcpu, VCPU_REGS_RSP, nested_vmcb->save.rsp); |