diff options
-rw-r--r-- | arch/x86/kvm/mmu.c | 5 | ||||
-rw-r--r-- | arch/x86/kvm/x86.c | 4 |
2 files changed, 3 insertions, 6 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index a455c5eee370..c075542648cd 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c | |||
@@ -2478,10 +2478,9 @@ static int init_kvm_mmu(struct kvm_vcpu *vcpu) | |||
2478 | static void destroy_kvm_mmu(struct kvm_vcpu *vcpu) | 2478 | static void destroy_kvm_mmu(struct kvm_vcpu *vcpu) |
2479 | { | 2479 | { |
2480 | ASSERT(vcpu); | 2480 | ASSERT(vcpu); |
2481 | if (VALID_PAGE(vcpu->arch.mmu.root_hpa)) { | 2481 | if (VALID_PAGE(vcpu->arch.mmu.root_hpa)) |
2482 | /* mmu.free() should set root_hpa = INVALID_PAGE */ | ||
2482 | vcpu->arch.mmu.free(vcpu); | 2483 | vcpu->arch.mmu.free(vcpu); |
2483 | vcpu->arch.mmu.root_hpa = INVALID_PAGE; | ||
2484 | } | ||
2485 | } | 2484 | } |
2486 | 2485 | ||
2487 | int kvm_mmu_reset_context(struct kvm_vcpu *vcpu) | 2486 | int kvm_mmu_reset_context(struct kvm_vcpu *vcpu) |
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index ae9d6f3e5d0d..03039fd86980 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -486,7 +486,7 @@ int __kvm_set_cr4(struct kvm_vcpu *vcpu, unsigned long cr4) | |||
486 | return 1; | 486 | return 1; |
487 | 487 | ||
488 | kvm_x86_ops->set_cr4(vcpu, cr4); | 488 | kvm_x86_ops->set_cr4(vcpu, cr4); |
489 | vcpu->arch.cr4 = cr4; | 489 | |
490 | kvm_mmu_reset_context(vcpu); | 490 | kvm_mmu_reset_context(vcpu); |
491 | 491 | ||
492 | return 0; | 492 | return 0; |
@@ -721,8 +721,6 @@ static int set_efer(struct kvm_vcpu *vcpu, u64 efer) | |||
721 | 721 | ||
722 | kvm_x86_ops->set_efer(vcpu, efer); | 722 | kvm_x86_ops->set_efer(vcpu, efer); |
723 | 723 | ||
724 | vcpu->arch.efer = efer; | ||
725 | |||
726 | vcpu->arch.mmu.base_role.nxe = (efer & EFER_NX) && !tdp_enabled; | 724 | vcpu->arch.mmu.base_role.nxe = (efer & EFER_NX) && !tdp_enabled; |
727 | kvm_mmu_reset_context(vcpu); | 725 | kvm_mmu_reset_context(vcpu); |
728 | 726 | ||