Re: [PATCH] RISC-V: Fix usage of memblock_enforce_memory_limit

From: Atish Patra
Date: Thu Dec 17 2020 - 03:44:30 EST


On Thu, Dec 17, 2020 at 12:12 AM Bin Meng <bmeng.cn@xxxxxxxxx> wrote:
>
> Hi Atish,
>
> On Thu, Dec 17, 2020 at 3:49 PM Atish Patra <atish.patra@xxxxxxx> wrote:
> >
> > memblock_enforce_memory_limit accepts the maximum memory size not the last
> > address. Fix the function invocation correctly.
> >
> > Fixes: 1bd14a66ee52 ("RISC-V: Remove any memblock representing unusable memory area")
> >
> > Signed-off-by: Atish Patra <atish.patra@xxxxxxx>
> > ---
> > arch/riscv/mm/init.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
>
> Thank you for working on this.
>
> Tested with QEMU 5.2.0 on 32-bit 'virt' and 'sifive_u', with
> fw_jump.bin used as the -bios.

fw_dynamic should also work unless you are using more than 1G of memory.
Linux kernel can only support 1G of memory for RV32. The current
Kconfig is bit misleading and
I will send a patch to update the description.

However, kernel should be able to ignore any memory beyond what it can
address and continue.
I will investigate more.

> 32-bit 'virt' boots, but 32-bit 'sifive_u' still does not boot, which
> should be another issue because reverting the original 1bd14a66ee52 it
> still does not help 'sifive_u'.
>

Are you using more than 1G of memory ? Let me know if the kernel boots
if you use 1G.

> Tested-by: Bin Meng <bin.meng@xxxxxxxxxxxxx>
>
> I believe the following tag should also be added and patch cc'ed to
> stable-kernel:
>
> Reported-by: Bin Meng <bin.meng@xxxxxxxxxxxxx>
> Cc: <stable@xxxxxxxxxxxxxxx> # 5.10
>
> Regards,
> Bin
>
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@xxxxxxxxxxxxxxxxxxx
> http://lists.infradead.org/mailman/listinfo/linux-riscv



--
Regards,
Atish