]> www.infradead.org Git - users/dwmw2/qemu.git/commitdiff
target/i386: cleanup eob handling of RSM
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 16 May 2024 16:43:44 +0000 (18:43 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Sat, 25 May 2024 11:28:01 +0000 (13:28 +0200)
gen_helper_rsm cannot generate an exception, and reloads the flags.
So there's no need to spill cc_op and update cpu_eip, but on the
other hand cc_op must be reset to CC_OP_EFLAGS before returning.

It all works by chance, because by spilling cc_op before the call
to the helper, it becomes non-dirty and gen_eob will not overwrite
the CC_OP_EFLAGS value that is placed there by the helper.  But
let's clean it up.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
target/i386/tcg/translate.c

index 9782250b20b935b861c6d76b6fe27b5c2d0dd469..849864d1aa2d3f533694b41600c08d8915d2a6b2 100644 (file)
@@ -4488,9 +4488,8 @@ static void disas_insn_old(DisasContext *s, CPUState *cpu, int b)
         /* we should not be in SMM mode */
         g_assert_not_reached();
 #else
-        gen_update_cc_op(s);
-        gen_update_eip_next(s);
         gen_helper_rsm(tcg_env);
+        set_cc_op(s, CC_OP_EFLAGS);
 #endif /* CONFIG_USER_ONLY */
         s->base.is_jmp = DISAS_EOB_ONLY;
         break;