[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 10/13] target/riscv: Reduce riscv_tr_breakpoint_check pc a
From: |
Peter Maydell |
Subject: |
Re: [PATCH v3 10/13] target/riscv: Reduce riscv_tr_breakpoint_check pc advance to 2 |
Date: |
Sun, 18 Jul 2021 00:35:03 +0100 |
On Sat, 17 Jul 2021 at 23:18, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> The actual number of bytes advanced need not be 100% exact,
> but we should not cross a page when the insn would not.
>
> If rvc is enabled, the minimum insn size is 2.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
> target/riscv/translate.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/target/riscv/translate.c b/target/riscv/translate.c
> index deda0c8a44..5527f37ada 100644
> --- a/target/riscv/translate.c
> +++ b/target/riscv/translate.c
> @@ -973,7 +973,7 @@ static bool riscv_tr_breakpoint_check(DisasContextBase
> *dcbase, CPUState *cpu,
> [tb->pc, tb->pc + tb->size) in order to for it to be
> properly cleared -- thus we increment the PC here so that
> the logic setting tb->size below does the right thing. */
> - ctx->base.pc_next += 4;
> + ctx->base.pc_next += 2;
> return true;
> }
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
(What goes wrong if we just say "always use a TB size of 1 regardless
of target arch" rather than having the arch return the worst case
minimum insn length?)
thanks
-- PMM
- [PATCH v3 08/13] target/avr: Advance pc in avr_tr_breakpoint_check, (continued)
- [PATCH v3 08/13] target/avr: Advance pc in avr_tr_breakpoint_check, Richard Henderson, 2021/07/17
- [PATCH v3 12/13] accel/tcg: Hoist tb_cflags to a local in translator_loop, Richard Henderson, 2021/07/17
- [PATCH v3 03/13] accel/tcg: Add CF_NO_GOTO_TB and CF_NO_GOTO_PTR, Richard Henderson, 2021/07/17
- [PATCH v3 13/13] accel/tcg: Encode breakpoint info into tb->cflags, Richard Henderson, 2021/07/17
- [PATCH v3 11/13] accel/tcg: Adjust interface of TranslatorOps.breakpoint_check, Richard Henderson, 2021/07/17
- [PATCH v3 10/13] target/riscv: Reduce riscv_tr_breakpoint_check pc advance to 2, Richard Henderson, 2021/07/17
- Re: [PATCH v3 10/13] target/riscv: Reduce riscv_tr_breakpoint_check pc advance to 2,
Peter Maydell <=