qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] target/riscv: Fix satp write


From: Alistair Francis
Subject: Re: [PATCH] target/riscv: Fix satp write
Date: Thu, 2 Sep 2021 12:49:19 +1000

On Thu, Sep 2, 2021 at 11:59 AM Bin Meng <bmeng.cn@gmail.com> wrote:
>
> On Thu, Sep 2, 2021 at 9:02 AM LIU Zhiwei <zhiwei_liu@c-sky.com> wrote:
> >
> >
> > On 2021/9/1 下午9:05, Bin Meng wrote:
> > > On Wed, Sep 1, 2021 at 8:51 PM LIU Zhiwei <zhiwei_liu@c-sky.com> wrote:
> > >> These variables should be target_ulong. If truncated to int,
> > >> the bool conditions they indicate will be wrong.
> > >>
> > >> As satp is very important for Linux, this bug almost fails every boot.
> > > Could you please describe which Linux configuration is broken?
> >
> > I use the image from:
> >
> > https://gitlab.com/c-sky/buildroot/-/jobs/1251564514/artifacts/browse/output/images/
> >
> > >   I have
> > > a 64-bit 5.10 kernel and it boots fine.
> >
> > The login is mostly OK for me. But the busybox can't run properly.
>
> Which kernel version is this? Could you please investigate and
> indicate in the commit message?
>
> I just tested current qemu-system-riscv64 can boot to Ubuntu 20.04
> distro user space.

I also have never seen any issues.

Looking at this `vm` is set from a `static const char
valid_vm_1_10_64` so an int is fine.

It probably is a good idea for `mask` and `asid` to be target_ulong as
they are set by bit operations on target_ulong's. I guess if your host
int is 32-bits SATP64_ASID will overflow that.

Anyway with 128-bit RISC-V and maybe the ability to run 64-bit guests
no 32-bit hosts this seems like a good step

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

>
> Regards,
> Bin
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]