Re: [PATCH] riscv: Fix bug in setting pmpcfg CSR for RISCV64

2020-08-10 Thread Alistair Francis
On Sat, Aug 8, 2020 at 6:05 AM Hou Weiying wrote: > > First, sizeof(target_ulong) equals to 4 on riscv32, so this change > does not change the function on riscv32. Second, sizeof(target_ulong) > equals to 8 on riscv64, and 'reg_index * 8 + i' is not a legal > pmp_index (we will explain later), whi

[PATCH] riscv: Fix bug in setting pmpcfg CSR for RISCV64

2020-08-08 Thread Hou Weiying
First, sizeof(target_ulong) equals to 4 on riscv32, so this change does not change the function on riscv32. Second, sizeof(target_ulong) equals to 8 on riscv64, and 'reg_index * 8 + i' is not a legal pmp_index (we will explain later), which should be 'reg_index * 4 + i'. If the parameter reg_index

[PATCH] riscv: Fix bug in setting pmpcfg CSR for RISCV64

2020-08-08 Thread Hou Weiying
First, sizeof(target_ulong) equals to 4 on riscv32, so this change does not change the function on riscv32. Second, sizeof(target_ulong) equals to 8 on riscv64, and 'reg_index * 8 + i' is not a legal pmp_index (we will explain later), which should be 'reg_index * 4 + i'. If the parameter reg_index