]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
powerpc/32: Automatically adapt TASK_SIZE based on constraints
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Wed, 24 Dec 2025 11:20:54 +0000 (12:20 +0100)
committerMadhavan Srinivasan <maddy@linux.ibm.com>
Wed, 7 Jan 2026 04:01:05 +0000 (09:31 +0530)
commit370d841929c3b863b7409047e8c84eabc4d0960f
tree405766617d4691f8f4d259168dec658c8f0d5ae8
parentfb7903771c107b0358584a359b8545060e23c530
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
arch/powerpc/Kconfig
arch/powerpc/include/asm/book3s/32/pgtable.h
arch/powerpc/include/asm/nohash/32/mmu-8xx.h
arch/powerpc/include/asm/task_size_32.h
arch/powerpc/mm/book3s32/mmu.c
arch/powerpc/mm/mem.c
arch/powerpc/mm/nohash/8xx.c