From: Ian Campbell <ian.campbell@citrix.com>
To: Julien Grall <julien.grall@citrix.com>, xen-devel@lists.xenproject.org
Cc: Zoltan Kiss <zoltan.kiss@huawei.com>, stefano.stabellini@citrix.com
Subject: Re: [PATCH v2 6/7] xen/arm: gic-v2: Automatically detect aliased GIC400
Date: Thu, 1 Oct 2015 13:10:09 +0100 [thread overview]
Message-ID: <1443701409.11707.31.camel@citrix.com> (raw)
In-Reply-To: <1443543701-18389-7-git-send-email-julien.grall@citrix.com>
On Tue, 2015-09-29 at 17:21 +0100, Julien Grall wrote:
> 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 were actually using
> the quirk, so the code has been dropped. I will let the maintainers
> decide whether it's relevant or not to add proper detection for aliased
> GIC for this hardware.
>
> [1] commit 12e14066f4835f5ee1ca795f0309415b54c067a9
> Author: Marc Zyngier <marc.zyngier@arm.com>
> Date: Sun Sep 13 12:14:31 2015 +0100
>
> irqchip/GIC: Add workaround for aliased GIC400
>
> The GICv2 architecture mandates that the two 4kB GIC regions are
> contiguous, and on two separate physical pages (so that access to
> the second page can be trapped by a hypervisor). This doesn't work
> very well when PAGE_SIZE is 64kB.
>
> A relatively common hack^Wway to work around this is to alias each
> 4kB region over its own 64kB page. Of course in this case, the base
> address you want to use is not really the begining of the region,
> but base + 60kB (so that you get a contiguous 8kB region over two
> distinct pages).
>
> Normally, this would be described in DT with a new property, but
> some HW is already out there, and the firmware makes sure that
> it will override whatever you put in the GIC node. Duh. And of
> course,
> said firmware source code is not available, despite being based
> on u-boot.
>
> The workaround is to detect the case where the CPU interface size
> is set to 128kB, and verify the aliasing by checking that the ID
> register for GIC400 (which is the only GIC wired this way so far)
> is the same at base and base + 0xF000. In this case, we update
> the GIC base address and let it roll.
>
> And if you feel slightly sick by looking at this, rest assured that
> I do too...
>
> Reported-by: Julien Grall <julien.grall@citrix.com>
> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: Stuart Yoder <stuart.yoder@freescale.com>
> Cc: Pavel Fedin <p.fedin@samsung.com>
> Cc: Jason Cooper <jason@lakedaemon.net>
> Link: http://lkml.kernel.org/r/1442142873-20213-2-git-send-email-marc
> .zyngier@arm.com
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
>
> Signed-off-by: Julien Grall <julien.grall@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
next prev parent reply other threads:[~2015-10-01 12:10 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-29 16:21 [PATCH v2 0/7] xen/arm: gic-v2: Detect automatically aliased GIC 400 Julien Grall
2015-09-29 16:21 ` [PATCH v2 1/7] xen/arm: gic: Make it clear the GIC node is passed to make_hwdom_dt_node Julien Grall
2015-09-29 16:21 ` [PATCH v2 2/7] xen/arm: Retrieve the correct number of cells when building dom0 DT Julien Grall
2015-10-01 11:57 ` Ian Campbell
2015-09-29 16:21 ` [PATCH v2 3/7] xen/arm: Warn when a device tree path will be re-used by Xen Julien Grall
2015-10-01 12:01 ` Ian Campbell
2015-10-01 12:39 ` Julien Grall
2015-09-29 16:21 ` [PATCH v2 4/7] xen/arm: vgic-v2: Drop cbase from arch_domain Julien Grall
2015-09-29 16:21 ` [PATCH v2 5/7] xen/arm: gic: Check the size of the CPU and vCPU interface retrieved from DT Julien Grall
2015-10-01 12:08 ` Ian Campbell
2015-10-01 12:43 ` Julien Grall
2015-10-01 12:54 ` Ian Campbell
2015-09-29 16:21 ` [PATCH v2 6/7] xen/arm: gic-v2: Automatically detect aliased GIC400 Julien Grall
2015-10-01 12:10 ` Ian Campbell [this message]
2015-09-29 16:21 ` [PATCH v2 7/7] xen/arm: platform: Drop the quirks callback Julien Grall
2015-09-29 16:55 ` Julien Grall
2015-10-01 12:10 ` Ian Campbell
2015-10-01 12:56 ` [PATCH v2 0/7] xen/arm: gic-v2: Detect automatically aliased GIC 400 Ian Campbell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1443701409.11707.31.camel@citrix.com \
--to=ian.campbell@citrix.com \
--cc=julien.grall@citrix.com \
--cc=stefano.stabellini@citrix.com \
--cc=xen-devel@lists.xenproject.org \
--cc=zoltan.kiss@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.