From mboxrd@z Thu Jan 1 00:00:00 1970 From: Guillaume Thouvenin Subject: [Patch 1/5] x86_emulator: Extend the opcode descriptor Date: Mon, 3 Nov 2008 16:01:53 +0100 Message-ID: <20081103160153.5d71026e@frecb000711> References: <20081103160036.499cb482@frecb000711> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Guillaume Thouvenin , Avi Kivity To: kvm Return-path: Received: from ecfrec.frec.bull.fr ([129.183.4.8]:59096 "EHLO ecfrec.frec.bull.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755795AbYKCPFe (ORCPT ); Mon, 3 Nov 2008 10:05:34 -0500 In-Reply-To: <20081103160036.499cb482@frecb000711> Sender: kvm-owner@vger.kernel.org List-ID: Extend the opcode descriptor to 32 bits. This is needed by the introduction of a new Src2 operand type. Signed-off-by: Guillaume Thouvenin --- arch/x86/kvm/x86_emulate.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/kvm/x86_emulate.c b/arch/x86/kvm/x86_emulate.c index 8f60ace..f0c7620 100644 --- a/arch/x86/kvm/x86_emulate.c +++ b/arch/x86/kvm/x86_emulate.c @@ -76,7 +76,7 @@ enum { Group1A, Group3_Byte, Group3, Group4, Group5, Group7, }; -static u16 opcode_table[256] = { +static u32 opcode_table[256] = { /* 0x00 - 0x07 */ ByteOp | DstMem | SrcReg | ModRM, DstMem | SrcReg | ModRM, ByteOp | DstReg | SrcMem | ModRM, DstReg | SrcMem | ModRM, @@ -195,7 +195,7 @@ static u16 opcode_table[256] = { ImplicitOps, ImplicitOps, Group | Group4, Group | Group5, }; -static u16 twobyte_table[256] = { +static u32 twobyte_table[256] = { /* 0x00 - 0x0F */ 0, Group | GroupDual | Group7, 0, 0, 0, 0, ImplicitOps, 0, ImplicitOps, ImplicitOps, 0, 0, 0, ImplicitOps | ModRM, 0, 0, @@ -253,7 +253,7 @@ static u16 twobyte_table[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -static u16 group_table[] = { +static u32 group_table[] = { [Group1_80*8] = ByteOp | DstMem | SrcImm | ModRM, ByteOp | DstMem | SrcImm | ModRM, ByteOp | DstMem | SrcImm | ModRM, ByteOp | DstMem | SrcImm | ModRM, @@ -297,7 +297,7 @@ static u16 group_table[] = { SrcMem16 | ModRM | Mov, SrcMem | ModRM | ByteOp, }; -static u16 group2_table[] = { +static u32 group2_table[] = { [Group7*8] = SrcNone | ModRM, 0, 0, 0, SrcNone | ModRM | DstMem | Mov, 0, -- 1.6.0.3.514.g2f91b On Mon, 3 Nov 2008 15:42:49 +0100 Guillaume Thouvenin wrote: > This series of patches emulate instructions of shld and shrd > instructions. As those instructions have three operands we introduce a > decode set for the Src2 operand. By doing this, the opcode descriptor > needs to be extend to 32 bit. > > So this series of patches: > [1/5] extend the opcode descr