From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: Re: [PATCH RFC V4 1/5] xen: Emulate with no writes Date: Mon, 04 Aug 2014 15:42:39 +0100 Message-ID: <53DFB7FF0200007800029197@mail.emea.novell.com> References: <1407151825-3843-1-git-send-email-rcojocaru@bitdefender.com> <53DFB0440200007800029111@mail.emea.novell.com> <53DF97DC.8010402@bitdefender.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <53DF97DC.8010402@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 16:25, wrote: > On 08/04/2014 05:09 PM, Jan Beulich wrote: >>>>> 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). > > It's been suggested here: > > http://lists.xen.org/archives/html/xen-devel/2014-07/msg03088.html > > that we should use modified versions of the rep_ins, rep_movs and > cmpxchg handlers if we want to make sure absolutely no writes will > happen. Then again, perhaps the modification were supposed to be more > subtle than just doing nothing in the handler? That's what I'm trying to hint at. Jan