linux/arch
Daniel Axtens c0f8aa4fa8 mm: define default MAX_PTRS_PER_* in include/pgtable.h
Commit c65e774fb3 ("x86/mm: Make PGDIR_SHIFT and PTRS_PER_P4D variable")
made PTRS_PER_P4D variable on x86 and introduced MAX_PTRS_PER_P4D as a
constant for cases which need a compile-time constant (e.g.  fixed-size
arrays).

powerpc likewise has boot-time selectable MMU features which can cause
other mm "constants" to vary.  For KASAN, we have some static
PTE/PMD/PUD/P4D arrays so we need compile-time maximums for all these
constants.  Extend the MAX_PTRS_PER_ idiom, and place default definitions
in include/pgtable.h.  These define MAX_PTRS_PER_x to be PTRS_PER_x unless
an architecture has defined MAX_PTRS_PER_x in its arch headers.

Clean up pgtable-nop4d.h and s390's MAX_PTRS_PER_P4D definitions while
we're at it: both can just pick up the default now.

Link: https://lkml.kernel.org/r/20210624034050.511391-4-dja@axtens.net
Signed-off-by: Daniel Axtens <dja@axtens.net>
Acked-by: Andrey Konovalov <andreyknvl@gmail.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Reviewed-by: Marco Elver <elver@google.com>
Cc: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Cc: Balbir Singh <bsingharora@gmail.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2021-06-29 10:53:53 -07:00
..
alpha quota: Disable quotactl_path syscall 2021-05-17 14:39:56 +02:00
arc arch/arc/kernel/troubleshoot: use vma_lookup() instead of find_vma() 2021-06-29 10:53:51 -07:00
arm mm: update legacy flush_tlb_* to use vma 2021-06-29 10:53:52 -07:00
arm64 arch/arm64/kvm: use vma_lookup() instead of find_vma_intersection() 2021-06-29 10:53:51 -07:00
csky arch/csky patches for 5.13-rc1 2021-05-03 12:58:31 -07:00
h8300 h8300: remove unused variable 2021-06-29 10:53:52 -07:00
hexagon Merge branch 'akpm' (patches from Andrew) 2021-05-07 00:34:51 -07:00
ia64 mm: update legacy flush_tlb_* to use vma 2021-06-29 10:53:52 -07:00
m68k mm: update legacy flush_tlb_* to use vma 2021-06-29 10:53:52 -07:00
microblaze quota: Disable quotactl_path syscall 2021-05-17 14:39:56 +02:00
mips arch/mips/kernel/traps: use vma_lookup() instead of find_vma() 2021-06-29 10:53:51 -07:00
nds32 tracing updates for 5.13 2021-05-03 11:19:54 -07:00
nios2 Merge branch 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2021-05-02 09:14:01 -07:00
openrisc mm: update legacy flush_tlb_* to use vma 2021-06-29 10:53:52 -07:00
parisc quota: Disable quotactl_path syscall 2021-05-17 14:39:56 +02:00
powerpc arch/powerpc/kvm/book3s: use vma_lookup() in kvmppc_hv_setup_htab_rma() 2021-06-29 10:53:51 -07:00
riscv riscv: dts: fu740: fix cache-controller interrupts 2021-06-19 00:11:53 -07:00
s390 mm: define default MAX_PTRS_PER_* in include/pgtable.h 2021-06-29 10:53:53 -07:00
sh \n 2021-05-20 06:20:15 -10:00
sparc quota: Disable quotactl_path syscall 2021-05-17 14:39:56 +02:00
um Merge branch 'akpm' (patches from Andrew) 2021-05-07 00:34:51 -07:00
x86 x86/sgx: use vma_lookup() in sgx_encl_find() 2021-06-29 10:53:51 -07:00
xtensa mm: update legacy flush_tlb_* to use vma 2021-06-29 10:53:52 -07:00
.gitignore .gitignore: prefix local generated files with a slash 2021-05-02 00:43:35 +09:00
Kconfig Add Landlock, a new LSM from Mickaël Salaün <mic@linux.microsoft.com> 2021-05-01 18:50:44 -07:00