summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/paging_tmpl.h
diff options
context:
space:
mode:
authorJoerg Roedel <joerg.roedel@amd.com>2009-02-19 12:18:56 +0100
committerAvi Kivity <avi@redhat.com>2009-03-24 11:03:11 +0200
commitc5bc22424021cabda862727fb3f5098b866f074d (patch)
tree587212e2615c9e33dcbe6372ea8243ffd0bbb06b /arch/x86/kvm/paging_tmpl.h
parent1fbdc7a58512a6283e10fd27108197679db95ffa (diff)
downloadblackbird-op-linux-c5bc22424021cabda862727fb3f5098b866f074d.tar.gz
blackbird-op-linux-c5bc22424021cabda862727fb3f5098b866f074d.zip
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/kvm/paging_tmpl.h')
-rw-r--r--arch/x86/kvm/paging_tmpl.h2
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,
continue;
if (is_large_pte(*sptep)) {
+ rmap_remove(vcpu->kvm, sptep);
set_shadow_pte(sptep, shadow_trap_nonpresent_pte);
kvm_flush_remote_tlbs(vcpu->kvm);
- rmap_remove(vcpu->kvm, sptep);
}
if (level == PT_DIRECTORY_LEVEL
OpenPOWER on IntegriCloud