]> 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)
commitadbdf3c27dd2757e5c82ec81c018d029fbc27759
tree88e7655d7a88a88c0160f88d7fee5cd1ac70192a
parent2d11270aee16a825bec52367eb2d5d7133ac0e64
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