]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: PPC: Book3S HV: Fix kvm_unmap_gfn_range_hv() for Hash MMU
authorMichael Ellerman <mpe@ellerman.id.au>
Tue, 11 May 2021 10:54:59 +0000 (20:54 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 12 May 2021 01:07:39 +0000 (11:07 +1000)
commitf8ee1d446810d1a498c16d4d432836b0dc2ad24a
treeebc3434e09db1898d3ad77e85b071ccb5a1b572b
parent1cc179d853ea6314b5daca4902e9a8af54471b89
KVM: PPC: Book3S HV: Fix kvm_unmap_gfn_range_hv() for Hash MMU

Commit 438d361a1fd4 ("KVM: PPC: Book3S HV: Fix conversion to gfn-based
MMU notifier callbacks") fixed kvm_unmap_gfn_range_hv() by adding a for
loop over each gfn in the range.

But for the Hash MMU it repeatedly calls kvm_unmap_rmapp() with the
first gfn of the range, rather than iterating through the range.

This exhibits as strange guest behaviour, sometimes crashing in firmare,
or booting and then guest userspace crashing unexpectedly.

Fix it by passing the iterator, gfn, to kvm_unmap_rmapp().

Fixes: 438d361a1fd4 ("KVM: PPC: Book3S HV: Fix conversion to gfn-based MMU notifier callbacks")
Reviewed-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210511105459.800788-1-mpe@ellerman.id.au
arch/powerpc/kvm/book3s_64_mmu_hv.c