]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
KVM: PPC: Book3S HV: Use correct pagesize in kvm_unmap_radix()
authorPaul Mackerras <paulus@ozlabs.org>
Tue, 14 Aug 2018 10:37:45 +0000 (20:37 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Sep 2018 20:41:21 +0000 (22:41 +0200)
commit33cd6d44e8c6a566e9817c8e87e882d6852f3864
tree5f0c1876f9cf7998772d9f7baee47783177af80a
parent9e7e9f25ef3e91790d6ecc900d3548cebfd0f221
KVM: PPC: Book3S HV: Use correct pagesize in kvm_unmap_radix()

commit c066fafc595eef5ae3c83ae3a8305956b8c3ef15 upstream.

Since commit e641a317830b ("KVM: PPC: Book3S HV: Unify dirty page map
between HPT and radix", 2017-10-26), kvm_unmap_radix() computes the
number of PAGE_SIZEd pages being unmapped and passes it to
kvmppc_update_dirty_map(), which expects to be passed the page size
instead.  Consequently it will only mark one system page dirty even
when a large page (for example a THP page) is being unmapped.  The
consequence of this is that part of the THP page might not get copied
during live migration, resulting in memory corruption for the guest.

This fixes it by computing and passing the page size in kvm_unmap_radix().

Cc: stable@vger.kernel.org # v4.15+
Fixes: e641a317830b (KVM: PPC: Book3S HV: Unify dirty page map between HPT and radix)
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/powerpc/kvm/book3s_64_mmu_radix.c