
The FDT relocation is not disabled. I am adding the FDT PADDING bytes while doing FDT reservation in the board_f file. Also update the FDT length based on the new allocation, instead of blindly increasing the size. Currently the size is getting increased even for the relocation disabled scenario also. So without increasing the physical memory for the disable relocation use case, the fdt total size is updated. thus causing memory corruption
On Fri, Feb 9, 2024 at 7:10 PM Tom Rini trini@konsulko.com wrote:
On Fri, Feb 09, 2024 at 01:22:08PM +0530, Selvakumar Velandi wrote:
Hi,
Issue: Linux kernel getting crash after loading kernel in VM system using RISCV QEMU.
RootCause: Memory corruption in uboot FDT memory while launching a VM system in
RISCV
QEMU.
Fix: In the board_f.c file the FDT memory region is reserved without FDT
padding
bytes. uboot will add some params like bootargs while launching linux. While relocate the FDT, if its decided as run in the Fixed memory
location
i.e fdy_high is set as -1, then the padding bytes not added while relocating the FDT,
Do not disable fdt relocation. The RISC-V platforms which do this today are broken.
-- Tom