]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
KVM: PPC: Book3S HV: Fix dirty map for hugepages
authorAlexey Kardashevskiy <aik@ozlabs.ru>
Mon, 26 May 2014 09:48:38 +0000 (19:48 +1000)
committerAlexander Graf <agraf@suse.de>
Fri, 30 May 2014 12:26:29 +0000 (14:26 +0200)
commit687414bebe30d59c766b682cf86b1c5fa92d7af9
treea3c77dd1e86e4bb94e503c5dc74b5eb96f231234
parent1066f7724c73fca9ddb978c7f5b7411c54032047
KVM: PPC: Book3S HV: Fix dirty map for hugepages

The dirty map that we construct for the KVM_GET_DIRTY_LOG ioctl has
one bit per system page (4K/64K).  Currently, we only set one bit in
the map for each HPT entry with the Change bit set, even if the HPT is
for a large page (e.g., 16MB).  Userspace then considers only the
first system page dirty, though in fact the guest may have modified
anywhere in the large page.

To fix this, we make kvm_test_clear_dirty() return the actual number
of pages that are dirty (and rename it to kvm_test_clear_dirty_npages()
to emphasize that that's what it returns).  In kvmppc_hv_get_dirty_log()
we then set that many bits in the dirty map.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
arch/powerpc/kvm/book3s_64_mmu_hv.c