diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2013-10-02 10:56:12 -0400 |
---|---|---|
committer | Gleb Natapov <gleb@redhat.com> | 2013-10-03 08:44:01 -0400 |
commit | 95f93af4add9047f7d1ae4f43d12e66f2ba2d6f0 (patch) | |
tree | 9a4d916a49ade8380831791a49743687280a5d05 | |
parent | d8d173dab2505e72b62882e5a580862e6ec1c06c (diff) |
KVM: mmu: unify destroy_kvm_mmu with kvm_mmu_unload
They do the same thing, and destroy_kvm_mmu can be confused with
kvm_mmu_destroy.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Gleb Natapov <gleb@redhat.com>
-rw-r--r-- | arch/x86/kvm/mmu.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index dff856c8621a..d318d4274b27 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c | |||
@@ -3861,18 +3861,11 @@ static int init_kvm_mmu(struct kvm_vcpu *vcpu) | |||
3861 | return init_kvm_softmmu(vcpu); | 3861 | return init_kvm_softmmu(vcpu); |
3862 | } | 3862 | } |
3863 | 3863 | ||
3864 | static void destroy_kvm_mmu(struct kvm_vcpu *vcpu) | 3864 | int kvm_mmu_reset_context(struct kvm_vcpu *vcpu) |
3865 | { | 3865 | { |
3866 | ASSERT(vcpu); | 3866 | ASSERT(vcpu); |
3867 | if (VALID_PAGE(vcpu->arch.mmu.root_hpa)) { | ||
3868 | mmu_free_roots(vcpu); | ||
3869 | WARN_ON(VALID_PAGE(vcpu->arch.mmu.root_hpa)); | ||
3870 | } | ||
3871 | } | ||
3872 | 3867 | ||
3873 | int kvm_mmu_reset_context(struct kvm_vcpu *vcpu) | 3868 | kvm_mmu_unload(vcpu); |
3874 | { | ||
3875 | destroy_kvm_mmu(vcpu); | ||
3876 | return init_kvm_mmu(vcpu); | 3869 | return init_kvm_mmu(vcpu); |
3877 | } | 3870 | } |
3878 | EXPORT_SYMBOL_GPL(kvm_mmu_reset_context); | 3871 | EXPORT_SYMBOL_GPL(kvm_mmu_reset_context); |
@@ -3898,6 +3891,7 @@ EXPORT_SYMBOL_GPL(kvm_mmu_load); | |||
3898 | void kvm_mmu_unload(struct kvm_vcpu *vcpu) | 3891 | void kvm_mmu_unload(struct kvm_vcpu *vcpu) |
3899 | { | 3892 | { |
3900 | mmu_free_roots(vcpu); | 3893 | mmu_free_roots(vcpu); |
3894 | WARN_ON(VALID_PAGE(vcpu->arch.mmu.root_hpa)); | ||
3901 | } | 3895 | } |
3902 | EXPORT_SYMBOL_GPL(kvm_mmu_unload); | 3896 | EXPORT_SYMBOL_GPL(kvm_mmu_unload); |
3903 | 3897 | ||
@@ -4548,7 +4542,7 @@ void kvm_mmu_destroy(struct kvm_vcpu *vcpu) | |||
4548 | { | 4542 | { |
4549 | ASSERT(vcpu); | 4543 | ASSERT(vcpu); |
4550 | 4544 | ||
4551 | destroy_kvm_mmu(vcpu); | 4545 | kvm_mmu_unload(vcpu); |
4552 | free_mmu_pages(vcpu); | 4546 | free_mmu_pages(vcpu); |
4553 | mmu_free_memory_caches(vcpu); | 4547 | mmu_free_memory_caches(vcpu); |
4554 | } | 4548 | } |