[PATCH] target/i386: disable jmp_opt if EFLAGS.RF is 1

Paolo Bonzini posted 1 patch 6 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20240524153323.1267511-1-pbonzini@redhat.com
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, Richard Henderson <richard.henderson@linaro.org>, Eduardo Habkost <eduardo@habkost.net>
target/i386/tcg/translate.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] target/i386: disable jmp_opt if EFLAGS.RF is 1
Posted by Paolo Bonzini 6 months ago
If EFLAGS.RF is 1, special processing in gen_eob_worker() is needed and
therefore goto_tb cannot be used.

Suggested-by: Richard Henderson <richard.henderson@linaro.org>
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 target/i386/tcg/translate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c
index 76be7425800..ebcff8766cf 100644
--- a/target/i386/tcg/translate.c
+++ b/target/i386/tcg/translate.c
@@ -4660,7 +4660,7 @@ static void i386_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cpu)
     dc->cpuid_7_1_eax_features = env->features[FEAT_7_1_EAX];
     dc->cpuid_xsave_features = env->features[FEAT_XSAVE];
     dc->jmp_opt = !((cflags & CF_NO_GOTO_TB) ||
-                    (flags & (HF_TF_MASK | HF_INHIBIT_IRQ_MASK)));
+                    (flags & (HF_RF_MASK | HF_TF_MASK | HF_INHIBIT_IRQ_MASK)));
     /*
      * If jmp_opt, we want to handle each string instruction individually.
      * For icount also disable repz optimization so that each iteration
-- 
2.45.1
Re: [PATCH] target/i386: disable jmp_opt if EFLAGS.RF is 1
Posted by Richard Henderson 6 months ago
On 5/24/24 08:33, Paolo Bonzini wrote:
> If EFLAGS.RF is 1, special processing in gen_eob_worker() is needed and
> therefore goto_tb cannot be used.
> 
> Suggested-by: Richard Henderson <richard.henderson@linaro.org>
> Cc: qemu-stable@nongnu.org
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>   target/i386/tcg/translate.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c
> index 76be7425800..ebcff8766cf 100644
> --- a/target/i386/tcg/translate.c
> +++ b/target/i386/tcg/translate.c
> @@ -4660,7 +4660,7 @@ static void i386_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cpu)
>       dc->cpuid_7_1_eax_features = env->features[FEAT_7_1_EAX];
>       dc->cpuid_xsave_features = env->features[FEAT_XSAVE];
>       dc->jmp_opt = !((cflags & CF_NO_GOTO_TB) ||
> -                    (flags & (HF_TF_MASK | HF_INHIBIT_IRQ_MASK)));
> +                    (flags & (HF_RF_MASK | HF_TF_MASK | HF_INHIBIT_IRQ_MASK)));
>       /*
>        * If jmp_opt, we want to handle each string instruction individually.
>        * For icount also disable repz optimization so that each iteration

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


r~