lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAOnJCUJJCSjCYfALAUXJoZbChi617Nd_Yeu6o4q_jyvoofQE3Q@mail.gmail.com>
Date:   Thu, 17 Dec 2020 15:44:17 -0800
From:   Atish Patra <atishp@...shpatra.org>
To:     Bin Meng <bmeng.cn@...il.com>
Cc:     Atish Patra <atish.patra@....com>,
        Albert Ou <aou@...s.berkeley.edu>,
        Anup Patel <anup.patel@....com>,
        linux-kernel <linux-kernel@...r.kernel.org>,
        Palmer Dabbelt <palmer@...belt.com>,
        Paul Walmsley <paul.walmsley@...ive.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        linux-riscv <linux-riscv@...ts.infradead.org>,
        Mike Rapoport <rppt@...nel.org>
Subject: Re: [PATCH] RISC-V: Fix usage of memblock_enforce_memory_limit

On Thu, Dec 17, 2020 at 12:53 AM Bin Meng <bmeng.cn@...il.com> wrote:
>
> Hi Atish,
>
> On Thu, Dec 17, 2020 at 4:43 PM Atish Patra <atishp@...shpatra.org> wrote:
> >
> > On Thu, Dec 17, 2020 at 12:12 AM Bin Meng <bmeng.cn@...il.com> wrote:
> > >
> > > Hi Atish,
> > >
> > > On Thu, Dec 17, 2020 at 3:49 PM Atish Patra <atish.patra@....com> 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@....com>
> > > > ---
> > > >  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
>
> I have always been using -m 2G for testing both 32-bit and 64-bit.
> 32-bit 'virt' with 2G memory boots the 32-bit kernel fine.
>

2GB issue with fw_dynamic is fixed with this patch.

https://www.mail-archive.com/qemu-devel@nongnu.org/msg768341.html

> $ qemu-system-riscv32 -nographic -M virt -m 2G -smp 4 -kernel
> arch/riscv/boot/Image -bios fw_jump.bin
>
> > 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.
>
> Kernel does not boot with 1G memory on 32-bit 'sifive_u', either with
> fw_jump.bin or fw_dynamic.bin.
>
> $ qemu-system-riscv32 -nographic -M sifive_u -m 1G -smp 5 -kernel
> arch/riscv/boot/Image -bios fw_jump.bin
>

This happened because of the incorrect loading address. It is already
fixed by Alistair.
https://www.mail-archive.com/qemu-devel@nongnu.org/msg768279.html

> >
> > > Tested-by: Bin Meng <bin.meng@...driver.com>
> > >

Thanks for testing it.

> > > I believe the following tag should also be added and patch cc'ed to
> > > stable-kernel:
> > >
> > > Reported-by: Bin Meng <bin.meng@...driver.com>
> > > Cc: <stable@...r.kernel.org> # 5.10
>

Sure. I will add that and resend it.

> Regards,
> Bin



-- 
Regards,
Atish

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ