]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
KVM: x86: Remove spurious kvm_mmu_unload() from vcpu destruction path
authorSean Christopherson <sean.j.christopherson@intel.com>
Wed, 18 Dec 2019 21:55:05 +0000 (13:55 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Mar 2020 15:45:23 +0000 (16:45 +0100)
commit15d651c5df4469070866fb3448312809d5d92a75
treec3b0a243431d708e7effa4dec2980182d80cd1b1
parent0eb2135e91839cb3199e44881e56e8b21bff8032
KVM: x86: Remove spurious kvm_mmu_unload() from vcpu destruction path

commit 9d979c7e6ff43ca3200ffcb74f57415fd633a2da upstream.

x86 does not load its MMU until KVM_RUN, which cannot be invoked until
after vCPU creation succeeds.  Given that kvm_arch_vcpu_destroy() is
called if and only if vCPU creation fails, it is impossible for the MMU
to be loaded.

Note, the bogus kvm_mmu_unload() call was added during an unrelated
refactoring of vCPU allocation, i.e. was presumably added as an
opportunstic "fix" for a perceived leak.

Fixes: fb3f0f51d92d1 ("KVM: Dynamically allocate vcpus")
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/kvm/x86.c