[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v6 06/22] target/riscv: Ignore the pc bits above XLEN
From: |
LIU Zhiwei |
Subject: |
[PATCH v6 06/22] target/riscv: Ignore the pc bits above XLEN |
Date: |
Thu, 13 Jan 2022 19:39:48 +0800 |
The read from PC for translation is in cpu_get_tb_cpu_state, before translation.
Signed-off-by: LIU Zhiwei <zhiwei_liu@c-sky.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
---
target/riscv/cpu_helper.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c
index 32ea066ef0..2c83eb1f05 100644
--- a/target/riscv/cpu_helper.c
+++ b/target/riscv/cpu_helper.c
@@ -40,7 +40,7 @@ void cpu_get_tb_cpu_state(CPURISCVState *env, target_ulong
*pc,
{
uint32_t flags = 0;
- *pc = env->pc;
+ *pc = env->xl == MXL_RV32 ? env->pc & UINT32_MAX : env->pc;
*cs_base = 0;
if (riscv_has_ext(env, RVV)) {
--
2.25.1
- [PATCH v6 01/22] target/riscv: Adjust pmpcfg access with mxl, (continued)
- [PATCH v6 01/22] target/riscv: Adjust pmpcfg access with mxl, LIU Zhiwei, 2022/01/13
- [PATCH v6 02/22] target/riscv: Don't save pc when exception return, LIU Zhiwei, 2022/01/13
- [PATCH v6 03/22] target/riscv: Sign extend link reg for jal and jalr, LIU Zhiwei, 2022/01/13
- [PATCH v6 04/22] target/riscv: Sign extend pc for different XLEN, LIU Zhiwei, 2022/01/13
- [PATCH v6 05/22] target/riscv: Create xl field in env, LIU Zhiwei, 2022/01/13
- [PATCH v6 06/22] target/riscv: Ignore the pc bits above XLEN,
LIU Zhiwei <=
- [PATCH v6 07/22] target/riscv: Extend pc for runtime pc write, LIU Zhiwei, 2022/01/13
- [PATCH v6 08/22] target/riscv: Use gdb xml according to max mxlen, LIU Zhiwei, 2022/01/13
- [PATCH v6 09/22] target/riscv: Relax debug check for pm write, LIU Zhiwei, 2022/01/13
- [PATCH v6 10/22] target/riscv: Adjust csr write mask with XLEN, LIU Zhiwei, 2022/01/13
- [PATCH v6 11/22] target/riscv: Create current pm fields in env, LIU Zhiwei, 2022/01/13
- [PATCH v6 12/22] target/riscv: Alloc tcg global for cur_pm[mask|base], LIU Zhiwei, 2022/01/13
- [PATCH v6 13/22] target/riscv: Calculate address according to XLEN, LIU Zhiwei, 2022/01/13
- [PATCH v6 14/22] target/riscv: Split pm_enabled into mask and base, LIU Zhiwei, 2022/01/13
- [PATCH v6 15/22] target/riscv: Split out the vill from vtype, LIU Zhiwei, 2022/01/13
- [PATCH v6 16/22] target/riscv: Adjust vsetvl according to XLEN, LIU Zhiwei, 2022/01/13