diff options
author | Avi Kivity <avi@redhat.com> | 2010-07-26 07:37:47 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2010-10-24 04:49:57 -0400 |
commit | 047a4818094217a1323d8f31f9318ea2e142f745 (patch) | |
tree | 44cbc69d683d12f3ae82ca97007d794b2ef844b4 | |
parent | 2ce495365f6cdd5792c4db0ddb8ac8544950b671 (diff) |
KVM: x86 emulator: add Undefined decode flag
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>
-rw-r--r-- | arch/x86/kvm/emulate.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 61139e20b899..b1e3e8c2aff5 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c | |||
@@ -84,6 +84,7 @@ | |||
84 | #define GroupDual (1<<15) /* Alternate decoding of mod == 3 */ | 84 | #define GroupDual (1<<15) /* Alternate decoding of mod == 3 */ |
85 | #define GroupMask 0x0f /* Group number stored in bits 0:3 */ | 85 | #define GroupMask 0x0f /* Group number stored in bits 0:3 */ |
86 | /* Misc flags */ | 86 | /* Misc flags */ |
87 | #define Undefined (1<<25) /* No Such Instruction */ | ||
87 | #define Lock (1<<26) /* lock prefix is allowed for the instruction */ | 88 | #define Lock (1<<26) /* lock prefix is allowed for the instruction */ |
88 | #define Priv (1<<27) /* instruction generates #GP if current CPL != 0 */ | 89 | #define Priv (1<<27) /* instruction generates #GP if current CPL != 0 */ |
89 | #define No64 (1<<28) | 90 | #define No64 (1<<28) |
@@ -1065,7 +1066,7 @@ done_prefixes: | |||
1065 | } | 1066 | } |
1066 | 1067 | ||
1067 | /* Unrecognised? */ | 1068 | /* Unrecognised? */ |
1068 | if (c->d == 0) { | 1069 | if (c->d == 0 || (c->d & Undefined)) { |
1069 | DPRINTF("Cannot emulate %02x\n", c->b); | 1070 | DPRINTF("Cannot emulate %02x\n", c->b); |
1070 | return -1; | 1071 | return -1; |
1071 | } | 1072 | } |