seL4 / seL4

The seL4 microkernel

Home Page:https://sel4.systems

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not enough memory for kernel devices - arm64

andybui01 opened this issue · comments

I was tinkering with the kernel and ran into this:

ELF-LOADER: Synchronous exception received:
esr_el1: 96000005
elr_el1: ffffff80800114b4
spsr_el1: 200003c5
far_el1: ffffffffffe00000
abort() called.

The FAR is coincidentally KDEV_BASE or UART_PPTR. After some investigation it looks as if the following assert:
assert(vaddr >= PPTR_TOP) in map_kernel_frame fails when the vaddr wraps around. This happens if the specified kernel devices in hardware.yml use more than the 2MiB of kernel device memory currently reserved at the very end of the address space. The assert is never printed as it requires the UART to be mapped in, hence the sync exception at UART_PPTR.

This seems easy enough to add a compile-time check I think, perhaps device_gen.h can contain a compile_assert that the last entry's offset is within the size of the kernel device window.

That would save debugging time for people running into this in the future, could you send a patch?

Hey, no problem, this was just something I found out awhile ago, a patch should be easy.