From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH] xen/arm: Handle translated addresses for hardware domains in GICv2 Date: Fri, 27 Feb 2015 14:00:49 +0000 Message-ID: <54F07891.5080401@linaro.org> References: <54EDC819.3090901@linaro.org> <1424870511-17655-1-git-send-email-frediano.ziglio@huawei.com> <54F076BF.203@linaro.org> <1425045461.14641.205.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1425045461.14641.205.camel@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: Ian Campbell Cc: Frediano Ziglio , Tim Deegan , xen-devel@lists.xen.org, Stefano Stabellini , zoltan.kiss@huawei.com List-Id: xen-devel@lists.xenproject.org On 27/02/15 13:57, Ian Campbell wrote: > On Fri, 2015-02-27 at 13:53 +0000, Julien Grall wrote: >> Hi Frediano, >> >> On 25/02/15 13:21, Frediano Ziglio wrote: >>> Translated addresses (in d->arch.vgic.{c,d}base) are now bus addresses >>> which could not always be applied to the DT. >>> Copy the original addresses from DT directly to get the original >>> untranslated reg property which will give same d->arch.vgic.{c,d}base >>> values once translated again. >>> >>> Signed-off-by: Frediano Ziglio >>> --- >>> xen/arch/arm/gic-v2.c | 25 ++++++++++++++----------- >>> 1 file changed, 14 insertions(+), 11 deletions(-) >>> >>> Fixed typos in comments. >>> >>> diff --git a/xen/arch/arm/gic-v2.c b/xen/arch/arm/gic-v2.c >>> index 31fb81a..a401e3f 100644 >>> --- a/xen/arch/arm/gic-v2.c >>> +++ b/xen/arch/arm/gic-v2.c >>> @@ -590,7 +590,7 @@ static int gicv2_make_dt_node(const struct domain *d, >>> const struct dt_device_node *gic = dt_interrupt_controller; >>> const void *compatible = NULL; >>> u32 len; >>> - __be32 *new_cells, *tmp; >>> + const __be32 *regs; >>> int res = 0; >>> >>> compatible = dt_get_property(gic, "compatible", &len); >>> @@ -617,18 +617,21 @@ static int gicv2_make_dt_node(const struct domain *d, >>> if ( res ) >>> return res; >>> >>> - len = dt_cells_to_size(dt_n_addr_cells(node) + dt_n_size_cells(node)); >>> - len *= 2; /* GIC has two memory regions: Distributor + CPU interface */ >>> - new_cells = xzalloc_bytes(len); >>> - if ( new_cells == NULL ) >>> - return -FDT_ERR_XEN(ENOMEM); >>> + /* >>> + * DTB provides up to 4 regions to handle virtualization >> >> Sorry to ask more change. >> >> I'm not sure why you speak about virtualization here. > > Because two of the regions are GICH and GICV, and those are the ones we > are truncating out here. I though about it but I wasn't sure if he meant that. Regards, -- Julien Grall