linux/arch/powerpc
Michael Ellerman 358e526a16 powerpc/mm: Reinstate ARCH_FORCE_MAX_ORDER ranges
Commit 1e8fed873e ("powerpc: drop ranges for definition of
ARCH_FORCE_MAX_ORDER") removed the limits on the possible values for
ARCH_FORCE_MAX_ORDER.

However removing the ranges entirely causes some common work flows to
break. For example building a defconfig (which uses 64K pages), changing
the page size to 4K, and rebuilding used to work, because
ARCH_FORCE_MAX_ORDER would be clamped to 12 by the ranges.

With the ranges removed it creates a kernel that builds but crashes at
boot:
  kernel BUG at mm/huge_memory.c:470!
  Oops: Exception in kernel mode, sig: 5 [#1]
  ...
  NIP hugepage_init+0x9c/0x278
  LR  do_one_initcall+0x80/0x320
  Call Trace:
    do_one_initcall+0x80/0x320
    kernel_init_freeable+0x304/0x3ac
    kernel_init+0x30/0x1a0
    ret_from_kernel_user_thread+0x14/0x1c

The reasoning for removing the ranges was that some of the values were
too large. So take that into account and limit the maximums to 10 which
is the default max, except for the 4K case which uses 12.

Fixes: 1e8fed873e ("powerpc: drop ranges for definition of ARCH_FORCE_MAX_ORDER")
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230519113806.370635-1-mpe@ellerman.id.au
2023-05-21 11:40:34 +10:00
..
boot powerpc/boot: Disable power10 features after BOOTAFLAGS assignment 2023-05-12 16:20:18 +10:00
configs powerpc updates for 6.4 2023-04-28 16:24:32 -07:00
crypto powerpc/crypto: Fix aes-gcm-p10 build when VSX=n 2023-05-15 22:48:53 +10:00
include powerpc/iommu: Remove iommu_del_device() 2023-05-17 00:51:06 +10:00
kernel powerpc/iommu: Incorrect DDW Table is referenced for SR-IOV device 2023-05-17 00:54:55 +10:00
kexec powerpc/kexec_file: print error string on usable memory property update failure 2023-02-15 23:14:06 +11:00
kvm s390: 2023-05-01 12:06:20 -07:00
lib powerpc/64: vmlinux support building with PCREL addresing 2023-04-20 12:59:21 +10:00
math-emu powerpc/math-emu: Inhibit W=1 warnings 2022-09-08 11:11:18 +10:00
mm powerpc/64s/radix: Fix soft dirty tracking 2023-05-11 22:17:38 +10:00
net powerpc/bpf: populate extable entries only during the last pass 2023-05-15 15:40:31 +10:00
perf powerpc/perf: Properly detect mpc7450 family 2023-03-30 23:35:43 +11:00
platforms powerpc/iommu: Incorrect DDW Table is referenced for SR-IOV device 2023-05-17 00:54:55 +10:00
purgatory powerpc/kcsan: Add exclusions from instrumentation 2023-02-10 22:19:56 +11:00
sysdev powerpc updates for 6.4 2023-04-28 16:24:32 -07:00
tools powerpc: Move script to check relocations at compile time in scripts/ 2023-04-19 07:46:31 -07:00
xmon powerpc/64: vmlinux support building with PCREL addresing 2023-04-20 12:59:21 +10:00
Kbuild
Kconfig powerpc/mm: Reinstate ARCH_FORCE_MAX_ORDER ranges 2023-05-21 11:40:34 +10:00
Kconfig.debug powerpc: Add support for early debugging via Serial 16550 console 2022-09-28 19:22:09 +10:00
Makefile powerpc/configs: Make pseries_defconfig an alias for ppc64le_guest 2023-04-21 16:16:25 +10:00
Makefile.postlink kbuild: remove --include-dir MAKEFLAG from top Makefile 2023-02-05 18:51:22 +09:00