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

Nick Kossifidis mick at ics.forth.gr
Sun Mar 27 01:52:11 PDT 2022


Στις 2022-03-24 11:37, Conor.Dooley at microchip.com έγραψε:
> 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 at ics.forth.gr>
> 
> Albeit in a backport, I tested this on a PolarFire SoC based board.
> So I guess, Tested-by: Conor Dooley <conor.dooley at microchip.com>
> 
> And a lot cleaner than using create_pgd_mapping in setup_vm_final to do 
> it :)
> 
> Thanks,
> Conor.
> 

Thanks !



More information about the linux-riscv mailing list