All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] x86: Fix eflags tracking for syscall insn
@ 2016-12-06 17:13 Doug Evans
  2016-12-06 19:43 ` Richard Henderson
  0 siblings, 1 reply; 3+ messages in thread
From: Doug Evans @ 2016-12-06 17:13 UTC (permalink / raw)
  To: qemu-devel, pbonzini

Hi.

While researching an issue related to the syscall insn it seemed
like eflags status tracking was missing this step.

I think(!) this is correct, it follows what similar code does elsewhere,
and what the doc says. If it's not correct IWBN to clarify the situation.

commit 393243eda30d4429a07a0f7c29b0f6297616a355
Author: Doug Evans <dje@google.com>
Date:   Tue Dec 6 09:00:42 2016 -0800

     syscall insn: update eflags to CC_OP_EFLAGS

     Signed-off-by: Doug Evans <dje@google.com>

diff --git a/target-i386/translate.c b/target-i386/translate.c
index 324103c..9fd1a04 100644
--- a/target-i386/translate.c
+++ b/target-i386/translate.c
@@ -7104,6 +7104,10 @@ static target_ulong disas_insn(CPUX86State *env,  
DisasContext *s,
          gen_update_cc_op(s);
          gen_jmp_im(pc_start - s->cs_base);
          gen_helper_syscall(cpu_env, tcg_const_i32(s->pc - pc_start));
+        /* condition codes are modified only in long mode */
+        if (s->lma) {
+            set_cc_op(s, CC_OP_EFLAGS);
+        }
          gen_eob(s);
          break;
      case 0x107: /* sysret */

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-12-06 22:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-06 17:13 [Qemu-devel] [PATCH] x86: Fix eflags tracking for syscall insn Doug Evans
2016-12-06 19:43 ` Richard Henderson
2016-12-06 22:36   ` Doug Evans

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.