nuttx/arch
ligd 113ab704c7 goldfish & qemu: handle MMU table and CONFIG_RAM_END
Reproduce:

configure:
./tools/configure.sh qemu-armv7a:nsh -j8
open kasan:
CONFIG_MM_KASAN=y
run:
qemu-system-arm -cpu cortex-a7 -nographic -machine virt,virtualization=off,gic-version=2 -net none -chardev stdio,id=con,mux=on -serial chardev:con -mon chardev=con,mode=readline -kernel ./nuttx
error:
run hanged

Rootcause:

In Qemu armv7a, the ram-end reserved for MMU PGTABLE:

And the up_allocate_heap()  directly use the ram-end for heap in arch/arm/src/common/arm_allocateheap.c

*heap_size  = CONFIG_RAM_END - g_idle_topstack;

Then they are conflict.
Usually, we won't use the heap end, so can't find the error.
BUT, the KASAN will use the heap end for shadow, so found the error.

Resolve:

up_allocate_heap() consider of MMU, re-define the RAM_END at chip.h

Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-03-06 09:26:44 +09:00
..
arm goldfish & qemu: handle MMU table and CONFIG_RAM_END 2024-03-06 09:26:44 +09:00
arm64 paging: Rename existing CONFIG_PAGING to CONFIG_LEGACY_PAGING 2024-03-05 09:45:49 +08:00
avr use apps-or-nuttx-Make.defs for archs 2024-03-01 12:59:16 -03:00
ceva use apps-or-nuttx-Make.defs for archs 2024-03-01 12:59:16 -03:00
dummy
hc use apps-or-nuttx-Make.defs for archs 2024-03-01 12:59:16 -03:00
mips use apps-or-nuttx-Make.defs for archs 2024-03-01 12:59:16 -03:00
misoc use apps-or-nuttx-Make.defs for archs 2024-03-01 12:59:16 -03:00
or1k use apps-or-nuttx-Make.defs for archs 2024-03-01 12:59:16 -03:00
renesas use apps-or-nuttx-Make.defs for archs 2024-03-01 12:59:16 -03:00
risc-v riscv: Implement page-fault exception and on-demand paging 2024-03-05 09:45:49 +08:00
sim use apps-or-nuttx-Make.defs for archs 2024-03-01 12:59:16 -03:00
sparc use apps-or-nuttx-Make.defs for archs 2024-03-01 12:59:16 -03:00
tricore arch/tricore: add Infineon AURIX TriCore support 2024-02-21 21:39:19 -08:00
x86 use apps-or-nuttx-Make.defs for archs 2024-03-01 12:59:16 -03:00
x86_64 arch/intel64: add HPET timer support as oneshot timer 2024-03-03 02:24:40 +08:00
xtensa fix(esp32s3_spiflash_mtd): debug type specifiers 2024-03-05 22:23:50 +08:00
z16 use apps-or-nuttx-Make.defs for archs 2024-03-01 12:59:16 -03:00
z80 use apps-or-nuttx-Make.defs for archs 2024-03-01 12:59:16 -03:00
CMakeLists.txt build: add initial cmake build system 2023-07-08 13:50:48 +08:00
Kconfig riscv: Implement page-fault exception and on-demand paging 2024-03-05 09:45:49 +08:00