From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH 1/3] xen/arm: io: Extend write/read handler to pass private data Date: Tue, 29 Sep 2015 14:50:20 +0100 Message-ID: <1443534620.16718.81.camel@citrix.com> References: <1443472296-6671-1-git-send-email-julien.grall@citrix.com> <1443472296-6671-2-git-send-email-julien.grall@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZgvIX-000524-3J for xen-devel@lists.xenproject.org; Tue, 29 Sep 2015 13:50:25 +0000 In-Reply-To: <1443472296-6671-2-git-send-email-julien.grall@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: shameerali.kolothum.thodi@huawei.com, stefano.stabellini@eu.citrix.com List-Id: xen-devel@lists.xenproject.org On Mon, 2015-09-28 at 21:31 +0100, Julien Grall wrote: > Some handlers may require to use private data in order to get quickly > information related to the region emulated. > > Signed-off-by: Julien Grall > > --- > > Cc: shameerali.kolothum.thodi@huawei.com > > This will be necessary in the follow-up in order to fix bug in the > GICR emulation. > --- > xen/arch/arm/io.c | 15 +++++++++++---- > xen/arch/arm/vgic-v2.c | 8 +++++--- > xen/arch/arm/vgic-v3.c | 17 +++++++++++------ > xen/arch/arm/vuart.c | 11 ++++++----- > xen/include/asm-arm/mmio.h | 7 ++++--- > 5 files changed, 37 insertions(+), 21 deletions(-) > > diff --git a/xen/arch/arm/io.c b/xen/arch/arm/io.c > index 8e55d49..85797f1 100644 > --- a/xen/arch/arm/io.c > +++ b/xen/arch/arm/io.c > @@ -37,18 +37,24 @@ int handle_mmio(mmio_info_t *info) > if ( (info->gpa >= mmio_handler->addr) && > (info->gpa < (mmio_handler->addr + mmio_handler->size)) ) > { > - return info->dabt.write ? > - mmio_handler->mmio_handler_ops->write_handler(v, info) : > - mmio_handler->mmio_handler_ops->read_handler(v, info); > + goto found; Rather than goto use break instead. > } > } > > return 0; And make this "if ( i == io_handlers->num_entries ) return 0;" The continue to handle the op as you have done. Other than that looks good. Ian.