qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] fix cmpxchg8b translation
@ 2007-12-18 12:27 Bernhard Kauer
  0 siblings, 0 replies; only message in thread
From: Bernhard Kauer @ 2007-12-18 12:27 UTC (permalink / raw)
  To: qemu-devel

[-- 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)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-12-18 12:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-18 12:27 [Qemu-devel] [PATCH] fix cmpxchg8b translation Bernhard Kauer

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).