]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
KVM: mmu_notifiers release method
authorMarcelo Tosatti <mtosatti@redhat.com>
Mon, 23 Mar 2009 20:51:34 +0000 (17:51 -0300)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sat, 2 May 2009 17:57:11 +0000 (10:57 -0700)
commit2aa2267cc3836db2680d99e1c5da08af6a7243bd
tree22b8cdd55838608eec4bf43f5c90ec4c9ab5d8e6
parent2ef5df79ae93e27162a3ff9f9326cc53ef42a970
KVM: mmu_notifiers release method

(cherry picked from 85db06e514422ae429b5f85742d8111b70bd56f3)

The destructor for huge pages uses the backing inode for adjusting
hugetlbfs accounting.

Hugepage mappings are destroyed by exit_mmap, after
mmu_notifier_release, so there are no notifications through
unmap_hugepage_range at this point.

The hugetlbfs inode can be freed with pages backed by it referenced
by the shadow. When the shadow releases its reference, the huge page
destructor will access a now freed inode.

Implement the release operation for kvm mmu notifiers to release page
refs before the hugetlbfs inode is gone.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
virt/kvm/kvm_main.c