powerpc/40x: Rework 40x PTE access and TLB miss
authorChristophe Leroy <christophe.leroy@c-s.fr>
Thu, 21 May 2020 16:55:53 +0000 (16:55 +0000)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 28 May 2020 13:24:34 +0000 (23:24 +1000)
commit2c74e2586bb96012ffc05f1c819b05d9cad86d6e
treedda132d6907134f34e038183462b8ed8aeffb20b
parentf16dca3e30c14aff545a834a7c1a1bb02b9edb48
powerpc/40x: Rework 40x PTE access and TLB miss

Commit 1bc54c03117b ("powerpc: rework 4xx PTE access and TLB miss")
reworked 44x PTE access to avoid atomic pte updates, and
left 8xx, 40x and fsl booke with atomic pte updates.
Commit 6cfd8990e27d ("powerpc: rework FSL Book-E PTE access and TLB
miss") removed atomic pte updates on fsl booke.
It went away on 8xx with commit ddfc20a3b9ae ("powerpc/8xx: Remove
PTE_ATOMIC_UPDATES").

40x is the last platform setting PTE_ATOMIC_UPDATES.

Rework PTE access and TLB miss to remove PTE_ATOMIC_UPDATES for 40x:
- Always handle DSI as a fault.
- Bail out of TLB miss handler when CONFIG_SWAP is set and
_PAGE_ACCESSED is not set.
- Bail out of ITLB miss handler when _PAGE_EXEC is not set.
- Only set WR bit when both _PAGE_RW and _PAGE_DIRTY are set.
- Remove _PAGE_HWWRITE
- Don't require PTE_ATOMIC_UPDATES anymore

Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/99a0fcd337ef67088140d1647d75fea026a70413.1590079968.git.christophe.leroy@csgroup.eu
arch/powerpc/include/asm/nohash/32/pte-40x.h
arch/powerpc/include/asm/nohash/pgtable.h
arch/powerpc/kernel/head_40x.S
arch/powerpc/mm/nohash/40x.c