unicorn/qemu/target/riscv
Hou Weiying 55be7adad9 riscv: Fix bug in setting pmpcfg CSR for RISCV64
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 equals to 2 (means that we will change the
value of pmpcfg2, or the second pmpcfg on riscv64), then
pmpcfg_csr_write(env, 2, val) will map write tasks to
pmp_write_cfg(env, 2 * 8 + [0...7], val). However, no cfg csr is indexed
by value 16 or 23 on riscv64, so we consider it as a bug.

We are looking for constant (e.g., define a new constant named
RISCV_WORD_SIZE) in QEMU to help others understand code better,
but none was found. A possible good explanation of this literal is it is
the minimum word length on riscv is 4 bytes (32 bit).

Backports fdd33b86b20d153b131fc6259aea7a0084ab14b8
2021-03-08 12:42:12 -05:00
..
insn_trans target/riscv: check before allocating TCG temps 2021-03-08 12:41:19 -05:00
cpu-param.h tcg: Split out target/arch/cpu-param.h 2019-06-10 19:35:46 -04:00
cpu.c target/riscv: Enable vector extensions 2021-03-08 11:18:36 -05:00
cpu.h target/riscv: fix vill bit index in vtype register 2021-03-08 12:13:58 -05:00
cpu_bits.h target/riscv: support vector extension csr 2021-02-26 02:25:58 -05:00
cpu_helper.c target/riscv: Report errors validating 2nd-stage PTEs 2021-02-25 11:55:53 -05:00
cpu_user.h Supply missing header guards 2019-06-12 10:59:10 -04:00
csr.c target/riscv: support vector extension csr 2021-02-26 02:25:58 -05:00
fpu_helper.c target/riscv: Check nanboxed inputs to fp helpers 2021-03-08 12:31:18 -05:00
helper.h target/riscv: vector compress instruction 2021-03-07 12:47:46 -05:00
insn16-32.decode target/riscv: Split RVC32 and RVC64 insns into separate files 2019-05-28 19:00:23 -04:00
insn16-64.decode target/riscv: Add checks for several RVC reserved operands 2019-05-28 19:20:36 -04:00
insn16.decode target/riscv: Add checks for several RVC reserved operands 2019-05-28 19:20:36 -04:00
insn32-64.decode target/riscv: add vector amo operations 2021-02-26 09:47:32 -05:00
insn32.decode target/riscv: vector compress instruction 2021-03-07 12:47:46 -05:00
instmap.h Supply missing header guards 2019-06-12 10:59:10 -04:00
internals.h target/riscv: Check nanboxed inputs to fp helpers 2021-03-08 12:31:18 -05:00
Makefile.objs target/riscv: add vector configure instruction 2021-02-26 02:37:59 -05:00
op_helper.c target/riscv: Implement checks for hfence 2021-02-25 12:03:57 -05:00
pmp.c riscv: Fix bug in setting pmpcfg CSR for RISCV64 2021-03-08 12:42:12 -05:00
pmp.h RISC-V: Check for the effective memory privilege mode during PMP checks 2019-08-08 16:52:57 -04:00
translate.c target/riscv: Check nanboxed inputs in trans_rvf.inc.c 2021-03-08 12:38:15 -05:00
unicorn.c target/riscv: Add the virtulisation mode 2020-03-22 01:15:06 -04:00
unicorn.h target/riscv: Initial introduction of the RISC-V target 2019-03-08 21:46:10 -05:00
vector_helper.c target/riscv/vector_helper: Fix build on 32-bit big endian hosts 2021-03-08 12:18:39 -05:00