[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 12/37] target/i386: Introduce DISAS_EOB*
From: |
Paolo Bonzini |
Subject: |
[PULL 12/37] target/i386: Introduce DISAS_EOB* |
Date: |
Tue, 11 Oct 2022 12:26:35 +0200 |
From: Richard Henderson <richard.henderson@linaro.org>
Add a few DISAS_TARGET_* aliases to reduce the number of
calls to gen_eob() and gen_eob_inhibit_irq(). So far,
only update i386_tr_translate_insn for exiting the block
because of single-step or previous inhibit irq.
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20221001140935.465607-8-richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
target/i386/tcg/translate.c | 23 +++++++++++++++++++++--
1 file changed, 21 insertions(+), 2 deletions(-)
diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c
index 4c1548da8e..caa22af5a7 100644
--- a/target/i386/tcg/translate.c
+++ b/target/i386/tcg/translate.c
@@ -132,6 +132,10 @@ typedef struct DisasContext {
TCGOp *prev_insn_end;
} DisasContext;
+#define DISAS_EOB_ONLY DISAS_TARGET_0
+#define DISAS_EOB_NEXT DISAS_TARGET_1
+#define DISAS_EOB_INHIBIT_IRQ DISAS_TARGET_2
+
/* The environment in which user-only runs is constrained. */
#ifdef CONFIG_USER_ONLY
#define PE(S) true
@@ -8849,7 +8853,7 @@ static void i386_tr_translate_insn(DisasContextBase
*dcbase, CPUState *cpu)
* the flag and abort the translation to give the irqs a
* chance to happen.
*/
- dc->base.is_jmp = DISAS_TOO_MANY;
+ dc->base.is_jmp = DISAS_EOB_NEXT;
} else if (!is_same_page(&dc->base, pc_next)) {
dc->base.is_jmp = DISAS_TOO_MANY;
}
@@ -8861,9 +8865,24 @@ static void i386_tr_tb_stop(DisasContextBase *dcbase,
CPUState *cpu)
{
DisasContext *dc = container_of(dcbase, DisasContext, base);
- if (dc->base.is_jmp == DISAS_TOO_MANY) {
+ switch (dc->base.is_jmp) {
+ case DISAS_NORETURN:
+ break;
+ case DISAS_TOO_MANY:
+ case DISAS_EOB_NEXT:
+ gen_update_cc_op(dc);
gen_update_eip_cur(dc);
+ /* fall through */
+ case DISAS_EOB_ONLY:
gen_eob(dc);
+ break;
+ case DISAS_EOB_INHIBIT_IRQ:
+ gen_update_cc_op(dc);
+ gen_update_eip_cur(dc);
+ gen_eob_inhibit_irq(dc, true);
+ break;
+ default:
+ g_assert_not_reached();
}
}
--
2.37.3
- [PULL 03/37] kvm: allow target-specific accelerator properties, (continued)
- [PULL 03/37] kvm: allow target-specific accelerator properties, Paolo Bonzini, 2022/10/11
- [PULL 04/37] kvm: expose struct KVMState, Paolo Bonzini, 2022/10/11
- [PULL 05/37] i386: add notify VM exit support, Paolo Bonzini, 2022/10/11
- [PULL 10/37] target/i386: Create gen_update_eip_cur, Paolo Bonzini, 2022/10/11
- [PULL 06/37] target/i386: Remove pc_start, Paolo Bonzini, 2022/10/11
- [PULL 08/37] target/i386: Remove cur_eip argument to gen_exception, Paolo Bonzini, 2022/10/11
- [PULL 11/37] target/i386: Create gen_update_eip_next, Paolo Bonzini, 2022/10/11
- [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 <=
- [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, 2022/10/11
- [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