OSDN Git Service

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)
commitabb8e86b269604e906a6a4af7a09f04b72dbb862
tree88e7655d7a88a88c0160f88d7fee5cd1ac70192a
parent797f0375dd2ef5cdc68ac23450cbae9a5c67a74e
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