linux/arch/riscv/mm
Nick Kossifidis c6fe81191b
RISC-V: relocate DTB if it's outside memory region
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@ics.forth.gr>
Link: https://lore.kernel.org/r/20220322132839.3653682-1-mick@ics.forth.gr
Tested-by: Conor Dooley <conor.dooley@microchip.com>
Fixes: f105aa940e ("riscv: add BUILTIN_DTB support for MMU-enabled targets")
Cc: stable@vger.kernel.org
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
2022-04-29 07:59:18 -07:00
..
cacheflush.c RISC-V: Do not use cpumask data structure for hartid bitmap 2022-01-20 09:27:22 -08:00
context.c riscv: Implement sv48 support 2022-01-19 17:54:09 -08:00
extable.c riscv: extable: fix err reg writing in dedicated uaccess handler 2022-02-08 17:02:47 -08:00
fault.c RISC-V Patches for the 5.17 Merge Window, Part 1 2022-01-19 11:38:21 +02:00
hugetlbpage.c hugetlbfs: remove hugetlb_add_hstate() warning for existing hstate 2020-06-03 20:09:46 -07:00
init.c RISC-V: relocate DTB if it's outside memory region 2022-04-29 07:59:18 -07:00
kasan_init.c RISC-V Patches for the 5.18 Merge Window, Part 1 2022-03-25 10:11:38 -07:00
Makefile riscv: Fix config KASAN && DEBUG_VIRTUAL 2022-03-03 15:32:41 -08:00
pageattr.c RISC-V Patches for the 5.11 Merge Window, Part 1 2020-12-18 10:43:07 -08:00
physaddr.c riscv: Fix DEBUG_VIRTUAL false warnings 2022-03-03 15:32:04 -08:00
ptdump.c riscv: Fix PTDUMP output now BPF region moved back to module region 2021-07-06 15:21:27 -07:00
tlbflush.c RISC-V: Do not use cpumask data structure for hartid bitmap 2022-01-20 09:27:22 -08:00