Attention is currently required from: Alper Nebi Yasak, Nico Huber.
Julius Werner has posted comments on this change by Alper Nebi Yasak. ( https://review.coreboot.org/c/coreboot/+/80364?usp=email )
Change subject: mainboard/qemu-aarch64: Get top of memory from device-tree blob ......................................................................
Patch Set 4:
(1 comment)
File src/mainboard/emulation/qemu-aarch64/cbmem.c:
https://review.coreboot.org/c/coreboot/+/80364/comment/1872cb3c_91d35b33?usp... : PS2, Line 12: top = fdt_get_memory_top((void *)_dram);
Thanks for the explanation. […]
For 64-bit platforms like this, you shouldn't need to worry about that... we've had platforms that returned exactly `0x100000000` for years now. The CBMEM code itself is robust about that, the worry is just about code using CBMEM areas for various things. For 32-bit platforms, using -1 should be fine (it would be more correct to say `-4*KiB` but the CBMEM/IMD code will do that for you).
And yes, putting the -1 outside is not right, if you have less than 4GB RAM you probably want it right at the end or the remaining 4KB would likely be wasted. You should write it as `MIN(top, (uint64_t)4 * GiB - 1)`.