All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aurelien Jarno <aurelien@aurel32.net>
To: Richard Henderson <rth@twiddle.net>
Cc: qemu-devel@nongnu.org, 600589@bugs.launchpad.net
Subject: Re: [Qemu-devel] [PATCH] target-i386: Fix xchg rax,r8
Date: Thu, 1 Jul 2010 23:52:48 +0200	[thread overview]
Message-ID: <20100701215248.GD25251@ohm.aurel32.net> (raw)
In-Reply-To: <1278002541-16775-1-git-send-email-rth@twiddle.net>

On Thu, Jul 01, 2010 at 09:42:21AM -0700, Richard Henderson wrote:
> We were ignoring REX_B while special-casing NOP, i.e. xchg eax,eax.
> 
> Signed-off-by: Richard Henderson <rth@twiddle.net>
> ---
>  target-i386/translate.c |    9 +++++++--
>  1 files changed, 7 insertions(+), 2 deletions(-)

Applied, thanks.

> diff --git a/target-i386/translate.c b/target-i386/translate.c
> index 708b0a1..8cb5cf0 100644
> --- a/target-i386/translate.c
> +++ b/target-i386/translate.c
> @@ -5293,6 +5293,7 @@ static target_ulong disas_insn(DisasContext *s, target_ulong pc_start)
>          break;
>  
>      case 0x91 ... 0x97: /* xchg R, EAX */
> +    do_xchg_reg_eax:
>          ot = dflag + OT_WORD;
>          reg = (b & 7) | REX_B(s);
>          rm = R_EAX;
> @@ -6663,10 +6664,14 @@ static target_ulong disas_insn(DisasContext *s, target_ulong pc_start)
>          /************************/
>          /* misc */
>      case 0x90: /* nop */
> -        /* XXX: xchg + rex handling */
>          /* XXX: correct lock test for all insn */
> -        if (prefixes & PREFIX_LOCK)
> +        if (prefixes & PREFIX_LOCK) {
>              goto illegal_op;
> +        }
> +        /* If REX_B is set, then this is xchg eax, r8d, not a nop.  */
> +        if (REX_B(s)) {
> +            goto do_xchg_reg_eax;
> +        }
>          if (prefixes & PREFIX_REPZ) {
>              gen_svm_check_intercept(s, pc_start, SVM_EXIT_PAUSE);
>          }
> -- 
> 1.7.0.1
> 
> 
> 

-- 
Aurelien Jarno                          GPG: 1024D/F1BCDB73
aurelien@aurel32.net                 http://www.aurel32.net

  reply	other threads:[~2010-07-01 21:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-01 12:04 [Qemu-devel] [Bug 600589] [NEW] xchg r8,rax treated as nop Vic3Dexe
2010-07-01 16:17 ` Richard Henderson
2010-07-01 16:42   ` [Qemu-devel] [PATCH] target-i386: Fix xchg rax,r8 Richard Henderson
2010-07-01 21:52     ` Aurelien Jarno [this message]
2010-07-01 16:43   ` [Qemu-devel] [Bug 600589] [NEW] xchg r8,rax treated as nop malc
2010-07-02 19:13     ` vic3dexe
2010-07-02 20:08       ` Richard Henderson
2010-07-06 13:00 ` [Qemu-devel] [Bug 600589] " Jes Sorensen
2011-02-20 17:13 ` Aurelien Jarno

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=20100701215248.GD25251@ohm.aurel32.net \
    --to=aurelien@aurel32.net \
    --cc=600589@bugs.launchpad.net \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /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.