From: Paolo Bonzini <pbonzini@redhat.com>
To: Richard Henderson <richard.henderson@linaro.org>
Cc: qemu-devel@nongnu.org
Subject: Re: [PATCH v2 07/23] target/i386: Introduce DISAS_EOB*
Date: Wed, 21 Sep 2022 14:05:57 +0200 [thread overview]
Message-ID: <CABgObfbNQgCnJ4b+auXOA-Dv52XOK6JO7Ex6YEACm85hzvLK5Q@mail.gmail.com> (raw)
In-Reply-To: <20220906100932.343523-8-richard.henderson@linaro.org>
On Tue, Sep 6, 2022 at 12:09 PM Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> 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.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-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 6084c85609..778ee4ed4c 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
> @@ -8814,7 +8818,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;
> }
> @@ -8826,9 +8830,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.34.1
>
next prev parent reply other threads:[~2022-09-21 12:45 UTC|newest]
Thread overview: 61+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-06 10:09 [PATCH v2 00/23] target/i386: pc-relative translation blocks Richard Henderson
2022-09-06 10:09 ` [PATCH v2 01/23] target/i386: Remove pc_start Richard Henderson
2022-09-21 11:49 ` Paolo Bonzini
2022-09-06 10:09 ` [PATCH v2 02/23] target/i386: Return bool from disas_insn Richard Henderson
2022-09-06 14:42 ` Philippe Mathieu-Daudé via
2022-09-08 12:14 ` Richard Henderson
2022-09-21 17:51 ` Philippe Mathieu-Daudé via
2022-09-06 10:09 ` [PATCH v2 03/23] target/i386: Remove cur_eip argument to gen_exception Richard Henderson
2022-09-06 14:44 ` Philippe Mathieu-Daudé via
2022-09-21 11:51 ` Paolo Bonzini
2022-09-06 10:09 ` [PATCH v2 04/23] target/i386: Remove cur_eip, next_eip arguments to gen_interrupt Richard Henderson
2022-09-06 14:46 ` Philippe Mathieu-Daudé via
2022-09-21 11:51 ` Paolo Bonzini
2022-09-06 10:09 ` [PATCH v2 05/23] target/i386: Create gen_update_eip_cur Richard Henderson
2022-09-21 11:58 ` Paolo Bonzini
2022-09-06 10:09 ` [PATCH v2 06/23] target/i386: Create gen_update_eip_next Richard Henderson
2022-09-21 12:04 ` Paolo Bonzini
2022-09-06 10:09 ` [PATCH v2 07/23] target/i386: Introduce DISAS_EOB* Richard Henderson
2022-09-21 12:05 ` Paolo Bonzini [this message]
2022-09-06 10:09 ` [PATCH v2 08/23] target/i386: Use DISAS_EOB* in gen_movl_seg_T0 Richard Henderson
2022-09-21 12:09 ` Paolo Bonzini
2022-09-06 10:09 ` [PATCH v2 09/23] target/i386: Use DISAS_EOB_NEXT Richard Henderson
2022-09-21 12:25 ` Paolo Bonzini
2022-09-06 10:09 ` [PATCH v2 10/23] target/i386: USe DISAS_EOB_ONLY Richard Henderson
2022-09-21 12:10 ` Paolo Bonzini
2022-09-06 10:09 ` [PATCH v2 11/23] target/i386: Create cur_insn_len, cur_insn_len_i32 Richard Henderson
2022-09-06 14:49 ` Philippe Mathieu-Daudé via
2022-09-21 12:25 ` Paolo Bonzini
2022-09-06 10:09 ` [PATCH v2 12/23] target/i386: Remove cur_eip, next_eip arguments to gen_repz* Richard Henderson
2022-09-21 12:26 ` Paolo Bonzini
2022-09-06 10:09 ` [PATCH v2 13/23] target/i386: Introduce DISAS_JUMP Richard Henderson
2022-09-21 12:28 ` Paolo Bonzini
2022-09-21 23:27 ` Richard Henderson
2022-09-06 10:09 ` [PATCH v2 14/23] target/i386: Truncate values for lcall_real to i32 Richard Henderson
2022-09-21 12:29 ` Paolo Bonzini
2022-09-06 10:09 ` [PATCH v2 15/23] target/i386: Create eip_next_* Richard Henderson
2022-09-21 12:34 ` Paolo Bonzini
2022-09-06 10:09 ` [PATCH v2 16/23] target/i386: Use DISAS_TOO_MANY to exit after gen_io_start Richard Henderson
2022-09-21 12:38 ` Paolo Bonzini
2022-09-06 10:09 ` [PATCH v2 17/23] target/i386: Create gen_jmp_rel Richard Henderson
2022-09-21 13:06 ` Paolo Bonzini
2022-10-01 0:53 ` Richard Henderson
2022-10-01 6:54 ` Paolo Bonzini
2022-09-06 10:09 ` [PATCH v2 18/23] target/i386: Use gen_jmp_rel for loop and jecxz insns Richard Henderson
2022-09-21 13:06 ` Paolo Bonzini
2022-09-06 10:09 ` [PATCH v2 19/23] target/i386: Use gen_jmp_rel for gen_jcc Richard Henderson
2022-09-21 13:09 ` Paolo Bonzini
2022-10-01 1:04 ` Richard Henderson
2022-10-01 7:03 ` Paolo Bonzini
2022-10-01 13:58 ` Richard Henderson
2022-09-06 10:09 ` [PATCH v2 20/23] target/i386: Use gen_jmp_rel for gen_repz* Richard Henderson
2022-09-21 13:10 ` Paolo Bonzini
2022-09-06 10:09 ` [PATCH v2 21/23] target/i386: Use gen_jmp_rel for DISAS_TOO_MANY Richard Henderson
2022-09-21 13:11 ` Paolo Bonzini
2022-09-06 10:09 ` [PATCH v2 22/23] target/i386: Create gen_eip_cur Richard Henderson
2022-09-06 14:50 ` Philippe Mathieu-Daudé via
2022-09-21 13:12 ` Paolo Bonzini
2022-09-06 10:09 ` [PATCH v2 23/23] target/i386: Enable TARGET_TB_PCREL Richard Henderson
2022-09-21 13:31 ` Paolo Bonzini
2022-10-01 1:51 ` Richard Henderson
2022-09-21 13:32 ` [PATCH v2 00/23] target/i386: pc-relative translation blocks Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CABgObfbNQgCnJ4b+auXOA-Dv52XOK6JO7Ex6YEACm85hzvLK5Q@mail.gmail.com \
--to=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).