linux/arch/riscv
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
..
boot riscv: dts: sifive: fu540-c000: Fix PLIC node 2022-01-09 10:11:44 -08:00
configs RISC-V: defconfigs: Remove redundant K210 DT source 2022-01-06 09:41:03 -08:00
errata riscv: skip errata_cip_453.o if CONFIG_ERRATA_SIFIVE_CIP_453 is disabled 2021-06-01 21:16:41 -07:00
include riscv/mm: Enable THP migration 2022-01-07 15:54:28 -08:00
kernel riscv: use hart id instead of cpu id on machine_kexec 2022-01-09 10:40:00 -08:00
kvm RISC-V: KVM: fix boolreturn.cocci warnings 2021-11-01 17:35:17 +05:30
lib riscv: extable: consolidate definitions 2022-01-05 17:52:47 -08:00
mm riscv: try to allocate crashkern region from 32bit addressible memory 2022-01-09 10:40:14 -08:00
net riscv: extable: add type and data fields 2022-01-05 17:52:54 -08:00
Kbuild kbuild: use more subdir- for visiting subdirectories while cleaning 2021-10-24 13:49:46 +09:00
Kconfig riscv/mm: Enable THP migration 2022-01-07 15:54:28 -08:00
Kconfig.debug
Kconfig.erratas riscv: enable SiFive errata CIP-453 and CIP-1200 Kconfig only if CONFIG_64BIT=y 2021-05-06 09:40:13 -07:00
Kconfig.socs riscv: sifive: fix Kconfig errata warning 2021-06-12 17:20:50 -07:00
Makefile RISC-V Patches for the 5.16 Merge Window, Part 1 2021-11-13 09:15:42 -08:00