diff options
author | Shaobo Song <songshaobo@eswincomputing.com> | 2023-02-20 07:27:32 +0000 |
---|---|---|
committer | Palmer Dabbelt <palmer@rivosinc.com> | 2023-03-01 16:59:36 -0800 |
commit | ae9c326fb6f9b580b18de9bce1438229bfaa5215 (patch) | |
tree | 34e3c5c3c7d702f5190ebed853c2ed9cd2cbb5e2 | |
parent | 73b9da4aa39cd2f8b485771763bc207faf9c6893 (diff) | |
download | qemu-ae9c326fb6f9b580b18de9bce1438229bfaa5215.zip qemu-ae9c326fb6f9b580b18de9bce1438229bfaa5215.tar.gz qemu-ae9c326fb6f9b580b18de9bce1438229bfaa5215.tar.bz2 |
target/riscv: Fix checking of whether instruciton at 'pc_next' spans pages
This bug has a noticeable behavior of falling back to the main loop and
respawning a redundant translation block including a single instruction
when the end address of the compressive instruction is exactly on a page
boundary, and slows down running system performance.
Signed-off-by: Shaobo Song <songshaobo@eswincomputing.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20230220072732.568-1-songshaobo@eswincomputing.com>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
-rw-r--r-- | target/riscv/translate.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/target/riscv/translate.c b/target/riscv/translate.c index 772f9d7..8ffa211 100644 --- a/target/riscv/translate.c +++ b/target/riscv/translate.c @@ -1261,7 +1261,7 @@ static void riscv_tr_translate_insn(DisasContextBase *dcbase, CPUState *cpu) uint16_t next_insn = cpu_lduw_code(env, ctx->base.pc_next); int len = insn_len(next_insn); - if (!is_same_page(&ctx->base, ctx->base.pc_next + len)) { + if (!is_same_page(&ctx->base, ctx->base.pc_next + len - 1)) { ctx->base.is_jmp = DISAS_TOO_MANY; } } |