]> git.baikalelectronics.ru Git - kernel.git/commit
RISC-V: Set current memblock limit
authorAtish Patra <atish.patra@wdc.com>
Mon, 11 Jan 2021 23:45:02 +0000 (15:45 -0800)
committerPalmer Dabbelt <palmerdabbelt@google.com>
Sat, 16 Jan 2021 05:35:47 +0000 (21:35 -0800)
commit8280893ad61d07bafa64e5875ca031b95ec27f69
tree88e7655d7a88a88c0160f88d7fee5cd1ac70192a
parentf02fdec44409cd1b46c66fb9d955be01b3aae6cf
RISC-V: Set current memblock limit

Currently, linux kernel can not use last 4k bytes of addressable space
because IS_ERR_VALUE macro treats those as an error. This will be an issue
for RV32 as any memblock allocator potentially allocate chunk of memory
from the end of DRAM (2GB) leading bad address error even though the
address was technically valid.

Fix this issue by limiting the memblock if available memory spans the
entire address space.

Reviewed-by: Anup Patel <anup@brainfault.org>
Signed-off-by: Atish Patra <atish.patra@wdc.com>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
arch/riscv/mm/init.c