]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: X86: Fix x86_emulator slab cache leak
authorWanpeng Li <wanpengli@tencent.com>
Fri, 11 Jun 2021 04:59:33 +0000 (21:59 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 11 Jun 2021 15:53:48 +0000 (11:53 -0400)
commit32e105d73510b69a76a82a98bb383348a6c2d590
tree61023aeb6622cfe75b6ed43f6b5099b18de55747
parenteef60aaead45f0e9c8f91e3f40e85e4733cce25b
KVM: X86: Fix x86_emulator slab cache leak

Commit 9db4273554f86 (KVM: x86: Dynamically allocate per-vCPU emulation context)
tries to allocate per-vCPU emulation context dynamically, however, the
x86_emulator slab cache is still exiting after the kvm module is unload
as below after destroying the VM and unloading the kvm module.

grep x86_emulator /proc/slabinfo
x86_emulator          36     36   2672   12    8 : tunables    0    0    0 : slabdata      3      3      0

This patch fixes this slab cache leak by destroying the x86_emulator slab cache
when the kvm module is unloaded.

Fixes: 9db4273554f86 (KVM: x86: Dynamically allocate per-vCPU emulation context)
Cc: stable@vger.kernel.org
Signed-off-by: Wanpeng Li <wanpengli@tencent.com>
Message-Id: <1623387573-5969-1-git-send-email-wanpengli@tencent.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/x86.c