From: Takuya Yoshikawa Subject: Re: [RFC PATCH 2/2] KVM: x86 emulator: Cleanup emulate_push() writebacks Date: Wed, 30 Mar 2011 15:51:52 +0900 Message-ID: <20110330155152.fa20cafd.yoshikawa.takuya@oss.ntt.co.jp> References: <20110329013229.20e6168f.takuya.yoshikawa@gmail.com> <20110329013407.c7bcadcc.takuya.yoshikawa@gmail.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, gleb@redhat.com To: Takuya Yoshikawa Return-path: Received: from serv2.oss.ntt.co.jp ([222.151.198.100]:42001 "EHLO serv2.oss.ntt.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754419Ab1C3HLK (ORCPT ); Wed, 30 Mar 2011 03:11:10 -0400 In-Reply-To: <20110329013407.c7bcadcc.takuya.yoshikawa@gmail.com> Sender: kvm-owner@vger.kernel.org List-ID: Takuya Yoshikawa wrote: > @@ -1265,22 +1263,19 @@ int emulate_int_real(struct x86_emulate_ctxt *ctxt, > > /* TODO: Add limit checks */ > c->src.val = ctxt->eflags; > - emulate_push(ctxt, ops); > - rc = writeback(ctxt, ops); > + rc = emulate_push(ctxt, ops); > if (rc != X86EMUL_CONTINUE) > return rc; > > ctxt->eflags &= ~(EFLG_IF | EFLG_TF | EFLG_AC); > > c->src.val = ops->get_segment_selector(VCPU_SREG_CS, ctxt->vcpu); > - emulate_push(ctxt, ops); > - rc = writeback(ctxt, ops); > + rc = emulate_push(ctxt, ops); > if (rc != X86EMUL_CONTINUE) > return rc; > > c->src.val = c->eip; > - emulate_push(ctxt, ops); > - rc = writeback(ctxt, ops); > + rc = emulate_push(ctxt, ops); > if (rc != X86EMUL_CONTINUE) > return rc; I could also delete "c->dst.type = OP_NONE;" line here. ... > > static int em_push(struct x86_emulate_ctxt *ctxt) > { > - emulate_push(ctxt, ctxt->ops); > - return X86EMUL_CONTINUE; > + return emulate_push(ctxt, ctxt->ops); > } em_push() can be used instead of emulate_push() if we rearrange the place to put em_push(). There seems to be some conflicting patches around. So If I get some other comments, I'll rebase and resend later! Takuya