diff options
author | Joerg Roedel <joerg.roedel@amd.com> | 2009-02-19 06:18:56 -0500 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2009-03-24 05:03:11 -0400 |
commit | c5bc22424021cabda862727fb3f5098b866f074d (patch) | |
tree | 587212e2615c9e33dcbe6372ea8243ffd0bbb06b /arch/x86 | |
parent | 1fbdc7a58512a6283e10fd27108197679db95ffa (diff) |
KVM: MMU: Fix another largepage memory leak
In the paging_fetch function rmap_remove is called after setting a large
pte to non-present. This causes rmap_remove to not drop the reference to
the large page. The result is a memory leak of that page.
Cc: stable@kernel.org
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Acked-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kvm/paging_tmpl.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h index 7314c0944c5f..0f11792fafa6 100644 --- a/arch/x86/kvm/paging_tmpl.h +++ b/arch/x86/kvm/paging_tmpl.h | |||
@@ -306,9 +306,9 @@ static u64 *FNAME(fetch)(struct kvm_vcpu *vcpu, gva_t addr, | |||
306 | continue; | 306 | continue; |
307 | 307 | ||
308 | if (is_large_pte(*sptep)) { | 308 | if (is_large_pte(*sptep)) { |
309 | rmap_remove(vcpu->kvm, sptep); | ||
309 | set_shadow_pte(sptep, shadow_trap_nonpresent_pte); | 310 | set_shadow_pte(sptep, shadow_trap_nonpresent_pte); |
310 | kvm_flush_remote_tlbs(vcpu->kvm); | 311 | kvm_flush_remote_tlbs(vcpu->kvm); |
311 | rmap_remove(vcpu->kvm, sptep); | ||
312 | } | 312 | } |
313 | 313 | ||
314 | if (level == PT_DIRECTORY_LEVEL | 314 | if (level == PT_DIRECTORY_LEVEL |