From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] x86_emulate: Emulate nop and xchg reg,rax (0x90 - 0x97) instructions Date: Sat, 14 Jun 2008 19:58:10 +0300 Message-ID: <4853F8A2.8010903@qumranet.com> References: <52d4a3890806140926q49fa0976p77ee70a04b6a749b@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, riel@surriel.com To: Mohammed Gamal Return-path: Received: from il.qumranet.com ([212.179.150.194]:56861 "EHLO il.qumranet.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753897AbYFNQ6O (ORCPT ); Sat, 14 Jun 2008 12:58:14 -0400 In-Reply-To: <52d4a3890806140926q49fa0976p77ee70a04b6a749b@mail.gmail.com> Sender: kvm-owner@vger.kernel.org List-ID: Mohammed Gamal wrote: > This patch fixes the previous nop patch and adds the xchg reg,rax > instruction opcodes. > > > + case 0x90: /* nop / xchg r8,rax */ > + if(! (c->rex_prefix & 1) ) > + break; space after if. > + c->dst.ptr = decode_register( (c->b & 7) | ((c->rex_prefix & 1) << > 3), c->regs, 0); > + c->dst.val = *(c->dst.ptr); > + goto xchg; > You can have the destination autodecoded by using DstReg instead of ImplicitOps. Otherwise, looks fine. -- I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.