Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mm: define default MAX_PTRS_PER_* in include/pgtable.h
Commit c65e774 ("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/[email protected] Signed-off-by: Daniel Axtens <[email protected]> Acked-by: Andrey Konovalov <[email protected]> Reviewed-by: Christophe Leroy <[email protected]> Reviewed-by: Marco Elver <[email protected]> Cc: Aneesh Kumar K.V <[email protected]> Cc: Balbir Singh <[email protected]> Cc: Alexander Potapenko <[email protected]> Cc: Andrey Ryabinin <[email protected]> Cc: Dmitry Vyukov <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
- Loading branch information