]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
KVM: x86 emulator: add Undefined decode flag
authorAvi Kivity <avi@redhat.com>
Mon, 26 Jul 2010 11:37:47 +0000 (14:37 +0300)
committerAvi Kivity <avi@redhat.com>
Sun, 24 Oct 2010 08:49:57 +0000 (10:49 +0200)
Add a decode flag to indicate the instruction is invalid.  Will come in useful
later, when we mix decode bits from the opcode and group table.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
arch/x86/kvm/emulate.c

index 61139e20b899f6e8be751543f74d9d5273728fde..b1e3e8c2aff5b21f7013056c0bc112f988019596 100644 (file)
@@ -84,6 +84,7 @@
 #define GroupDual   (1<<15)     /* Alternate decoding of mod == 3 */
 #define GroupMask   0x0f        /* Group number stored in bits 0:3 */
 /* Misc flags */
+#define Undefined   (1<<25) /* No Such Instruction */
 #define Lock        (1<<26) /* lock prefix is allowed for the instruction */
 #define Priv        (1<<27) /* instruction generates #GP if current CPL != 0 */
 #define No64       (1<<28)
@@ -1065,7 +1066,7 @@ done_prefixes:
        }
 
        /* Unrecognised? */
-       if (c->d == 0) {
+       if (c->d == 0 || (c->d & Undefined)) {
                DPRINTF("Cannot emulate %02x\n", c->b);
                return -1;
        }