qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: Paolo Bonzini <pbonzini@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [PATCH 02/11] target/i386: fix implementation of ICEBP
Date: Tue, 4 Jun 2024 08:50:23 -0500	[thread overview]
Message-ID: <491c8af0-dc2c-4ae3-8624-f594e3a372b8@linaro.org> (raw)
In-Reply-To: <20240604071833.962574-3-pbonzini@redhat.com>

On 6/4/24 02:18, Paolo Bonzini wrote:
> ICEBP generates a trap-like exception, while gen_exception() produces
> a fault.  Resurrect gen_update_eip_next() to implement the desired
> semantics.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>   target/i386/helper.h          |  1 +
>   target/i386/tcg/helper-tcg.h  |  3 +++
>   target/i386/tcg/bpt_helper.c  |  6 ++++++
>   target/i386/tcg/excp_helper.c | 20 ++++++++++++++++++++
>   target/i386/tcg/translate.c   | 13 +++++++++++++
>   target/i386/tcg/emit.c.inc    |  5 ++++-
>   6 files changed, 47 insertions(+), 1 deletion(-)
> 
> diff --git a/target/i386/helper.h b/target/i386/helper.h
> index a52a1bf0f21..8f291a5f66f 100644
> --- a/target/i386/helper.h
> +++ b/target/i386/helper.h
> @@ -56,6 +56,7 @@ DEF_HELPER_2(sysret, void, env, int)
>   DEF_HELPER_FLAGS_2(pause, TCG_CALL_NO_WG, noreturn, env, int)
>   DEF_HELPER_FLAGS_3(raise_interrupt, TCG_CALL_NO_WG, noreturn, env, int, int)
>   DEF_HELPER_FLAGS_2(raise_exception, TCG_CALL_NO_WG, noreturn, env, int)
> +DEF_HELPER_FLAGS_1(icebp, TCG_CALL_NO_WG, noreturn, env)
>   DEF_HELPER_3(boundw, void, env, tl, int)
>   DEF_HELPER_3(boundl, void, env, tl, int)
>   
> diff --git a/target/i386/tcg/helper-tcg.h b/target/i386/tcg/helper-tcg.h
> index effc2c1c984..6a5505e7b4c 100644
> --- a/target/i386/tcg/helper-tcg.h
> +++ b/target/i386/tcg/helper-tcg.h
> @@ -112,6 +112,9 @@ int exception_has_error_code(int intno);
>   void do_smm_enter(X86CPU *cpu);
>   
>   /* bpt_helper.c */
> +void do_end_instruction(CPUX86State *env);
> +
> +/* sysemu/bpt_helper.c */
>   bool check_hw_breakpoints(CPUX86State *env, bool force_dr6_update);
>   
>   #endif /* I386_HELPER_TCG_H */
> diff --git a/target/i386/tcg/bpt_helper.c b/target/i386/tcg/bpt_helper.c
> index bc34ac27fea..9695b9dd041 100644
> --- a/target/i386/tcg/bpt_helper.c
> +++ b/target/i386/tcg/bpt_helper.c
> @@ -37,3 +37,9 @@ void helper_rechecking_single_step(CPUX86State *env)
>           helper_single_step(env);
>       }
>   }
> +
> +void do_end_instruction(CPUX86State *env)
> +{
> +    env->hflags &= ~HF_INHIBIT_IRQ_MASK; /* needed if sti is just before */
> +    env->eflags &= ~HF_RF_MASK;
> +}

Two and insns.  Perhaps place as static inline in helper-tcg.h?

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


r~


  reply	other threads:[~2024-06-04 13:50 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-04  7:18 [PATCH 00/11] target/i386: fixes for INHIBIT_IRQ, TF and RF Paolo Bonzini
2024-06-04  7:18 ` [PATCH 01/11] target/i386: fix pushed value of EFLAGS.RF Paolo Bonzini
2024-06-04 10:51   ` Richard Henderson
2024-06-04  7:18 ` [PATCH 02/11] target/i386: fix implementation of ICEBP Paolo Bonzini
2024-06-04 13:50   ` Richard Henderson [this message]
2024-06-04  7:18 ` [PATCH 03/11] target/i386: cleanup HLT helpers Paolo Bonzini
2024-06-04 10:54   ` Richard Henderson
2024-06-04  7:18 ` [PATCH 04/11] target/i386: cleanup PAUSE helpers Paolo Bonzini
2024-06-04 10:59   ` Richard Henderson
2024-06-04 14:08     ` Paolo Bonzini
2024-06-04  7:18 ` [PATCH 05/11] target/i386: implement DR7.GD Paolo Bonzini
2024-06-04 13:22   ` Richard Henderson
2024-06-04  7:18 ` [PATCH 06/11] target/i386: disable/enable breakpoints on vmentry/vmexit Paolo Bonzini
2024-06-04 13:24   ` Richard Henderson
2024-06-04  7:18 ` [PATCH 07/11] target/i386: fix INHIBIT_IRQ/TF/RF handling for VMRUN Paolo Bonzini
2024-06-04 13:28   ` Richard Henderson
2024-06-04  7:18 ` [PATCH 08/11] target/i386: fix INHIBIT_IRQ/TF/RF handling for PAUSE Paolo Bonzini
2024-06-04 13:44   ` Richard Henderson
2024-06-04 13:49     ` Richard Henderson
2024-06-04 14:10       ` Paolo Bonzini
2024-06-04 14:14         ` Richard Henderson
2024-06-04  7:18 ` [PATCH 09/11] target/i386: fix TF/RF handling for HLT Paolo Bonzini
2024-06-04 13:46   ` Richard Henderson
2024-06-04  7:18 ` [PATCH 10/11] target/i386: document incorrect semantics of watchpoint following MOV/POP SS Paolo Bonzini
2024-06-04 13:57   ` Richard Henderson
2024-06-04  7:18 ` [PATCH 11/11] target/i386: document use of DISAS_NORETURN Paolo Bonzini
2024-06-04 13:58   ` Richard Henderson

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=491c8af0-dc2c-4ae3-8624-f594e3a372b8@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.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).