From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH v1 2/8] xen/arm: io: Extend write/read handler to pass the register in parameter Date: Tue, 29 Sep 2015 12:09:42 +0100 Message-ID: <1443524982.16718.50.camel@citrix.com> References: <1443192698-16163-1-git-send-email-julien.grall@citrix.com> <1443192698-16163-3-git-send-email-julien.grall@citrix.com> <1443198971.25250.205.camel@citrix.com> <56096C64.9040306@citrix.com> <1443523910.16718.39.camel@citrix.com> <560A6F60.2070604@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Zgsn5-0007hO-0h for xen-devel@lists.xenproject.org; Tue, 29 Sep 2015 11:09:47 +0000 In-Reply-To: <560A6F60.2070604@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Julien Grall , xen-devel@lists.xenproject.org Cc: Vijaya.Kumar@caviumnetworks.com, Julien Grall , stefano.stabellini@citrix.com, manish.jaggi@caviumnetworks.com, vijay.kilari@gmail.com List-Id: xen-devel@lists.xenproject.org On Tue, 2015-09-29 at 12:00 +0100, Julien Grall wrote: > Hi Ian, > > On 29/09/15 11:51, Ian Campbell wrote: > > On Mon, 2015-09-28 at 17:35 +0100, Julien Grall wrote: > > > Hi Ian, > > > > > > On 25/09/15 17:36, Ian Campbell wrote: > > > > On Fri, 2015-09-25 at 15:51 +0100, Julien Grall wrote: > > > > > From: Julien Grall > > > > > > > > > > Rather than letting each handler to retrieve the register used by > > > > > the > > > > > I/O access, add a new parameter to pass the register in > > > > > parameter. > > > > > > > > > > This will help to implement generic register manipulation on I/O > > > > > access > > > > > such as sign-extension and endianess. > > > > > > > > > > Read handlers need to modify the value of the register, so a > > > > > pointer > > > > > to > > > > > it is given in argument. Write handlers shouldn't modify the > > > > > register, > > > > > therfore only a plain value is given. > > > > > > > > "therefore" > > > > > > > > > > Signed-off-by: Julien Grall > > > > > > > > Acked-by: Ian Campbell > > > > > > > Is it the case that read handlers today only update *r on success? > > > > > > Yes, each read handler only update the register mentioned in > > > dabt.reg. > > > > I meant that they do not touch it on failure. > > Sorry, somehow I read as "Is only the register pointed by *r updated by > the read handlers"? Yes, my original comment was ambiguously parsable that way, sorry. > AFAICT, it's always the case. When the handler returns 0 (i.e failure), > a data abort will be injected to the domain unless the handler decide to > crash the domain. The important thing is whether any path sets *r and then returns 0, I think. > I don't think it's necessary to mandate/enforce as the worst that can > happen is a guest register is corrupted. Although, the guest will > unlikely get continue after a data abort on MMIO we emulate. True. > > Regards, >