diff mbox series

[06/16] target/i386: assert that gen_update_eip_cur and gen_update_eip_next are the same in tb_stop

Message ID 20240524081019.1141359-7-pbonzini@redhat.com (mailing list archive)
State New, archived
Headers show
Series target/i386/tcg: translation cleanups | expand

Commit Message

Paolo Bonzini May 24, 2024, 8:10 a.m. UTC
This is an invariant, since these cases of tb_stop() should only
be reached through the "instruction decoding completed" path of
i386_tr_translate_insn().

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 target/i386/tcg/translate.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Richard Henderson May 24, 2024, 2:30 p.m. UTC | #1
On 5/24/24 01:10, Paolo Bonzini wrote:
> This is an invariant, since these cases of tb_stop() should only
> be reached through the "instruction decoding completed" path of
> i386_tr_translate_insn().
> 
> Signed-off-by: Paolo Bonzini<pbonzini@redhat.com>
> ---
>   target/i386/tcg/translate.c | 2 ++
>   1 file changed, 2 insertions(+)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~
diff mbox series

Patch

diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c
index 5dae890d2b6..2c7917d239f 100644
--- a/target/i386/tcg/translate.c
+++ b/target/i386/tcg/translate.c
@@ -4787,6 +4787,7 @@  static void i386_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu)
         gen_jmp_rel_csize(dc, 0, 0);
         break;
     case DISAS_EOB_NEXT:
+        assert(dc->base.pc_next == dc->pc);
         gen_update_eip_cur(dc);
         /* fall through */
     case DISAS_EOB_ONLY:
@@ -4796,6 +4797,7 @@  static void i386_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu)
         gen_eob_syscall(dc);
         break;
     case DISAS_EOB_INHIBIT_IRQ:
+        assert(dc->base.pc_next == dc->pc);
         gen_update_eip_cur(dc);
         gen_eob_inhibit_irq(dc);
         break;