All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Jermar <jakub@jermar.eu>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] Bug in AMD64 emulation Was: [AMD64] Possible problem with the DF flag during the SYSCALL instruction
Date: Thu, 27 Mar 2008 12:38:46 +0100	[thread overview]
Message-ID: <47EB8746.9070802@jermar.eu> (raw)
In-Reply-To: <422A6204-1716-4ACF-B725-67159D165825@csgraf.de>

[-- Attachment #1: Type: text/plain, Size: 901 bytes --]

Alexander Graf wrote:
> Hi,
> 
> 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 
> (helper.c:helper_vmrun).

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?

Thanks,
Jakub


[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 497 bytes --]

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_S_MASK |
                                DESC_W_MASK | DESC_A_MASK);
         env->eflags &= ~env->fmask;
+        load_eflags(env->eflags, 0);
         if (code64)
             env->eip = env->lstar;
         else

      reply	other threads:[~2008-03-27 11:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-25 19:45 [Qemu-devel] [PATCH] Bug in AMD64 emulation Was: [AMD64] Possible problem with the DF flag during the SYSCALL instruction Jakub Jermar
2008-03-25 20:26 ` Alexander Graf
2008-03-27 11:38   ` 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=47EB8746.9070802@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.