[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] RISC-V: Place DTB at 3GB boundary instead of 4GB
From: |
Atish Patra |
Subject: |
Re: [PATCH] RISC-V: Place DTB at 3GB boundary instead of 4GB |
Date: |
Fri, 18 Dec 2020 08:00:32 +0000 |
User-agent: |
Evolution 3.38.2 |
On Fri, 2020-12-18 at 15:33 +0800, Bin Meng wrote:
> Hi Atish,
>
> On Fri, Dec 18, 2020 at 3:27 PM Atish Patra <Atish.Patra@wdc.com>
> wrote:
> >
> > On Fri, 2020-12-18 at 15:21 +0800, Bin Meng wrote:
> > > Hi Atish,
> > >
> > > On Fri, Dec 18, 2020 at 5:48 AM Atish Patra <atish.patra@wdc.com>
> > > wrote:
> > > >
> > > > Currently, we place the DTB at 2MB from 4GB or end of DRAM
> > > > which
> > > > ever is
> > > > lesser. However, Linux kernel can address only 1GB of memory
> > > > for
> > > > RV32.
> > > > Thus, it can not map anything beyond 3GB (assuming 2GB is the
> > > > starting address).
> > > > As a result, it can not process DT and panic if opensbi dynamic
> > > > firmware
> > > > is used.
> > > >
> > > > Fix this by placing the DTB at 2MB from 3GB or end of DRAM
> > > > whichever is lower.
> > > >
> > > > Signed-off-by: Atish Patra <atish.patra@wdc.com>
> > > > ---
> > > > hw/riscv/boot.c | 4 ++--
> > > > 1 file changed, 2 insertions(+), 2 deletions(-)
> > > >
> > >
> > > With this patch, 32-bit sifive_u still does not boot kernel with
> > > the
> > > following patch applied on 5.10:
> > > https://patchwork.kernel.org/project/linux-riscv/patch/20201217074855.1948743-1-atish.patra@wdc.com/
> > >
> > > Command I used:
> > > $ qemu-system-riscv32 -nographic -M sifive_u -m 1G -smp 5 -kernel
> > > arch/riscv/boot/Image
> > >
> > > 32-bit virt cannot boot the same kernel image with memory set to
> > > 2G
> > > either:
> > > $ qemu-system-riscv32 -nographic -M virt -m 2G -smp 4 -kernel
> > > arch/riscv/boot/Image
> > >
> >
> > Hi Bin,
> > As mentioned in the email on the linux mailing list, this patch
> > only
> > solves 2GB problem. sifive_u problem is solved by Alistair's
> > patch[1].
> >
> > He is planning to send the PR soon. The issue with sifive_u boot
> > was it
> > was failing the 32 bit test earlier resulting a 2MB aligned address
> > instead of 4MB.
>
> Ah, I see. However my testing shows that virt with 2G still does not
> boot with this patch.
>
Strange. I verified again with following combination with -bios and
without bios parameter.
1. virt 32/64 with 1GB/2GB memory
2. sifive_u 32/64 bit with 1GB/2GB memory (Alistair's patch included)
Can you share the boot log along with the head commit of Qemu and
commandline ? I am using 5.10 kernel with my kernel fix.
> >
> > [1]
> > https://www.mail-archive.com/qemu-devel@nongnu.org/msg767886.html
> >
>
> Regards,
> Bin
--
Regards,
Atish
- [PATCH] RISC-V: Place DTB at 3GB boundary instead of 4GB, Atish Patra, 2020/12/17
- Re: [PATCH] RISC-V: Place DTB at 3GB boundary instead of 4GB, Palmer Dabbelt, 2020/12/17
- Re: [PATCH] RISC-V: Place DTB at 3GB boundary instead of 4GB, Bin Meng, 2020/12/18
- Re: [PATCH] RISC-V: Place DTB at 3GB boundary instead of 4GB, Atish Patra, 2020/12/18
- Re: [PATCH] RISC-V: Place DTB at 3GB boundary instead of 4GB, Bin Meng, 2020/12/18
- Re: [PATCH] RISC-V: Place DTB at 3GB boundary instead of 4GB,
Atish Patra <=
- Re: [PATCH] RISC-V: Place DTB at 3GB boundary instead of 4GB, Bin Meng, 2020/12/18
- Re: [PATCH] RISC-V: Place DTB at 3GB boundary instead of 4GB, Atish Patra, 2020/12/18
- Re: [PATCH] RISC-V: Place DTB at 3GB boundary instead of 4GB, Bin Meng, 2020/12/22
- Re: [PATCH] RISC-V: Place DTB at 3GB boundary instead of 4GB, Atish Patra, 2020/12/22
- Re: [PATCH] RISC-V: Place DTB at 3GB boundary instead of 4GB, Bin Meng, 2020/12/22
- Re: [PATCH] RISC-V: Place DTB at 3GB boundary instead of 4GB, Bin Meng, 2020/12/28