From: "Jan Beulich" Subject: Re: [PATCH RFC V4 1/5] xen: Emulate with no writes Date: Mon, 04 Aug 2014 15:09:40 +0100 Message-ID: <53DFB0440200007800029111@mail.emea.novell.com> References: <1407151825-3843-1-git-send-email-rcojocaru@bitdefender.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1407151825-3843-1-git-send-email-rcojocaru@bitdefender.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Razvan Cojocaru Cc: kevin.tian@intel.com, ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com, andrew.cooper3@citrix.com, eddie.dong@intel.com, xen-devel@lists.xen.org, jun.nakajima@intel.com, ian.jackson@eu.citrix.com List-Id: xen-devel@lists.xenproject.org >>> On 04.08.14 at 13:30, wrote: > --- a/xen/arch/x86/hvm/emulate.c > +++ b/xen/arch/x86/hvm/emulate.c > @@ -688,6 +688,51 @@ static int hvmemul_write( > return X86EMUL_OKAY; > } > > +static int hvmemul_write_discard( > + enum x86_segment seg, > + unsigned long offset, > + void *p_data, > + unsigned int bytes, > + struct x86_emulate_ctxt *ctxt) > +{ > + /* Discarding the write. */ > + return X86EMUL_OKAY; > +} While this one is okay, ... > +static int hvmemul_rep_ins_discard( > + uint16_t src_port, > + enum x86_segment dst_seg, > + unsigned long dst_offset, > + unsigned int bytes_per_rep, > + unsigned long *reps, > + struct x86_emulate_ctxt *ctxt) > +{ > + return X86EMUL_OKAY; > +} > + > +static int hvmemul_rep_movs_discard( > + enum x86_segment src_seg, > + unsigned long src_offset, > + enum x86_segment dst_seg, > + unsigned long dst_offset, > + unsigned int bytes_per_rep, > + unsigned long *reps, > + struct x86_emulate_ctxt *ctxt) > +{ > + return X86EMUL_OKAY; > +} ... these don't seem to be: I don't think you can just drop the other half of the operation (i.e. the port or MMIO read). Jan