From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [PATCH 1/5] KVM: x86 emulator: Use single stage decoding for Group 1 instructions Date: Tue, 15 Mar 2011 11:35:07 +0200 Message-ID: <20110315093507.GU10151@redhat.com> References: <20110314001524.f35e8a3f.takuya.yoshikawa@gmail.com> <20110314001727.89e302d7.takuya.yoshikawa@gmail.com> <20110314151140.GT10151@redhat.com> <20110315063232.6156395a.takuya.yoshikawa@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: avi@redhat.com, mtosatti@redhat.com, kvm@vger.kernel.org, yoshikawa.takuya@oss.ntt.co.jp To: Takuya Yoshikawa Return-path: Received: from mx1.redhat.com ([209.132.183.28]:39837 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756982Ab1COJfL (ORCPT ); Tue, 15 Mar 2011 05:35:11 -0400 Content-Disposition: inline In-Reply-To: <20110315063232.6156395a.takuya.yoshikawa@gmail.com> Sender: kvm-owner@vger.kernel.org List-ID: On Tue, Mar 15, 2011 at 06:32:32AM +0900, Takuya Yoshikawa wrote: > 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. > I mean call em_cmp() after c->dst.type = OP_NONE line, not replacing it. > 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. > scas will likely just call em_cmp. > You prefer to treat these in this patch? > If there will be other patch for those instruction then it may be left as is. > > > + 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? > > One compares to memory locations and another memory with AX register. -- Gleb.