From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [PATCH 3/7] KVM: x86 emulator: introduce NoWrite flag Date: Sat, 22 Dec 2012 17:11:12 +0200 Message-ID: <20121222151111.GW29007@redhat.com> References: <1356179217-5526-1-git-send-email-avi.kivity@gmail.com> <1356179217-5526-4-git-send-email-avi.kivity@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Marcelo Tosatti , kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from mx1.redhat.com ([209.132.183.28]:49977 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751181Ab2LVPLO (ORCPT ); Sat, 22 Dec 2012 10:11:14 -0500 Content-Disposition: inline In-Reply-To: <1356179217-5526-4-git-send-email-avi.kivity@gmail.com> Sender: kvm-owner@vger.kernel.org List-ID: On Sat, Dec 22, 2012 at 02:26:53PM +0200, Avi Kivity wrote: > Instead of disabling writeback via OP_NONE, just specify NoWrite. > > Signed-off-by: Avi Kivity > --- > arch/x86/kvm/emulate.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c > index 9859df6..9dfbd07 100644 > --- a/arch/x86/kvm/emulate.c > +++ b/arch/x86/kvm/emulate.c > @@ -150,6 +150,7 @@ > #define Unaligned ((u64)1 << 42) /* Explicitly unaligned (e.g. MOVDQU) */ > #define Avx ((u64)1 << 43) /* Advanced Vector Extensions */ > #define Fastop ((u64)1 << 44) /* Use opcode::u.fastop */ > +#define NoWrite ((u64)1 << 45) /* No writeback */ > > #define X2(x...) x, x > #define X3(x...) X2(x), x > @@ -1584,6 +1585,9 @@ static int writeback(struct x86_emulate_ctxt *ctxt) > { > int rc; > > + if (ctxt->d & NoWrite) > + return X86EMUL_CONTINUE; > + Why not make it Dst flag and set dst.type to OP_NONE during decoding instead of this special case? > switch (ctxt->dst.type) { > case OP_REG: > write_register_operand(&ctxt->dst); > -- > 1.7.11.7 -- Gleb.