[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 13/37] target/i386: Use DISAS_EOB* in gen_movl_seg_T0
From: |
Paolo Bonzini |
Subject: |
[PULL 13/37] target/i386: Use DISAS_EOB* in gen_movl_seg_T0 |
Date: |
Tue, 11 Oct 2022 12:26:36 +0200 |
From: Richard Henderson <richard.henderson@linaro.org>
Set is_jmp properly in gen_movl_seg_T0, so that the callers
need to nothing special.
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20221001140935.465607-9-richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
target/i386/tcg/translate.c | 36 +++++-------------------------------
1 file changed, 5 insertions(+), 31 deletions(-)
diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c
index caa22af5a7..8c0ef0f212 100644
--- a/target/i386/tcg/translate.c
+++ b/target/i386/tcg/translate.c
@@ -2457,13 +2457,15 @@ static void gen_movl_seg_T0(DisasContext *s, X86Seg
seg_reg)
because ss32 may change. For R_SS, translation must always
stop as a special handling must be done to disable hardware
interrupts for the next instruction */
- if (seg_reg == R_SS || (CODE32(s) && seg_reg < R_FS)) {
- s->base.is_jmp = DISAS_TOO_MANY;
+ if (seg_reg == R_SS) {
+ s->base.is_jmp = DISAS_EOB_INHIBIT_IRQ;
+ } else if (CODE32(s) && seg_reg < R_FS) {
+ s->base.is_jmp = DISAS_EOB_NEXT;
}
} else {
gen_op_movl_seg_T0_vm(s, seg_reg);
if (seg_reg == R_SS) {
- s->base.is_jmp = DISAS_TOO_MANY;
+ s->base.is_jmp = DISAS_EOB_INHIBIT_IRQ;
}
}
}
@@ -5726,26 +5728,12 @@ static bool disas_insn(DisasContext *s, CPUState *cpu)
ot = gen_pop_T0(s);
gen_movl_seg_T0(s, reg);
gen_pop_update(s, ot);
- /* Note that reg == R_SS in gen_movl_seg_T0 always sets is_jmp. */
- if (s->base.is_jmp) {
- gen_update_eip_next(s);
- if (reg == R_SS) {
- s->flags &= ~HF_TF_MASK;
- gen_eob_inhibit_irq(s, true);
- } else {
- gen_eob(s);
- }
- }
break;
case 0x1a1: /* pop fs */
case 0x1a9: /* pop gs */
ot = gen_pop_T0(s);
gen_movl_seg_T0(s, (b >> 3) & 7);
gen_pop_update(s, ot);
- if (s->base.is_jmp) {
- gen_update_eip_next(s);
- gen_eob(s);
- }
break;
/**************************/
@@ -5792,16 +5780,6 @@ static bool disas_insn(DisasContext *s, CPUState *cpu)
goto illegal_op;
gen_ldst_modrm(env, s, modrm, MO_16, OR_TMP0, 0);
gen_movl_seg_T0(s, reg);
- /* Note that reg == R_SS in gen_movl_seg_T0 always sets is_jmp. */
- if (s->base.is_jmp) {
- gen_update_eip_next(s);
- if (reg == R_SS) {
- s->flags &= ~HF_TF_MASK;
- gen_eob_inhibit_irq(s, true);
- } else {
- gen_eob(s);
- }
- }
break;
case 0x8c: /* mov Gv, seg */
modrm = x86_ldub_code(env, s);
@@ -5991,10 +5969,6 @@ static bool disas_insn(DisasContext *s, CPUState *cpu)
gen_movl_seg_T0(s, op);
/* then put the data */
gen_op_mov_reg_v(s, ot, reg, s->T1);
- if (s->base.is_jmp) {
- gen_update_eip_next(s);
- gen_eob(s);
- }
break;
/************************/
--
2.37.3
- [PULL 09/37] target/i386: Remove cur_eip, next_eip arguments to gen_interrupt, (continued)
- [PULL 09/37] target/i386: Remove cur_eip, next_eip arguments to gen_interrupt, Paolo Bonzini, 2022/10/11
- [PULL 14/37] target/i386: Use DISAS_EOB_NEXT, Paolo Bonzini, 2022/10/11
- [PULL 15/37] target/i386: USe DISAS_EOB_ONLY, Paolo Bonzini, 2022/10/11
- [PULL 12/37] target/i386: Introduce DISAS_EOB*, Paolo Bonzini, 2022/10/11
- [PULL 17/37] target/i386: Remove cur_eip, next_eip arguments to gen_repz*, Paolo Bonzini, 2022/10/11
- [PULL 19/37] target/i386: Truncate values for lcall_real to i32, Paolo Bonzini, 2022/10/11
- [PULL 07/37] target/i386: Return bool from disas_insn, Paolo Bonzini, 2022/10/11
- [PULL 18/37] target/i386: Introduce DISAS_JUMP, Paolo Bonzini, 2022/10/11
- [PULL 16/37] target/i386: Create cur_insn_len, cur_insn_len_i32, Paolo Bonzini, 2022/10/11
- [PULL 20/37] target/i386: Create eip_next_*, Paolo Bonzini, 2022/10/11
- [PULL 13/37] target/i386: Use DISAS_EOB* in gen_movl_seg_T0,
Paolo Bonzini <=
- [PULL 21/37] target/i386: Use DISAS_TOO_MANY to exit after gen_io_start, Paolo Bonzini, 2022/10/11
- [PULL 22/37] target/i386: Create gen_jmp_rel, Paolo Bonzini, 2022/10/11
- [PULL 23/37] target/i386: Use gen_jmp_rel for loop, repz, jecxz insns, Paolo Bonzini, 2022/10/11
- [PULL 24/37] target/i386: Use gen_jmp_rel for gen_jcc, Paolo Bonzini, 2022/10/11
- [PULL 25/37] target/i386: Use gen_jmp_rel for DISAS_TOO_MANY, Paolo Bonzini, 2022/10/11
- [PULL 27/37] target/i386: Merge gen_jmp_tb and gen_goto_tb into gen_jmp_rel, Paolo Bonzini, 2022/10/11
- [PULL 29/37] target/i386: Add cpu_eip, Paolo Bonzini, 2022/10/11
- [PULL 26/37] target/i386: Remove MemOp argument to gen_op_j*_ecx, Paolo Bonzini, 2022/10/11
- [PULL 30/37] target/i386: Inline gen_jmp_im, Paolo Bonzini, 2022/10/11
- [PULL 28/37] target/i386: Create eip_cur_tl, Paolo Bonzini, 2022/10/11