]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
KVM: MMU: handle compound pages in kvm_is_mmio_pfn
authorJoerg Roedel <joerg.roedel@amd.com>
Fri, 17 Apr 2009 22:40:10 +0000 (19:40 -0300)
committerChris Wright <chrisw@sous-sol.org>
Mon, 27 Apr 2009 17:37:04 +0000 (10:37 -0700)
commita6d2078da9aeb83f21277573b240290fa196b5f9
tree0827fea28283d1dc3e8c71647496262ace7fc743
parentfc66cf4790189b5ec4f8b9e8aacc8d37cc8e3daa
KVM: MMU: handle compound pages in kvm_is_mmio_pfn

upstream commit: fc5659c8c6b6c4e02ac354b369017c1bf231f347

The function kvm_is_mmio_pfn is called before put_page is called on a
page by KVM. This is a problem when when this function is called on some
struct page which is part of a compund page. It does not test the
reserved flag of the compound page but of the struct page within the
compount page. This is a problem when KVM works with hugepages allocated
at boot time. These pages have the reserved bit set in all tail pages.
Only the flag in the compount head is cleared. KVM would not put such a
page which results in a memory leak.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Acked-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
virt/kvm/kvm_main.c