xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@linaro.org>
To: Ian Campbell <ian.campbell@citrix.com>, xen-devel@lists.xen.org
Cc: pranavkumar@linaro.org, tim@xen.org,
	Anup Patel <anup.patel@linaro.org>,
	stefano.stabellini@eu.citrix.com
Subject: Re: [PATCH v2 04/15] xen: arm: add a quirk to handle platforms with unusual GIC layout
Date: Fri, 22 Nov 2013 16:46:28 +0000	[thread overview]
Message-ID: <528F8A64.4040807@linaro.org> (raw)
In-Reply-To: <1385137474-31245-4-git-send-email-ian.campbell@citrix.com>



On 11/22/2013 04:24 PM, Ian Campbell wrote:
> Use this quirk on the xgene platform.

With this quirk you only fix xen GIC. What about dom0/guest GIC ? I know 
that Linux is not using the secondary page, but we expose 2 pages 
contiguous page. With this quirk the first page is valid ... but the 
second page could belong to another device.

Can we remove the second page when the quirk is enabled?

> This should ideally be fixed by an extension to the device tree bindings as
> described in http://www.spinics.net/lists/devicetree/msg10473.html especially
> http://www.spinics.net/lists/devicetree/msg10478.html. However for the time
> being a platform specific quirk will do.
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> ---
> v2: This replaces "xen: arm: GICC_DIR register at offset 0x10000 instead of 0x1000"
> ---
>   xen/arch/arm/gic.c                   |    6 +++++-
>   xen/arch/arm/platforms/xgene-storm.c |    2 +-
>   xen/include/asm-arm/platform.h       |    5 +++++
>   3 files changed, 11 insertions(+), 2 deletions(-)
>
> diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
> index ab49106..9711f5d 100644
> --- a/xen/arch/arm/gic.c
> +++ b/xen/arch/arm/gic.c
> @@ -30,6 +30,7 @@
>   #include <xen/device_tree.h>
>   #include <asm/p2m.h>
>   #include <asm/domain.h>
> +#include <asm/platform.h>
>
>   #include <asm/gic.h>
>
> @@ -444,7 +445,10 @@ void __init gic_init(void)
>       BUILD_BUG_ON(FIXMAP_ADDR(FIXMAP_GICC1) !=
>                    FIXMAP_ADDR(FIXMAP_GICC2)-PAGE_SIZE);
>       set_fixmap(FIXMAP_GICC1, gic.cbase >> PAGE_SHIFT, DEV_SHARED);
> -    set_fixmap(FIXMAP_GICC2, (gic.cbase >> PAGE_SHIFT) + 1, DEV_SHARED);
> +    if ( platform_has_quirk(PLATFORM_QUIRK_GIC_64K_STRIDE) )
> +        set_fixmap(FIXMAP_GICC2, (gic.cbase >> PAGE_SHIFT) + 0x10, DEV_SHARED);
> +    else
> +        set_fixmap(FIXMAP_GICC2, (gic.cbase >> PAGE_SHIFT) + 0x1, DEV_SHARED);
>       set_fixmap(FIXMAP_GICH, gic.hbase >> PAGE_SHIFT, DEV_SHARED);
>
>       /* Global settings: interrupt distributor */
> diff --git a/xen/arch/arm/platforms/xgene-storm.c b/xen/arch/arm/platforms/xgene-storm.c
> index 727ac2b..d185a4a 100644
> --- a/xen/arch/arm/platforms/xgene-storm.c
> +++ b/xen/arch/arm/platforms/xgene-storm.c
> @@ -27,7 +27,7 @@
>
>   static uint32_t xgene_storm_quirks(void)
>   {
> -    return PLATFORM_QUIRK_DOM0_MAPPING_11;
> +    return PLATFORM_QUIRK_DOM0_MAPPING_11|PLATFORM_QUIRK_GIC_64K_STRIDE;
>   }
>
>
> diff --git a/xen/include/asm-arm/platform.h b/xen/include/asm-arm/platform.h
> index c282b30..c9314e5 100644
> --- a/xen/include/asm-arm/platform.h
> +++ b/xen/include/asm-arm/platform.h
> @@ -44,6 +44,11 @@ struct platform_desc {
>    * Useful on platform where System MMU is not yet implemented
>    */
>   #define PLATFORM_QUIRK_DOM0_MAPPING_11 (1 << 0)
> +/*
> + * Quirk for platforms where the 4K GIC register ranges are placed at
> + * 64K stride.
> + */
> +#define PLATFORM_QUIRK_GIC_64K_STRIDE (1 << 1)
>
>   void __init platform_init(void);
>   int __init platform_init_time(void);
>

-- 
Julien Grall

  reply	other threads:[~2013-11-22 16:46 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <foo>
2013-11-22 16:24 ` [PATCH v2 01/15] xen: arm64: Add 8250 earlyprintk support Ian Campbell
2013-11-22 16:27   ` [PATCH 00/15] xen: arm initial support for xgene arm64 platform Ian Campbell
2013-11-22 17:02     ` George Dunlap
2013-11-22 17:09       ` Ian Campbell
2013-11-29 10:30         ` Ian Campbell
2013-11-22 16:29   ` [PATCH v2 01/15] xen: arm64: Add 8250 earlyprintk support Julien Grall
2013-11-22 16:24 ` [PATCH v2 02/15] xen: arm64: Add Basic Platform support for APM X-Gene Storm Ian Campbell
2013-11-22 16:35   ` Julien Grall
2013-11-22 16:43     ` Ian Campbell
2013-11-22 16:24 ` [PATCH v2 03/15] xen: arm64: Add APM implementor id to processor implementers Ian Campbell
2013-11-22 16:24 ` [PATCH v2 04/15] xen: arm: add a quirk to handle platforms with unusual GIC layout Ian Campbell
2013-11-22 16:46   ` Julien Grall [this message]
2013-11-22 17:03     ` Ian Campbell
2013-11-22 17:10       ` Julien Grall
2013-11-22 17:16         ` Ian Campbell
2013-11-22 16:46   ` George Dunlap
2013-11-22 16:24 ` [PATCH v2 05/15] xen: arm: allow platform code to select dom0 event channel irq Ian Campbell
2013-11-22 16:48   ` George Dunlap
2013-11-22 17:01   ` Julien Grall
2013-11-22 16:24 ` [PATCH v2 06/15] xen: arm64: Map xgene PCI memory regions and interrupts to dom0 Ian Campbell
2013-11-22 16:50   ` George Dunlap
2013-11-22 16:59   ` Julien Grall
2013-11-22 17:13     ` Ian Campbell
2013-11-22 17:17       ` Julien Grall
2013-11-22 16:24 ` [PATCH v2 07/15] xen: arm: include ns16550 driver on arm64 too Ian Campbell
2013-11-22 16:24 ` [PATCH v2 08/15] xen: arm: early logging of command line Ian Campbell
2013-11-22 17:04   ` Ian Campbell
2013-11-22 16:24 ` [PATCH v2 09/15] xen: arm: Handle cpus nodes with #address-cells > 1 Ian Campbell
2013-11-22 16:59   ` George Dunlap
2013-11-22 17:22   ` Julien Grall
2013-11-22 17:50     ` Ian Campbell
2013-11-22 16:24 ` [PATCH v2 10/15] xen: arm: Make register bit definitions unsigned Ian Campbell
2013-11-22 17:23   ` Julien Grall
2013-11-22 16:24 ` [PATCH v2 11/15] xen: arm: explicitly map 64 bit release address Ian Campbell
2013-11-22 16:24 ` [PATCH v2 12/15] xen: arm: enable synchronous console while starting secondary CPUs Ian Campbell
2013-11-22 17:36   ` Julien Grall
2013-11-22 17:49     ` Ian Campbell
2013-11-22 16:24 ` [PATCH v2 13/15] xen: arm: Add debug keyhandler to dump the physical GIC state Ian Campbell
2013-11-22 16:37   ` Ian Campbell
2013-11-22 16:24 ` [PATCH v2 14/15] xen: arm: improve early memory map readability Ian Campbell
2013-11-22 16:24 ` [PATCH v2 15/15] xen: arm: handle 40-bit addresses in the p2m Ian Campbell
2013-11-28 17:41   ` Stefano Stabellini
2013-11-28 17:45     ` 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=528F8A64.4040807@linaro.org \
    --to=julien.grall@linaro.org \
    --cc=anup.patel@linaro.org \
    --cc=ian.campbell@citrix.com \
    --cc=pranavkumar@linaro.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xen.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).