From: Takuya Yoshikawa Subject: Re: [PATCH 1/5] KVM: x86 emulator: Use single stage decoding for Group 1 instructions Date: Tue, 15 Mar 2011 06:32:32 +0900 Message-ID: <20110315063232.6156395a.takuya.yoshikawa@gmail.com> References: <20110314001524.f35e8a3f.takuya.yoshikawa@gmail.com> <20110314001727.89e302d7.takuya.yoshikawa@gmail.com> <20110314151140.GT10151@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: avi@redhat.com, mtosatti@redhat.com, kvm@vger.kernel.org, yoshikawa.takuya@oss.ntt.co.jp To: Gleb Natapov Return-path: Received: from mail-ww0-f44.google.com ([74.125.82.44]:33590 "EHLO mail-ww0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757316Ab1CNVck (ORCPT ); Mon, 14 Mar 2011 17:32:40 -0400 Received: by wwa36 with SMTP id 36so6211935wwa.1 for ; Mon, 14 Mar 2011 14:32:39 -0700 (PDT) In-Reply-To: <20110314151140.GT10151@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Mon, 14 Mar 2011 17:11:40 +0200 Gleb Natapov wrote: > > @@ -3212,11 +3235,13 @@ special_insn: > > break; > > case 0xa6 ... 0xa7: /* cmps */ > > c->dst.type = OP_NONE; /* Disable writeback. */ > > - goto cmp; > > + emulate_2op_SrcV("cmp", c->src, c->dst, ctxt->eflags); > Why not call em_cmp() here? I thought that I needed to check of c->dst.type = OP_NONE; /* Disable writeback. */ later. So I just decided to treat CMPS and SCAS in another patch. I mean I may introduce em_cmps or em_scas later if needed. You prefer to treat these in this patch? > > + break; > > case 0xa8 ... 0xa9: /* test ax, imm */ > > goto test; > > case 0xae ... 0xaf: /* scas */ > > - goto cmp; > > + emulate_2op_SrcV("cmp", c->src, c->dst, ctxt->eflags); > And here? What is the difference of CMPS and SCAS? > > > + break; > > case 0xc0 ... 0xc1: > > emulate_grp2(ctxt); > > break; > > -- > > 1.7.1 > > -- > Gleb. -- Takuya Yoshikawa