From: Jakub Jermar <jakub@jermar.eu>
To: qemu-devel@nongnu.org
Subject: [PATCH]Re: [Qemu-devel] [AMD64] Possible problem with the DF flag during the SYSCALL instruction
Date: Thu, 20 Mar 2008 22:46:10 +0100 [thread overview]
Message-ID: <47E2DB22.4020406@jermar.eu> (raw)
In-Reply-To: <47E23FF2.8060505@jermar.eu>
[-- Attachment #1: Type: text/plain, Size: 798 bytes --]
Jakub Jermar wrote:
> yesterday I tried to mask off the DF flag from the RFLAGS register
> during the SYSCALL instruction by specifying this bit in the SFMASK MSR
> register while running HelenOS.
>
> With QEMU, this didn't work (but it worked in Simics, for instance), so
> I suspect that there is something wrong with handling RFLAGS.DF during
> SYSCALL. Anyone wants to have a look?
I have looked into the problem a little more and found out that the
culprit here is probably a missing update of the DF variable in the
helper_syscall() function, in target-i386/helper.c. See the attached
patch.
The patch fixes the problem for me, but is probably not complete (i.e.
there might be other places that need a similar treatment), but I can't
really tell since I am not a qemu expert.
Jakub
[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 382 bytes --]
--- helper.c 2008-01-06 20:38:45.000000000 +0100
+++ helper.c.new 2008-03-20 22:39:17.000000000 +0100
@@ -1008,6 +1008,7 @@
DESC_S_MASK |
DESC_W_MASK | DESC_A_MASK);
env->eflags &= ~env->fmask;
+ DF = 1 - (2 * ((env->eflags >> 10) & 1));
if (code64)
env->eip = env->lstar;
else
prev parent reply other threads:[~2008-03-20 21:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-20 10:44 [Qemu-devel] [AMD64] Possible problem with the DF flag during the SYSCALL instruction Jakub Jermar
2008-03-20 21:46 ` Jakub Jermar [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=47E2DB22.4020406@jermar.eu \
--to=jakub@jermar.eu \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.