]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: PPC: Book3S HV: Always flush TLB in kvmppc_alloc_reset_hpt()
authorDavid Gibson <david@gibson.dropbear.id.au>
Wed, 10 Jan 2018 06:04:39 +0000 (17:04 +1100)
committerPaul Mackerras <paulus@ozlabs.org>
Wed, 10 Jan 2018 09:45:41 +0000 (20:45 +1100)
commit71d49717f326055d1ebdc4bfeb8487e3622ec47b
tree75b93d232625b262880c7b19a93770d0823864fc
parentd54fea31530e5d9c66a1c92d1c4b4c8848d83cca
KVM: PPC: Book3S HV: Always flush TLB in kvmppc_alloc_reset_hpt()

The KVM_PPC_ALLOCATE_HTAB ioctl(), implemented by kvmppc_alloc_reset_hpt()
is supposed to completely clear and reset a guest's Hashed Page Table (HPT)
allocating or re-allocating it if necessary.

In the case where an HPT of the right size already exists and it just
zeroes it, it forces a TLB flush on all guest CPUs, to remove any stale TLB
entries loaded from the old HPT.

However, that situation can arise when the HPT is resizing as well - or
even when switching from an RPT to HPT - so those cases need a TLB flush as
well.

So, move the TLB flush to trigger in all cases except for errors.

Cc: stable@vger.kernel.org # v4.10+
Fixes: 2727feb06739 ("KVM: PPC: Book3S HV: Allow KVM_PPC_ALLOCATE_HTAB ioctl() to change HPT size")
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
arch/powerpc/kvm/book3s_64_mmu_hv.c