linux/arch/powerpc/mm/book3s32
Christophe Leroy 370d841929 powerpc/32: Automatically adapt TASK_SIZE based on constraints
At the time being, TASK_SIZE can be customized by the user via Kconfig
but it is not possible to check all constraints in Kconfig. Impossible
setups are detected at compile time with BUILD_BUG() but that leads
to build failure when setting crazy values. It is not a problem on its
own because the user will usually either use the default value or set
a well thought value. However build robots generate crazy random
configs that lead to build failures, and build robots see it as a
regression every time a patch adds such a constraint.

So instead of failing the build when the custom TASK_SIZE is too
big, just adjust it to the maximum possible value matching the setup.

Several architectures already calculate TASK_SIZE based on other
parameters and options.

In order to do so, move MODULES_VADDR calculation into task_size_32.h
and ensure that:
- On book3s/32, userspace and module area have their own segments (256M)
- On 8xx, userspace has its own full PGDIR entries (4M)

Then TASK_SIZE is guaranteed to be correct so remove related
BUILD_BUG()s.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Link: https://patch.msgid.link/6a2575420770d075cd090b5a316730a2ffafdee4.1766574657.git.chleroy@kernel.org
2026-01-07 09:31:05 +05:30
..
hash_low.S powerpc/32s: Introduce _PAGE_READ and remove _PAGE_USER 2023-10-19 17:12:47 +11:00
kuap.c powerpc/kuap: Simplify KUAP lock/unlock on BOOK3S/32 2023-08-02 22:22:18 +10:00
Makefile powerpc/kuep: Remove 'nosmep' boot time parameter except for book3s/64 2021-12-09 22:41:18 +11:00
mmu_context.c powerpc/kuap: Fold kuep_is_disabled() into its only user 2023-08-02 22:22:17 +10:00
mmu.c powerpc/32: Automatically adapt TASK_SIZE based on constraints 2026-01-07 09:31:05 +05:30
nohash_low.S powerpc/32s: Move _tlbie() and _tlbia() in a new file 2020-12-09 16:46:55 +11:00
tlb.c powerpc, mm: Fix mprotect on book3s 32-bit 2025-11-18 12:34:17 +05:30