qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Bernhard Kauer <kauer@os.inf.tu-dresden.de>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] fix cmpxchg8b translation
Date: Tue, 18 Dec 2007 13:27:20 +0100	[thread overview]
Message-ID: <20071218122720.GA3301@chrom.inf.tu-dresden.de> (raw)

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

The cmpxchg8b opcode is only valid if the nnn bits
in the mod/rm byte are 001, otherwise an #UD should
be generated. The attached patch fixes this.


	Bernhard Kauer

[-- Attachment #2: qemu_vmptrld.diff --]
[-- Type: text/x-diff, Size: 459 bytes --]

Index: target-i386/translate.c
--- target-i386/translate.c	8 Nov 2007 14:25:03 -0000	1.74
+++ target-i386/translate.c	18 Dec 2007 12:14:08 -0000
@@ -3887,7 +3887,7 @@
     case 0x1c7: /* cmpxchg8b */
         modrm = ldub_code(s->pc++);
         mod = (modrm >> 6) & 3;
-        if (mod == 3)
+        if ((mod == 3) || ((modrm & 0x38) != 0x8))
             goto illegal_op;
         gen_jmp_im(pc_start - s->cs_base);
         if (s->cc_op != CC_OP_DYNAMIC)

                 reply	other threads:[~2007-12-18 12:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20071218122720.GA3301@chrom.inf.tu-dresden.de \
    --to=kauer@os.inf.tu-dresden.de \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).