linux/arch/riscv/mm
Nick Kossifidis decf89f86e
riscv: try to allocate crashkern region from 32bit addressible memory
When allocating crash kernel region without explicitly specifying its
base address/size, memblock_phys_alloc_range will attempt to allocate
memory top to bottom (memblock.bottom_up is false), so the crash
kernel region will end up in highmem on 64bit systems. This way
swiotlb can't work on the crash kernel, since there won't be any
32bit addressible memory available for the bounce buffers.

Try to allocate 32bit addressible memory if available, for the
crash kernel by restricting the top search address to be less
than SZ_4G. If that fails fallback to the previous behavior.

I tested this on HiFive Unmatched where the pci-e controller needs
swiotlb to work, with this patch it's possible to access the pci-e
controller on crash kernel and mount the rootfs from the nvme.

Signed-off-by: Nick Kossifidis <mick@ics.forth.gr>
Fixes: e53d28180d ("RISC-V: Add kdump support")
Cc: stable@vger.kernel.org
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
2022-01-09 10:40:14 -08:00
..
cacheflush.c riscv: Flush current cpu icache before other cpus 2021-10-04 18:24:15 -07:00
context.c riscv: mm: don't advertise 1 num_asid for 0 asid bits 2021-10-04 14:16:58 -07:00
extable.c riscv: extable: add a dedicated uaccess handler 2022-01-05 17:53:29 -08:00
fault.c riscv: Make vmalloc/vmemmap end equal to the start of the next region 2022-01-05 19:22:13 -08:00
hugetlbpage.c hugetlbfs: remove hugetlb_add_hstate() warning for existing hstate 2020-06-03 20:09:46 -07:00
init.c riscv: try to allocate crashkern region from 32bit addressible memory 2022-01-09 10:40:14 -08:00
kasan_init.c riscv: Fix asan-stack clang build 2021-10-29 08:54:50 -07:00
Makefile riscv: Fixup patch_text panic in ftrace 2021-01-14 15:09:04 -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: Introduce structure that group all variables regarding kernel mapping 2021-07-05 18:04:00 -07: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 riscv: add ASID-based tlbflushing methods 2021-06-30 20:55:39 -07:00