From: Takuya Yoshikawa Subject: Re: [PATCH 1/5] KVM: x86 emulator: Use single stage decoding for Group 1 instructions Date: Tue, 15 Mar 2011 23:06:51 +0900 Message-ID: <20110315230651.4ba2029c.takuya.yoshikawa@gmail.com> References: <20110314001524.f35e8a3f.takuya.yoshikawa@gmail.com> <20110314001727.89e302d7.takuya.yoshikawa@gmail.com> <20110314151140.GT10151@redhat.com> <20110315063232.6156395a.takuya.yoshikawa@gmail.com> <20110315093507.GU10151@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-vx0-f174.google.com ([209.85.220.174]:62441 "EHLO mail-vx0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754068Ab1COOG6 (ORCPT ); Tue, 15 Mar 2011 10:06:58 -0400 Received: by vxi39 with SMTP id 39so577411vxi.19 for ; Tue, 15 Mar 2011 07:06:58 -0700 (PDT) In-Reply-To: <20110315093507.GU10151@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Tue, 15 Mar 2011 11:35:07 +0200 Gleb Natapov wrote: > > > 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. I see the point! > > 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. In my city, electric power supply may become restricted under control from now, though only a few hours. So please take the patch series as is if possible! > > > > > + 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. I wanted to know whether we should introduce em_cmps() or em_scas() later. Probably we can eliminate introducing em_scas() because it should be completely same as em_cmp(). But em_cmps() will be needed for inserting c->dst.type = OP_NONE; before em_cmp(). Anyway, I will submit a patch for CMPS and SCAS conversion separately if this patch can be applied. Thanks, Takuya > > -- > Gleb.