KVM: PPC: Book3S HV: Radix page fault handler optimizations
authorPaul Mackerras <paulus@ozlabs.org>
Fri, 23 Feb 2018 10:40:49 +0000 (21:40 +1100)
committerPaul Mackerras <paulus@ozlabs.org>
Sun, 18 Mar 2018 23:08:38 +0000 (10:08 +1100)
commitc4c8a7643e74ebd7f2cfa80807562f16bb58c1d9
tree546604c43e6a6872abd50364ad7cf8a2fcc8447c
parent39c983ea0f96a270d4876c4148e3bb2d9cd3294f
KVM: PPC: Book3S HV: Radix page fault handler optimizations

This improves the handling of transparent huge pages in the radix
hypervisor page fault handler.  Previously, if a small page is faulted
in to a 2MB region of guest physical space, that means that there is
a page table pointer at the PMD level, which could never be replaced
by a leaf (2MB) PMD entry.  This adds the code to clear the PMD,
invlidate the page walk cache and free the page table page in this
situation, so that the leaf PMD entry can be created.

This also adds code to check whether a PMD or PTE being inserted is
the same as is already there (because of a race with another CPU that
faulted on the same page) and if so, we don't replace the existing
entry, meaning that we don't invalidate the PTE or PMD and do a TLB
invalidation.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
arch/powerpc/kvm/book3s_64_mmu_radix.c