linux/arch/powerpc/mm
Christophe Leroy 1b03e71ff6 powerpc/32s: Handle PROTFAULT in hash_page() also for CONFIG_PPC_KUAP
On hash 32 bits, handling minor protection faults like unsetting
dirty flag is heavy if done from the normal page_fault processing,
because it implies hash table software lookup for flushing the entry
and then a DSI is taken anyway to add the entry back.

When KUAP was implemented, as explained in commit a68c31fc01
("powerpc/32s: Implement Kernel Userspace Access Protection"),
protection faults has been diverted from hash_page() because
hash_page() was not able to identify a KUAP fault.

Implement KUAP verification in hash_page(), by clearing write
permission when the access is a kernel access and Ks is 1.
This works regardless of the address because kernel segments always
have Ks set to 0 while user segments have Ks set to 0 only
when kernel write to userspace is granted.

Then protection faults can be handled by hash_page() even for KUAP.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/8a4ffe4798e9ea32aaaccdf85e411bb1beed3500.1605542955.git.christophe.leroy@csgroup.eu
2020-12-09 16:59:46 +11:00
..
book3s32 powerpc/32s: Handle PROTFAULT in hash_page() also for CONFIG_PPC_KUAP 2020-12-09 16:59:46 +11:00
book3s64 lkdtm/powerpc: Add SLB multihit test 2020-12-04 01:01:34 +11:00
kasan powerpc updates for 5.10 2020-10-16 12:21:15 -07:00
nohash powerpc: Retire e200 core (mpc555x processor) 2020-12-05 21:49:18 +11:00
ptdump powerpc: Remove support for PowerPC 601 2020-10-08 21:17:13 +11:00
copro_fault.c mm: clean up the last pieces of page fault accountings 2020-08-12 10:58:04 -07:00
dma-noncoherent.c dma-mapping: merge <linux/dma-noncoherent.h> into <linux/dma-map-ops.h> 2020-10-06 07:07:06 +02:00
drmem.c pseries/drmem: don't cache node id in drmem_lmb struct 2020-09-02 11:00:21 +10:00
fault.c powerpc/book3s64/kuap: Improve error reporting with KUAP 2020-12-08 21:40:54 +11:00
highmem.c arch/kunmap_atomic: consolidate duplicate code 2020-06-04 19:06:22 -07:00
hugetlbpage.c powerpc/8xx: Support 16k hugepages with 4k pages 2020-09-15 22:13:31 +10:00
init_32.c Merge branch 'akpm' (patches from Andrew) 2020-08-07 11:39:33 -07:00
init_64.c Merge branch 'fixes' into next 2020-09-14 22:57:18 +10:00
init-common.c powerpc/book3s64/kup: Check max key supported before enabling kup 2020-12-04 01:01:27 +11:00
ioremap_32.c powerpc/ioremap: warn on early use of ioremap() 2019-11-19 19:38:38 +11:00
ioremap_64.c powerpc: remove __ioremap_at and __iounmap_at 2020-06-02 10:59:10 -07:00
ioremap.c mm/memremap_pages: Introduce memremap_compat_align() 2020-02-20 16:58:55 -08:00
Makefile powerpc/mm: Move ioremap functions out of pgtable_32/64.c 2019-08-27 13:03:35 +10:00
mem.c powerpc/mm: Remove useless #ifndef CPU_FTR_COHERENT_ICACHE in mem.c 2020-12-04 01:01:33 +11:00
mmap.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
mmu_context.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
mmu_decl.h powerpc/32s: Move _tlbie() and _tlbia() prototypes to tlbflush.h 2020-12-09 16:46:55 +11:00
numa.c powerpc updates for 5.10 2020-10-16 12:21:15 -07:00
pgtable_32.c powerpc/32s: Don't hash_preload() kernel text 2020-12-04 01:01:31 +11:00
pgtable_64.c mm: remove unneeded includes of <asm/pgalloc.h> 2020-08-07 11:33:26 -07:00
pgtable-frag.c powerpc/mm/radix: Fix PTE/PMD fragment count for early page table mappings 2020-07-20 22:57:56 +10:00
pgtable.c powerpc updates for 5.10 2020-10-16 12:21:15 -07:00
slice.c powerpc: Replace _ALIGN_UP() by ALIGN() 2020-05-11 23:15:15 +10:00