Re: [REGRESSION] of: reserved_mem: allocate and map the reserved_mem array early
From: Marek Szyprowski
Date: Fri Dec 04 2026 - 17:42:06 EST
On 03.12.2026 20:28, Padhi, Beleswar wrote:
> After commit aa05faf815836 ("of: reserved_mem: allocate and map
> the reserved_mem array early"), the boot has been broken on TI K2G EVM
> boards on keystone_defconfig.
>
> 1. On next-20261103 the board prints nothing after "Starting kernel ..."
> Same can be verified by fetching data from KernelCI dashboard.
>
> 2. With earlycon enabled (the only change on top of next-20261103), the
> log ends here:
>
> ```
> [ 0.000000] Booting Linux on physical CPU 0x0
> [ 0.000000] Linux version 7.4.0-rc1-next-20261103-00001-g1fac120bc25f (arm-none-linux-gnueabihf-gcc (Arm GNU Toolchain 12.3.Rel1 (Build arm-12.35)) 12.3.1 20230626, GNU ld (Arm GNU Toolchain 12.3.Rel1 (Build arm-12.35)) 2.40.0.20230627) #1 SMP PREEMPT Thu Dec 3 23:21:13 IST 2026
> [ 0.000000] CPU: ARMv7 Processor [412fc0f4] revision 4 (ARMv7), cr=30c5387d
> [ 0.000000] CPU: div instructions available: patching division code
> [ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, PIPT instruction cache
> [ 0.000000] OF: fdt: Machine model: Texas Instruments K2G General Purpose EVM
> [ 0.000000] earlycon: ns16550a0 MMIO32:0x0000000002530c00 (options '115200n8')
> [ 0.000000] printk: legacy bootconsole [ns16550a0] enabled
> [ 0.000000] Memory policy: Data cache writealloc
> [ 0.000000] Switching physical address space to 0x800000000
> <hang>
> ```
>
> 3. Reverting only commit aa05faf81583 on next-20261103 makes the board
> boot fine to userspace again:
>
> ```
> [ 0.000000] Booting Linux on physical CPU 0x0
> [ 0.000000] Linux version 7.4.0-rc1-next-20261103-00001-gddae9990d91d (arm-none-linux-gnueabihf-gcc (Arm GNU Toolchain 12.3.Rel1 (Build arm-12.35)) 12.3.1 20230626, GNU ld (Arm GNU Toolchain 12.3.Rel1 (Build arm-12.35)) 2.40.0.20230627) #1 SMP PREEMPT Thu Dec 3 12:04:37 IST 2026
> [ 0.000000] CPU: ARMv7 Processor [412fc0f4] revision 4 (ARMv7), cr=30c5387d
> [ 0.000000] CPU: div instructions available: patching division code
> [ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, PIPT instruction cache
> [ 0.000000] OF: fdt: Machine model: Texas Instruments K2G General Purpose EVM
> [ 0.000000] Memory policy: Data cache writealloc
> [ 0.000000] Switching physical address space to 0x800000000
> [ 0.000000] cma: Reserved 16 MiB at 0x0000000801800000
> [ 0.000000] Reserved memory: created CMA memory pool at 0x000000081f800000, size 8 MiB
> [ 0.000000] OF: reserved mem: initialized node dsp-common-memory@81f800000, compatible id shared-dma-pool
> [ 0.000000] OF: reserved mem: 0x000000081f800000..0x000000081fffffff (8192 KiB) map reusable dsp-common-memory@81f800000
> [ 0.000000] Zone ranges:
> [ 0.000000] DMA em 0x0000000800000000-0x000000082fffffff]
> [ 0.000000] Normal empty
> [ 0.000000] HighMem em 0x0000000830000000-0x000000087fffffff]
> [ 0.000000] Movable zone start for each node
> [ 0.000000] Early memory node ranges
> [ 0.000000] node 0: em 0x0000000800000000-0x000000087fffffff]
> [ 0.000000] Initmem setup node 0 em 0x0000000800000000-0x000000087fffffff]
> [ 0.000000] percpu: Embedded 16 pages/cpu s34252 r8192 d23092 u65536
>
> <...>
> ```
>
> 4.The same holds on the latest tag next-20261202: reverting aa05faf81583
> together with the two follow ups that depend on it: e4c9df05d81a ("of:
> reserved_mem: Drop node_fixup, CMA can handle it internally again") and
> c025fbcb8c91 ("of: reserved_mem: mark the early_memremap() array helpers
> __init") also boots fine to userspace:
>
> ```
> [ 0.000000] Booting Linux on physical CPU 0x0
> [ 0.000000] Linux version 7.4.0-rc5-next-20261202-00003-g15aab7f330d7 (arm-none-linux-gnueabihf-gcc (Arm GNU Toolchain 12.3.Rel1 (Build arm-12.35)) 12.3.1 20230626, GNU ld (Arm GNU Toolchain 12.3.Rel1 (Build arm-12.35)) 2.40.0.20230627) #1 SMP PREEMPT Thu Dec 3 20:47:32 IST 2026
> [ 0.000000] CPU: ARMv7 Processor [412fc0f4] revision 4 (ARMv7), cr=30c5387d
> [ 0.000000] CPU: div instructions available: patching division code
> [ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, PIPT instruction cache
> [ 0.000000] OF: fdt: Machine model: Texas Instruments K2G General Purpose EVM
> [ 0.000000] Memory policy: Data cache writealloc
> [ 0.000000] Switching physical address space to 0x800000000
> [ 0.000000] cma: Reserved 16 MiB at 0x0000000801800000
> [ 0.000000] Reserved memory: created CMA memory pool at 0x000000081f800000, size 8 MiB
> [ 0.000000] OF: reserved mem: initialized node dsp-common-memory@81f800000, compatible id shared-dma-pool
> [ 0.000000] OF: reserved mem: 0x000000081f800000..0x000000081fffffff (8192 KiB) map reusable dsp-common-memory@81f800000
> [ 0.000000] Zone ranges:
> [ 0.000000] DMA em 0x0000000800000000-0x000000082fffffff]
> [ 0.000000] Normal empty
> [ 0.000000] HighMem em 0x0000000830000000-0x000000087fffffff]
> [ 0.000000] Movable zone start for each node
> [ 0.000000] Early memory node ranges
> [ 0.000000] node 0: em 0x0000000800000000-0x000000087fffffff]
> [ 0.000000] Initmem setup node 0 em 0x0000000800000000-0x000000087fffffff]
> [ 0.000000] percpu: Embedded 16 pages/cpu s34636 r8192 d22708 u65536
> <...>
>
> ```
>
> Board: TI K2G EVM (has Cortex-A15)
> Defconfig: keystone_defconfig
> Toolchain: Arm GNU Toolchain 12.3.Rel1
>
> Do you possibly have any ideas as to what is breaking in the code? Happy
> to run any experiments or provide more info if you need any.
The key here is the "Switching physical address space to 0x800000000" line. It
turned out that the address space switch on ARM 32bit omits updating the fixup
PMD.
This patch should fix this issue:
https://lore.kernel.org/all/20261204223725.2775648-1-m.szyprowski@xxxxxxxxxxx/
Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland