mirror of
https://github.com/apache/nuttx.git
synced 2026-08-28 21:00:44 +00:00
mm_pginitialize() documents heap_start as "the physical address of the start of memory region", and every x86_64 consumer of mm_pgalloc() agrees: create_spgtables(), x86_64_get_pgtable() and up_addrenv_create() all put the result through x86_64_pgvaddr() before touching it. x86_64_pgvaddr() in turn range-checks against CONFIG_ARCH_PGPOOL_PBASE (arch/x86_64/src/common/ pgalloc.h:67). arm64's equivalent passes CONFIG_ARCH_PGPOOL_PBASE. up_allocate_pgheap() passed CONFIG_ARCH_PGPOOL_VBASE instead, and in the other branch X86_64_PGPOOL_BASE + X86_64_LOAD_OFFSET, which is the same mistake spelled out. Every page handed out was therefore a virtual address that fell outside the pool's physical window, x86_64_pgvaddr() returned 0, and the first x86_64_pgwipe() memset NULL. It presents as a page fault in memset() under create_spgtables() the first time a process address environment is created, which is loading the init program. qemu-intel64:knsh_romfs sets PGPOOL_PBASE=0x00c000000 and PGPOOL_VBASE=0x10c000000, so the value passed was off by the 4GB load offset. Impact: runtime, CONFIG_ARCH_ADDRENV builds only (CONFIG_MM_PGALLOC). Assisted-by: Claude:claude-opus-5 Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com> |
||
|---|---|---|
| .. | ||
| arm | ||
| arm64 | ||
| avr | ||
| ceva | ||
| dummy | ||
| hc | ||
| mips | ||
| misoc | ||
| or1k | ||
| renesas | ||
| risc-v | ||
| sim | ||
| sparc | ||
| tricore | ||
| x86 | ||
| x86_64 | ||
| xtensa | ||
| z16 | ||
| z80 | ||
| CMakeLists.txt | ||
| Kconfig | ||