From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paul Durrant Subject: Re: [PATCH v4 13/17] x86/hvm: remove HVMIO_dispatched I/O state Date: Wed, 24 Jun 2015 16:00:49 +0000 Message-ID: <9AAE0902D5BC7E449B7C8E4E778ABCD02596D1DC@AMSPEX01CL02.citrite.net> References: <1435145089-21999-1-git-send-email-paul.durrant@citrix.com> <1435145089-21999-14-git-send-email-paul.durrant@citrix.com> <558AEE740200007800089123@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Z7n6d-00053u-Mv for xen-devel@lists.xenproject.org; Wed, 24 Jun 2015 16:00:55 +0000 In-Reply-To: <558AEE740200007800089123@mail.emea.novell.com> Content-Language: en-US List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: Andrew Cooper , "Keir (Xen.org)" , "xen-devel@lists.xenproject.org" List-Id: xen-devel@lists.xenproject.org > -----Original Message----- > From: Jan Beulich [mailto:JBeulich@suse.com] > Sent: 24 June 2015 16:53 > To: Paul Durrant > Cc: Andrew Cooper; xen-devel@lists.xenproject.org; Keir (Xen.org) > Subject: Re: [PATCH v4 13/17] x86/hvm: remove HVMIO_dispatched I/O > state > > >>> On 24.06.15 at 13:24, wrote: > > --- a/xen/arch/x86/hvm/emulate.c > > +++ b/xen/arch/x86/hvm/emulate.c > > @@ -138,20 +138,14 @@ static int hvmemul_do_io( > > if ( data_is_addr || dir == IOREQ_WRITE ) > > return X86EMUL_UNHANDLEABLE; > > goto finish_access; > > - case HVMIO_dispatched: > > - /* May have to wait for previous cycle of a multi-write to complete. */ > > - if ( is_mmio && !data_is_addr && (dir == IOREQ_WRITE) && > > - (addr == (vio->mmio_large_write_pa + > > - vio->mmio_large_write_bytes)) ) > > - return X86EMUL_RETRY; > > - /* fallthrough */ > > The description is plausible, and the rest of the patch looks plausible > too, but I can't seem to follow why the above can go away without > any replacement (or what the replacement would be). Could you > clarify that, please? > The reason is that the dispatched state was only ever used for writes (or data_is_addr, which is disallowed in this case), and the code below this forces writes to be completed with X86EMUL_OKAY meaning that emulation will never be retried (because it's not retried directly from hvm_io_assist() unless state was HVMIO_mmio_awaiting_completion). Thus I believe this was either always dead code, or it's been dead for a long time. Do you want me to stick words to that effect in the comment? Paul > Jan