From: "Mohammed Gamal" Subject: Re: [PATCH] x86 emulator: Add opcodes 0xb9-0xbf (mov r,imm) Date: Wed, 6 Aug 2008 18:01:44 +0300 Message-ID: <52d4a3890808060801k59f0384fsfd1f0cb769ea429c@mail.gmail.com> References: <20080731133101.GA9081@mohd-laptop> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: avi@qumranet.com, riel@surriel.com To: kvm@vger.kernel.org Return-path: Received: from an-out-0708.google.com ([209.85.132.241]:3481 "EHLO an-out-0708.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754588AbYHFPBp (ORCPT ); Wed, 6 Aug 2008 11:01:45 -0400 Received: by an-out-0708.google.com with SMTP id d40so513220and.103 for ; Wed, 06 Aug 2008 08:01:44 -0700 (PDT) In-Reply-To: <20080731133101.GA9081@mohd-laptop> Content-Disposition: inline Sender: kvm-owner@vger.kernel.org List-ID: On Thu, Jul 31, 2008 at 4:31 PM, Mohammed Gamal wrote: > The emulator only supported opcode 0xb8 for mov r,imm. However 0xb9-0xbf > are also mov r,imm. This patch adds support for these instructions. > > Signed-off-by: Mohammed Gamal > > --- > arch/x86/kvm/x86_emulate.c | 6 ++++-- > 1 files changed, 4 insertions(+), 2 deletions(-) > > diff --git a/arch/x86/kvm/x86_emulate.c b/arch/x86/kvm/x86_emulate.c > index 005f1db..4c7ca7f 100644 > --- a/arch/x86/kvm/x86_emulate.c > +++ b/arch/x86/kvm/x86_emulate.c > @@ -156,7 +156,9 @@ static u16 opcode_table[256] = { > ByteOp | ImplicitOps | String, ImplicitOps | String, > /* 0xB0 - 0xBF */ > 0, 0, 0, 0, 0, 0, 0, 0, > - DstReg | SrcImm | Mov, 0, 0, 0, 0, 0, 0, 0, > + DstReg | SrcImm | Mov, DstReg | SrcImm | Mov, DstReg | SrcImm | Mov, > + DstReg | SrcImm | Mov, DstReg | SrcImm | Mov, DstReg | SrcImm | Mov, > + DstReg | SrcImm | Mov, DstReg | SrcImm | Mov, > /* 0xC0 - 0xC7 */ > ByteOp | DstMem | SrcImm | ModRM, DstMem | SrcImmByte | ModRM, > 0, ImplicitOps | Stack, 0, 0, > @@ -1660,7 +1662,7 @@ special_insn: > case 0xae ... 0xaf: /* scas */ > DPRINTF("Urk! I don't handle SCAS.\n"); > goto cannot_emulate; > - case 0xb8: /* mov r, imm */ > + case 0xb8 ... 0xbf: /* mov r, imm */ > goto mov; > case 0xc0 ... 0xc1: > emulate_grp2(ctxt); > -- > 1.5.4.3 > > > Sorry for the typo, it adds instruction opcodes (0xb8-0xbf)