From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH 7/8] xen/arm: gic-v2: Detect automatically aliased GIC400 Date: Fri, 25 Sep 2015 17:26:56 +0100 Message-ID: <1443198416.25250.200.camel@citrix.com> References: <1442944062-4324-1-git-send-email-julien.grall@citrix.com> <1442944062-4324-8-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.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZfVpt-0006Rq-Cq for xen-devel@lists.xenproject.org; Fri, 25 Sep 2015 16:27:02 +0000 In-Reply-To: <1442944062-4324-8-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: Zoltan Kiss , stefano.stabellini@citrix.com List-Id: xen-devel@lists.xenproject.org On Tue, 2015-09-22 at 18:47 +0100, Julien Grall wrote: Subject: "automatically detect..." > We are currently using a per-platform quirk to know if the 2 4KB region of > the GIC CPU interface are each aligned to 64KB. Although, it may be > possible to have different layout on a same platform (depending on the > firmware version). > > Rather than having a quirk it's possible to detect by reading the GIC > memory. This patch is based from the Linux commit "irqchip/GIC: Add > workaround > for aliased GIC400" [1]. > > Take the opportunity to clean up the GICv2 of code which was only > required because of the quirk. > > Note that none of the platform using the gic-hip04 where actually using s/where/were/ > @@ -688,7 +684,8 @@ static int __init hip04gic_init(void) > if ( !gicv2.map_hbase ) > panic("GIC-HIP04: Failed to ioremap for GIC Virtual > interface\n"); > > - vgic_v2_setup_hw(dbase, cbase, vbase); > + /* XXX: Support aliased HIP04 GIC? */ I assume it doesn't need this, so lets drop the comment and assume that's the lack of the quirk on this platform is correct. > + gicv2.map_cbase = ioremap_nocache(cbase, csize); > + if ( !gicv2.map_cbase ) > panic("GICv2: Failed to ioremap for GIC CPU interface\n"); s/for/the/ or just s/for //. > > + if ( gicv2_is_aliased(cbase, csize) ) > + { > + /* > + * Move the base up by 60kB, so that we have a 8kB contiguous > + * region, which allows us to use GICC_DIR at its > + * normal offset. > + * Note the variable cbase is not updated has we need the original s/has/as/ > printk("GICv3 compatible with GICv2 cbase %#"PRIpaddr" vbase %#"PRIpaddr"\n", > cbase, vbase); > > - vgic_v2_setup_hw(dbase, cbase, vbase); > + /* XXX: Support aliased GICv2 on GICv3? */ Nah.