qemu-riscv
[Top][All Lists]
Advanced

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

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


From: LIU Zhiwei
Subject: Re: [PATCH] target/riscv: Fix satp write
Date: Thu, 2 Sep 2021 09:02:52 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0


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.

Thanks,
Zhiwei

Please add:

Fixes: 419ddf00ed78 ("target/riscv: Remove the hardcoded SATP_MODE macro")

Signed-off-by: LIU Zhiwei <zhiwei_liu@c-sky.com>
---
  target/riscv/csr.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/riscv/csr.c b/target/riscv/csr.c
index 50a2c3a3b4..ba9818f6a5 100644
--- a/target/riscv/csr.c
+++ b/target/riscv/csr.c
@@ -986,7 +986,7 @@ static RISCVException read_satp(CPURISCVState *env, int 
csrno,
  static RISCVException write_satp(CPURISCVState *env, int csrno,
                                   target_ulong val)
  {
-    int vm, mask, asid;
+    target_ulong vm, mask, asid;

      if (!riscv_feature(env, RISCV_FEATURE_MMU)) {
          return RISCV_EXCP_NONE;
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>



reply via email to

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