casaroli opened a new pull request, #22554: URL: https://github.com/apache/nuttx/pull/22554
## Summary The linker script of the `qemu-armv8a` kernel build (`ld-kernel.script`) gave the kernel image a fixed 2 MiB region at `CONFIG_LOAD_BASE`, and the page pool a fixed 4 MiB region at `CONFIG_RAM_START + 0x800000`. A kernel image larger than 2 MiB did not link, also when `CONFIG_RAM_SIZE` gives it the room: the kernel heap takes the RAM after the image, up to `CONFIG_RAM_START + CONFIG_RAM_SIZE` (`up_allocate_kheap()`). A larger `CONFIG_TLS_LOG2_MAXSTACK` makes this easy to hit, because the idle stack is aligned to the maximum stack size. This PR lets the image region end at the end of the RAM, and takes the page pool region from `CONFIG_ARCH_PGPOOL_PBASE` and `CONFIG_ARCH_PGPOOL_SIZE`, as the `rv-virt` kernel linker script does. No section goes to the page pool region, so that line only makes the memory map agree with the configuration. ## Impact Only the `qemu-armv8a` kernel build (`qemu-armv8a:knsh` and configurations made from it). The flat builds use `dramboot.ld` and do not change; CMake has no kernel build for this board. The defconfig does not change: with its values the image of `qemu-armv8a:knsh` is the same as on master (same section table, same `System.map`). A configuration with a larger image now links. Not a breaking change. ## Testing Built in the CI image (`-Werror`) on Linux, run under QEMU 10.2.2 (TCG, `-smp 1`). `qemu-armv8a:knsh` with `CONFIG_NET`, `CONFIG_NET_IPv4`, `CONFIG_NET_TCP`, `CONFIG_NET_UDP`, `CONFIG_NETDEV_LATEINIT`, `CONFIG_NET_SOCKOPTS`, `CONFIG_TLS_LOG2_MAXSTACK=20`, `CONFIG_RAM_SIZE=67108864`, the page pool at 0x44000000 (`CONFIG_ARCH_PGPOOL_PBASE`, `CONFIG_ARCH_PGPOOL_VBASE`, `CONFIG_ARCH_PGPOOL_SIZE=67108864`) and `CONFIG_IDLETHREAD_STACKSIZE=1048576`: | | master | this PR | |---|---|---| | link | ``region `dram' overflowed by 524288 bytes`` | OK (text + data + bss: 2436792 bytes) | | ostest (`-m 512M`) | - | exits with status 0 | `qemu-armv8a:knsh` as it is: master and this PR give the same section table and the same `System.map`; ostest exits with status 0 on both. `tools/checkpatch.sh -c -u -m -g` passes. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
