KVM: x86 emulator: drop support for old-style groups
Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
This commit is contained in:
@@ -82,7 +82,6 @@
|
|||||||
#define Stack (1<<13) /* Stack instruction (push/pop) */
|
#define Stack (1<<13) /* Stack instruction (push/pop) */
|
||||||
#define Group (1<<14) /* Bits 3:5 of modrm byte extend opcode */
|
#define Group (1<<14) /* Bits 3:5 of modrm byte extend opcode */
|
||||||
#define GroupDual (1<<15) /* Alternate decoding of mod == 3 */
|
#define GroupDual (1<<15) /* Alternate decoding of mod == 3 */
|
||||||
#define GroupMask 0x0f /* Group number stored in bits 0:3 */
|
|
||||||
/* Misc flags */
|
/* Misc flags */
|
||||||
#define Undefined (1<<25) /* No Such Instruction */
|
#define Undefined (1<<25) /* No Such Instruction */
|
||||||
#define Lock (1<<26) /* lock prefix is allowed for the instruction */
|
#define Lock (1<<26) /* lock prefix is allowed for the instruction */
|
||||||
@@ -104,10 +103,6 @@
|
|||||||
#define X8(x) X4(x), X4(x)
|
#define X8(x) X4(x), X4(x)
|
||||||
#define X16(x) X8(x), X8(x)
|
#define X16(x) X8(x), X8(x)
|
||||||
|
|
||||||
enum {
|
|
||||||
NoGrp,
|
|
||||||
};
|
|
||||||
|
|
||||||
struct opcode {
|
struct opcode {
|
||||||
u32 flags;
|
u32 flags;
|
||||||
union {
|
union {
|
||||||
@@ -174,12 +169,6 @@ static struct group_dual group9 = { {
|
|||||||
N, N, N, N, N, N, N, N,
|
N, N, N, N, N, N, N, N,
|
||||||
} };
|
} };
|
||||||
|
|
||||||
static struct opcode group_table[] = {
|
|
||||||
};
|
|
||||||
|
|
||||||
static struct opcode group2_table[] = {
|
|
||||||
};
|
|
||||||
|
|
||||||
static struct opcode opcode_table[256] = {
|
static struct opcode opcode_table[256] = {
|
||||||
/* 0x00 - 0x07 */
|
/* 0x00 - 0x07 */
|
||||||
D(ByteOp | DstMem | SrcReg | ModRM | Lock), D(DstMem | SrcReg | ModRM | Lock),
|
D(ByteOp | DstMem | SrcReg | ModRM | Lock), D(DstMem | SrcReg | ModRM | Lock),
|
||||||
@@ -959,7 +948,7 @@ x86_decode_insn(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops)
|
|||||||
struct decode_cache *c = &ctxt->decode;
|
struct decode_cache *c = &ctxt->decode;
|
||||||
int rc = X86EMUL_CONTINUE;
|
int rc = X86EMUL_CONTINUE;
|
||||||
int mode = ctxt->mode;
|
int mode = ctxt->mode;
|
||||||
int def_op_bytes, def_ad_bytes, group, dual, goffset;
|
int def_op_bytes, def_ad_bytes, dual, goffset;
|
||||||
struct opcode opcode, *g_mod012, *g_mod3;
|
struct opcode opcode, *g_mod012, *g_mod3;
|
||||||
|
|
||||||
/* we cannot decode insn before we complete previous rep insn */
|
/* we cannot decode insn before we complete previous rep insn */
|
||||||
@@ -1059,24 +1048,17 @@ done_prefixes:
|
|||||||
c->d = opcode.flags;
|
c->d = opcode.flags;
|
||||||
|
|
||||||
if (c->d & Group) {
|
if (c->d & Group) {
|
||||||
group = c->d & GroupMask;
|
|
||||||
dual = c->d & GroupDual;
|
dual = c->d & GroupDual;
|
||||||
c->modrm = insn_fetch(u8, 1, c->eip);
|
c->modrm = insn_fetch(u8, 1, c->eip);
|
||||||
--c->eip;
|
--c->eip;
|
||||||
|
|
||||||
if (group) {
|
if (c->d & GroupDual) {
|
||||||
g_mod012 = g_mod3 = &group_table[group * 8];
|
g_mod012 = opcode.u.gdual->mod012;
|
||||||
if (c->d & GroupDual)
|
g_mod3 = opcode.u.gdual->mod3;
|
||||||
g_mod3 = &group2_table[group * 8];
|
} else
|
||||||
} else {
|
g_mod012 = g_mod3 = opcode.u.group;
|
||||||
if (c->d & GroupDual) {
|
|
||||||
g_mod012 = opcode.u.gdual->mod012;
|
|
||||||
g_mod3 = opcode.u.gdual->mod3;
|
|
||||||
} else
|
|
||||||
g_mod012 = g_mod3 = opcode.u.group;
|
|
||||||
}
|
|
||||||
|
|
||||||
c->d &= ~(Group | GroupDual | GroupMask);
|
c->d &= ~(Group | GroupDual);
|
||||||
|
|
||||||
goffset = (c->modrm >> 3) & 7;
|
goffset = (c->modrm >> 3) & 7;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user