Closed bjorn3 closed 3 months ago
At a glance this feels like a bug in U-Boot's UEFI implementation? Limine only ever uses the memory map obtained from UEFI.
Could be.
I am unable to reproduce this with latest Limine, QEMU 8.2.3 and U-Boot 2024.10-rc2-00056-g7bd2559cb30a (Aug 11 2024 - 20:23:03 +0200).
I can confirm that the reserved memory does exist in the device tree (as seen by fdt print
in the U-Boot console) and that writing there indeed does cause a crash, but the UEFI memory map properly reports it as reserved, and so does Limine.
Running the Limine test kernel (edited to stop after printing the memory map) reports the following memory map:
Based on what you all said I presume this is a bug in the U-Boot 2023.01+dfsg-2+deb12u1 shipped by Debian that has been fixed since.
The riscv64 virt machine of QEMU contains the following snippet in the device tree:
Any writes to this
mmode_resv0
region will fault.If I run U-Boot in supervisor mode as UEFI implementation, make it load limine 8.0.4 and then load my kernel using limine, the memory map produced by limine marks
mmode_resv0
as usable memory:As
mmode_resv0
is marked as usable in the memory map, my kernel attempts to write to it, causing a crash.