Re: [PATCH] RISC-V-fixes: relocate DTB if it's outside memory region

From: Nick Kossifidis
Date: Sun Mar 27 2022 - 04:52:26 EST


Στις 2022-03-24 11:37, Conor.Dooley@xxxxxxxxxxxxx έγραψε:
On 22/03/2022 13:28, Nick Kossifidis wrote:
In case the DTB provided by the bootloader/BootROM is before the kernel
image or outside /memory, we won't be able to access it through the
linear mapping, and get a segfault on setup_arch(). Currently OpenSBI
relocates DTB but that's not always the case (e.g. if FW_JUMP_FDT_ADDR
is not specified), and it's also not the most portable approach since
the default FW_JUMP_FDT_ADDR of the generic platform relocates the DTB
at a specific offset that may not be available. To avoid this situation
copy DTB so that it's visible through the linear mapping.

Signed-off-by: Nick Kossifidis <mick@xxxxxxxxxxxx>

Albeit in a backport, I tested this on a PolarFire SoC based board.
So I guess, Tested-by: Conor Dooley <conor.dooley@xxxxxxxxxxxxx>

And a lot cleaner than using create_pgd_mapping in setup_vm_final to do it :)

Thanks,
Conor.


Thanks !