]> git.proxmox.com Git - mirror_ubuntu-bionic-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>
Tue, 16 Oct 2018 16:11:09 +0000 (12:11 -0400)
committerKhalid Elmously <khalid.elmously@canonical.com>
Tue, 23 Oct 2018 06:45:58 +0000 (08:45 +0200)
commit14f972efb76da176dc262277f50cda9c28026165
tree0fc0e8a431ec3727851f2d25fcc0de3607bd85f9
parent49c6e7a9abdfa4a9795d3c3c6f8a21bd76c0c026
powerpc/mm/radix: Only need the Nest MMU workaround for R -> RW transition

BugLink: https://bugs.launchpad.net/bugs/1792195
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>
(backported from commit f08d08f3db55452d31ba4a37c702da6245876b96
[jsalisbury: Patch was not expcting cpu_has_feature() check, so
merged it in.])
Signed-off-by: Joseph Salisbury <joseph.salisbury@canonical.com>
Acked-by: Khalid Elmously <khalid.elmously@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
arch/powerpc/mm/pgtable-radix.c