qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] x86: Fix eflags tracking for syscall insn


From: Doug Evans
Subject: [Qemu-devel] [PATCH] x86: Fix eflags tracking for syscall insn
Date: Tue, 06 Dec 2016 17:13:39 +0000

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 <address@hidden>
Date:   Tue Dec 6 09:00:42 2016 -0800

    syscall insn: update eflags to CC_OP_EFLAGS

    Signed-off-by: Doug Evans <address@hidden>

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 */



reply via email to

[Prev in Thread] Current Thread [Next in Thread]