[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] Bug in AMD64 emulation Was: [AMD64] Possible pr
Re: [Qemu-devel] [PATCH] Bug in AMD64 emulation Was: [AMD64] Possible problem with the DF flag during the SYSCALL instruction
Thu, 27 Mar 2008 12:38:46 +0100
Thunderbird 18.104.22.168 (X11/20080227)
Alexander Graf wrote:
On Mar 25, 2008, at 8:45 PM, Jakub Jermar wrote:
as no one has picked my previous report up yet, I am resending my
patch again. The patch fixes a bug in the way QEMU emulates AMD64
instruction called SYSCALL. The problem appears to be stale DF variable.
Sorry I didn't have a look at it before. Good catch though!
I believe you're searching for load_eflags(), which automatically
updates the DF flag. Take a look at the SVM code for that issue as well
The included patch updates the DF flag in helper_syscall() using the
load_eflags(). I thought of doing this as simply as possible and here's
probably the result. When the first parameter of load_eflags() has
the same value as env->eflags, the second argument doesn't matter,
that's why it is 0.
Will you consider this for applying?
diff -ru qemu-0.9.1/target-i386/helper.c qemu-0.9.1-jj/target-i386/helper.c
--- qemu-0.9.1/target-i386/helper.c 2008-01-06 20:38:45.000000000 +0100
+++ qemu-0.9.1-jj/target-i386/helper.c 2008-03-27 12:27:37.000000000 +0100
@@ -1008,6 +1008,7 @@
DESC_W_MASK | DESC_A_MASK);
env->eflags &= ~env->fmask;
+ load_eflags(env->eflags, 0);
env->eip = env->lstar;