]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/mm/radix: Only need the Nest MMU workaround for R -> RW transition
authorAneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Wed, 22 Aug 2018 17:16:05 +0000 (22:46 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 23 Aug 2018 11:56:48 +0000 (21:56 +1000)
commit6d1de8df7d39bbc92ad3ca58a4cf971bb5a5bf20
tree288a41b58b8e75c13572658eb8898aa220ebcd7e
parent5b2fd3576f16f53d739baa4d0085cea7fa5339a6
powerpc/mm/radix: Only need the Nest MMU workaround for R -> RW transition

The Nest MMU workaround is only needed for RW upgrades. Avoid doing
that for other PTE updates.

We also avoid clearing the PTE while marking it invalid. This is
because other page table walkers will find this PTE none and can
result in unexpected behaviour due to that. Instead we clear
_PAGE_PRESENT and set the software PTE bit _PAGE_INVALID.
pte_present() is already updated to check for both bits. This makes
sure page table walkers will find the PTE present and things like
pte_pfn(pte) returns the right value.

Based on an original patch from Benjamin Herrenschmidt <benh@kernel.crashing.org>

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/mm/pgtable-radix.c