All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V3] xen: arm: X-Gene Storm check GIC DIST address for EOI quirk
@ 2015-04-29  9:38 Pranavkumar Sawargaonkar
  2015-04-29 11:00 ` Julien Grall
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Pranavkumar Sawargaonkar @ 2015-04-29  9:38 UTC (permalink / raw)
  To: xen-devel
  Cc: ian.campbell, patches, julien.grall, stefano.stabellini,
	christoffer.dall, Pranavkumar Sawargaonkar

In old X-Gene Storm firmware and DT, secure mode addresses have been
mentioned in GICv2 node. In this case maintenance interrupt is used
instead of EOI HW method.

This patch checks the GIC Distributor Base Address to enable EOI quirk
for old firmware.

Ref:
http://lists.xen.org/archives/html/xen-devel/2014-07/msg01263.html

Signed-off-by: Pranavkumar Sawargaonkar <pranavkumar@linaro.org>
Tested-by: Christoffer Dall <christoffer.dall@linaro.org>
---
ChangeLog:

V3:
- Indentation fixes and other misc comments on V2.
V2:
- Fine tune interrupt controller node search as per comments on V1 patch
- Incorporating other misc comments on V1.
V1:
- Initial patch.
---
 xen/arch/arm/platforms/xgene-storm.c |   40 +++++++++++++++++++++++++++++++++-
 1 file changed, 39 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/platforms/xgene-storm.c b/xen/arch/arm/platforms/xgene-storm.c
index 1812e5b..c717360 100644
--- a/xen/arch/arm/platforms/xgene-storm.c
+++ b/xen/arch/arm/platforms/xgene-storm.c
@@ -22,6 +22,7 @@
 #include <asm/platform.h>
 #include <xen/stdbool.h>
 #include <xen/vmap.h>
+#include <xen/device_tree.h>
 #include <asm/io.h>
 #include <asm/gic.h>
 
@@ -35,9 +36,44 @@ static u64 reset_addr, reset_size;
 static u32 reset_mask;
 static bool reset_vals_valid = false;
 
+#define XGENE_SEC_GICV2_DIST_ADDR    0x78010000
+static u32 __read_mostly xgene_quirks = PLATFORM_QUIRK_GIC_64K_STRIDE;
+
+static void __init xgene_check_pirq_eoi(void)
+{
+    const struct dt_device_node *node;
+    int res;
+    paddr_t dbase;
+    const struct dt_device_match xgene_dt_int_ctrl_match[] =
+    {
+        DT_MATCH_COMPATIBLE("arm,cortex-a15-gic"),
+        { /*sentinel*/ },
+    };
+
+    node = dt_find_interrupt_controller(xgene_dt_int_ctrl_match);
+    if ( !node )
+        panic("%s: Can not find interrupt controller node", __func__);
+
+    res = dt_device_get_address(node, 0, &dbase, NULL);
+    if ( !dbase )
+        panic("%s: Cannot find a valid address for the distributor", __func__);
+
+    /*
+     * In old X-Gene Storm firmware and DT, secure mode addresses have
+     * been mentioned in GICv2 node. We have to use maintenance interrupt
+     * instead of EOI HW in this case. We check the GIC Distributor Base
+     * Address to maintain compatibility with older firmware.
+     */
+    if ( dbase == XGENE_SEC_GICV2_DIST_ADDR )
+    {
+        xgene_quirks |= PLATFORM_QUIRK_GUEST_PIRQ_NEED_EOI;
+        printk("Xen: WARNING: OLD X-Gene Firmware, disabling PIRQ EOI mode\n");
+    }
+}
+
 static uint32_t xgene_storm_quirks(void)
 {
-    return PLATFORM_QUIRK_GIC_64K_STRIDE|PLATFORM_QUIRK_GUEST_PIRQ_NEED_EOI;
+    return xgene_quirks;
 }
 
 static int map_one_mmio(struct domain *d, const char *what,
@@ -216,6 +252,8 @@ static int xgene_storm_init(void)
     reset_mask = XGENE_RESET_MASK;
 
     reset_vals_valid = true;
+    xgene_check_pirq_eoi();
+
     return 0;
 }
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH V3] xen: arm: X-Gene Storm check GIC DIST address for EOI quirk
  2015-04-29  9:38 [PATCH V3] xen: arm: X-Gene Storm check GIC DIST address for EOI quirk Pranavkumar Sawargaonkar
@ 2015-04-29 11:00 ` Julien Grall
  2015-04-30 10:06 ` Stefano Stabellini
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 10+ messages in thread
From: Julien Grall @ 2015-04-29 11:00 UTC (permalink / raw)
  To: Pranavkumar Sawargaonkar, xen-devel
  Cc: julien.grall, stefano.stabellini, patches, ian.campbell,
	christoffer.dall

Hi Pranav,

On 29/04/15 10:38, Pranavkumar Sawargaonkar wrote:
> In old X-Gene Storm firmware and DT, secure mode addresses have been
> mentioned in GICv2 node. In this case maintenance interrupt is used
> instead of EOI HW method.
> 
> This patch checks the GIC Distributor Base Address to enable EOI quirk
> for old firmware.
> 
> Ref:
> http://lists.xen.org/archives/html/xen-devel/2014-07/msg01263.html
> 
> Signed-off-by: Pranavkumar Sawargaonkar <pranavkumar@linaro.org>
> Tested-by: Christoffer Dall <christoffer.dall@linaro.org>
Reviewed-by: Julien Grall <julien.grall@citrix.com>

Regards,

-- 
Julien Grall

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH V3] xen: arm: X-Gene Storm check GIC DIST address for EOI quirk
  2015-04-29  9:38 [PATCH V3] xen: arm: X-Gene Storm check GIC DIST address for EOI quirk Pranavkumar Sawargaonkar
  2015-04-29 11:00 ` Julien Grall
@ 2015-04-30 10:06 ` Stefano Stabellini
  2015-05-05 12:27 ` Ian Campbell
  2015-05-05 13:52 ` Julien Grall
  3 siblings, 0 replies; 10+ messages in thread
From: Stefano Stabellini @ 2015-04-30 10:06 UTC (permalink / raw)
  To: Pranavkumar Sawargaonkar
  Cc: ian.campbell, patches, xen-devel, julien.grall,
	stefano.stabellini, christoffer.dall

On Wed, 29 Apr 2015, Pranavkumar Sawargaonkar wrote:
> In old X-Gene Storm firmware and DT, secure mode addresses have been
> mentioned in GICv2 node. In this case maintenance interrupt is used
> instead of EOI HW method.
> 
> This patch checks the GIC Distributor Base Address to enable EOI quirk
> for old firmware.
> 
> Ref:
> http://lists.xen.org/archives/html/xen-devel/2014-07/msg01263.html
> 
> Signed-off-by: Pranavkumar Sawargaonkar <pranavkumar@linaro.org>
> Tested-by: Christoffer Dall <christoffer.dall@linaro.org>

Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>


> ChangeLog:
> 
> V3:
> - Indentation fixes and other misc comments on V2.
> V2:
> - Fine tune interrupt controller node search as per comments on V1 patch
> - Incorporating other misc comments on V1.
> V1:
> - Initial patch.
> ---
>  xen/arch/arm/platforms/xgene-storm.c |   40 +++++++++++++++++++++++++++++++++-
>  1 file changed, 39 insertions(+), 1 deletion(-)
> 
> diff --git a/xen/arch/arm/platforms/xgene-storm.c b/xen/arch/arm/platforms/xgene-storm.c
> index 1812e5b..c717360 100644
> --- a/xen/arch/arm/platforms/xgene-storm.c
> +++ b/xen/arch/arm/platforms/xgene-storm.c
> @@ -22,6 +22,7 @@
>  #include <asm/platform.h>
>  #include <xen/stdbool.h>
>  #include <xen/vmap.h>
> +#include <xen/device_tree.h>
>  #include <asm/io.h>
>  #include <asm/gic.h>
>  
> @@ -35,9 +36,44 @@ static u64 reset_addr, reset_size;
>  static u32 reset_mask;
>  static bool reset_vals_valid = false;
>  
> +#define XGENE_SEC_GICV2_DIST_ADDR    0x78010000
> +static u32 __read_mostly xgene_quirks = PLATFORM_QUIRK_GIC_64K_STRIDE;
> +
> +static void __init xgene_check_pirq_eoi(void)
> +{
> +    const struct dt_device_node *node;
> +    int res;
> +    paddr_t dbase;
> +    const struct dt_device_match xgene_dt_int_ctrl_match[] =
> +    {
> +        DT_MATCH_COMPATIBLE("arm,cortex-a15-gic"),
> +        { /*sentinel*/ },
> +    };
> +
> +    node = dt_find_interrupt_controller(xgene_dt_int_ctrl_match);
> +    if ( !node )
> +        panic("%s: Can not find interrupt controller node", __func__);
> +
> +    res = dt_device_get_address(node, 0, &dbase, NULL);
> +    if ( !dbase )
> +        panic("%s: Cannot find a valid address for the distributor", __func__);
> +
> +    /*
> +     * In old X-Gene Storm firmware and DT, secure mode addresses have
> +     * been mentioned in GICv2 node. We have to use maintenance interrupt
> +     * instead of EOI HW in this case. We check the GIC Distributor Base
> +     * Address to maintain compatibility with older firmware.
> +     */
> +    if ( dbase == XGENE_SEC_GICV2_DIST_ADDR )
> +    {
> +        xgene_quirks |= PLATFORM_QUIRK_GUEST_PIRQ_NEED_EOI;
> +        printk("Xen: WARNING: OLD X-Gene Firmware, disabling PIRQ EOI mode\n");
> +    }
> +}
> +
>  static uint32_t xgene_storm_quirks(void)
>  {
> -    return PLATFORM_QUIRK_GIC_64K_STRIDE|PLATFORM_QUIRK_GUEST_PIRQ_NEED_EOI;
> +    return xgene_quirks;
>  }
>  
>  static int map_one_mmio(struct domain *d, const char *what,
> @@ -216,6 +252,8 @@ static int xgene_storm_init(void)
>      reset_mask = XGENE_RESET_MASK;
>  
>      reset_vals_valid = true;
> +    xgene_check_pirq_eoi();
> +
>      return 0;
>  }
>  
> -- 
> 1.7.9.5
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH V3] xen: arm: X-Gene Storm check GIC DIST address for EOI quirk
  2015-04-29  9:38 [PATCH V3] xen: arm: X-Gene Storm check GIC DIST address for EOI quirk Pranavkumar Sawargaonkar
  2015-04-29 11:00 ` Julien Grall
  2015-04-30 10:06 ` Stefano Stabellini
@ 2015-05-05 12:27 ` Ian Campbell
  2015-05-05 13:52 ` Julien Grall
  3 siblings, 0 replies; 10+ messages in thread
From: Ian Campbell @ 2015-05-05 12:27 UTC (permalink / raw)
  To: Pranavkumar Sawargaonkar
  Cc: julien.grall, patches, stefano.stabellini, christoffer.dall, xen-devel

On Wed, 2015-04-29 at 15:08 +0530, Pranavkumar Sawargaonkar wrote:
> In old X-Gene Storm firmware and DT, secure mode addresses have been
> mentioned in GICv2 node. In this case maintenance interrupt is used
> instead of EOI HW method.
> 
> This patch checks the GIC Distributor Base Address to enable EOI quirk
> for old firmware.
> 
> Ref:
> http://lists.xen.org/archives/html/xen-devel/2014-07/msg01263.html
> 
> Signed-off-by: Pranavkumar Sawargaonkar <pranavkumar@linaro.org>
> Tested-by: Christoffer Dall <christoffer.dall@linaro.org>

Acked + applied, thanks.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH V3] xen: arm: X-Gene Storm check GIC DIST address for EOI quirk
  2015-04-29  9:38 [PATCH V3] xen: arm: X-Gene Storm check GIC DIST address for EOI quirk Pranavkumar Sawargaonkar
                   ` (2 preceding siblings ...)
  2015-05-05 12:27 ` Ian Campbell
@ 2015-05-05 13:52 ` Julien Grall
  2015-05-07  8:49   ` Pranavkumar Sawargaonkar
  3 siblings, 1 reply; 10+ messages in thread
From: Julien Grall @ 2015-05-05 13:52 UTC (permalink / raw)
  To: Pranavkumar Sawargaonkar, xen-devel
  Cc: julien.grall, stefano.stabellini, patches, ian.campbell,
	christoffer.dall

Hi Pranav,

On 29/04/15 10:38, Pranavkumar Sawargaonkar wrote:
> In old X-Gene Storm firmware and DT, secure mode addresses have been
> mentioned in GICv2 node. In this case maintenance interrupt is used
> instead of EOI HW method.
> 
> This patch checks the GIC Distributor Base Address to enable EOI quirk
> for old firmware.
> 
> Ref:
> http://lists.xen.org/archives/html/xen-devel/2014-07/msg01263.html

Do you know if the new firmware is publicly available?

Regards,

-- 
Julien Grall

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH V3] xen: arm: X-Gene Storm check GIC DIST address for EOI quirk
  2015-05-05 13:52 ` Julien Grall
@ 2015-05-07  8:49   ` Pranavkumar Sawargaonkar
  2015-05-07  9:41     ` Ian Campbell
  0 siblings, 1 reply; 10+ messages in thread
From: Pranavkumar Sawargaonkar @ 2015-05-07  8:49 UTC (permalink / raw)
  To: Julien Grall
  Cc: Stefano Stabellini, patches, Ian Campbell, Christoffer Dall, xen-devel

Hi Julien,

On 5 May 2015 at 19:22, Julien Grall <julien.grall@citrix.com> wrote:
> Hi Pranav,
>
> On 29/04/15 10:38, Pranavkumar Sawargaonkar wrote:
>> In old X-Gene Storm firmware and DT, secure mode addresses have been
>> mentioned in GICv2 node. In this case maintenance interrupt is used
>> instead of EOI HW method.
>>
>> This patch checks the GIC Distributor Base Address to enable EOI quirk
>> for old firmware.
>>
>> Ref:
>> http://lists.xen.org/archives/html/xen-devel/2014-07/msg01263.html
>
> Do you know if the new firmware is publicly available?

No there is no direct link available to download this. One has to got
through apm support to get this.

Thanks,
Pranav

>
> Regards,
>
> --
> Julien Grall

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH V3] xen: arm: X-Gene Storm check GIC DIST address for EOI quirk
  2015-05-07  8:49   ` Pranavkumar Sawargaonkar
@ 2015-05-07  9:41     ` Ian Campbell
  2015-05-07 11:12       ` Pranavkumar Sawargaonkar
  0 siblings, 1 reply; 10+ messages in thread
From: Ian Campbell @ 2015-05-07  9:41 UTC (permalink / raw)
  To: Pranavkumar Sawargaonkar
  Cc: Julien Grall, Stefano Stabellini, patches, Christoffer Dall, xen-devel

On Thu, 2015-05-07 at 14:19 +0530, Pranavkumar Sawargaonkar wrote:
> Hi Julien,
> 
> On 5 May 2015 at 19:22, Julien Grall <julien.grall@citrix.com> wrote:
> > Hi Pranav,
> >
> > On 29/04/15 10:38, Pranavkumar Sawargaonkar wrote:
> >> In old X-Gene Storm firmware and DT, secure mode addresses have been
> >> mentioned in GICv2 node. In this case maintenance interrupt is used
> >> instead of EOI HW method.
> >>
> >> This patch checks the GIC Distributor Base Address to enable EOI quirk
> >> for old firmware.
> >>
> >> Ref:
> >> http://lists.xen.org/archives/html/xen-devel/2014-07/msg01263.html
> >
> > Do you know if the new firmware is publicly available?
> 
> No there is no direct link available to download this. One has to got
> through apm support to get this.

Is it available on request to anybody who has a Mustang system? Or only
to e.g. partners?

It would be a shame if not because while the quirk is buggy in various
ways it is better than nothing, but we would all much prefer to ditch it
if possible.

Ian.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH V3] xen: arm: X-Gene Storm check GIC DIST address for EOI quirk
  2015-05-07  9:41     ` Ian Campbell
@ 2015-05-07 11:12       ` Pranavkumar Sawargaonkar
  2015-05-07 11:50         ` Julien Grall
  0 siblings, 1 reply; 10+ messages in thread
From: Pranavkumar Sawargaonkar @ 2015-05-07 11:12 UTC (permalink / raw)
  To: Ian Campbell
  Cc: Julien Grall, Stefano Stabellini, patches, Christoffer Dall, xen-devel

Hi Ian,

On 7 May 2015 at 15:11, Ian Campbell <ian.campbell@citrix.com> wrote:
> On Thu, 2015-05-07 at 14:19 +0530, Pranavkumar Sawargaonkar wrote:
>> Hi Julien,
>>
>> On 5 May 2015 at 19:22, Julien Grall <julien.grall@citrix.com> wrote:
>> > Hi Pranav,
>> >
>> > On 29/04/15 10:38, Pranavkumar Sawargaonkar wrote:
>> >> In old X-Gene Storm firmware and DT, secure mode addresses have been
>> >> mentioned in GICv2 node. In this case maintenance interrupt is used
>> >> instead of EOI HW method.
>> >>
>> >> This patch checks the GIC Distributor Base Address to enable EOI quirk
>> >> for old firmware.
>> >>
>> >> Ref:
>> >> http://lists.xen.org/archives/html/xen-devel/2014-07/msg01263.html
>> >
>> > Do you know if the new firmware is publicly available?
>>
>> No there is no direct link available to download this. One has to got
>> through apm support to get this.
>
> Is it available on request to anybody who has a Mustang system? Or only
> to e.g. partners?
>

As far as my knowledge it is available to the people having mustang
(and also to partners) on a request.

-
 Pranav

> It would be a shame if not because while the quirk is buggy in various
> ways it is better than nothing, but we would all much prefer to ditch it
> if possible.
>
> Ian.
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH V3] xen: arm: X-Gene Storm check GIC DIST address for EOI quirk
  2015-05-07 11:12       ` Pranavkumar Sawargaonkar
@ 2015-05-07 11:50         ` Julien Grall
  2015-05-08  7:16           ` Pranavkumar Sawargaonkar
  0 siblings, 1 reply; 10+ messages in thread
From: Julien Grall @ 2015-05-07 11:50 UTC (permalink / raw)
  To: Pranavkumar Sawargaonkar, Ian Campbell
  Cc: Julien Grall, patches, Stefano Stabellini, Christoffer Dall, xen-devel

Hi Pranav,

On 07/05/15 12:12, Pranavkumar Sawargaonkar wrote:
> On 7 May 2015 at 15:11, Ian Campbell <ian.campbell@citrix.com> wrote:
>> On Thu, 2015-05-07 at 14:19 +0530, Pranavkumar Sawargaonkar wrote:
>>> Hi Julien,
>>>
>>> On 5 May 2015 at 19:22, Julien Grall <julien.grall@citrix.com> wrote:
>>>> Hi Pranav,
>>>>
>>>> On 29/04/15 10:38, Pranavkumar Sawargaonkar wrote:
>>>>> In old X-Gene Storm firmware and DT, secure mode addresses have been
>>>>> mentioned in GICv2 node. In this case maintenance interrupt is used
>>>>> instead of EOI HW method.
>>>>>
>>>>> This patch checks the GIC Distributor Base Address to enable EOI quirk
>>>>> for old firmware.
>>>>>
>>>>> Ref:
>>>>> http://lists.xen.org/archives/html/xen-devel/2014-07/msg01263.html
>>>>
>>>> Do you know if the new firmware is publicly available?
>>>
>>> No there is no direct link available to download this. One has to got
>>> through apm support to get this.
>>
>> Is it available on request to anybody who has a Mustang system? Or only
>> to e.g. partners?
>>
> 
> As far as my knowledge it is available to the people having mustang
> (and also to partners) on a request.

Thanks. I will send a patch to drop the EOI quirk and panic if the user
is using an old firmware.

Regards,

-- 
Julien Grall

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH V3] xen: arm: X-Gene Storm check GIC DIST address for EOI quirk
  2015-05-07 11:50         ` Julien Grall
@ 2015-05-08  7:16           ` Pranavkumar Sawargaonkar
  0 siblings, 0 replies; 10+ messages in thread
From: Pranavkumar Sawargaonkar @ 2015-05-08  7:16 UTC (permalink / raw)
  To: Julien Grall
  Cc: patches, Stefano Stabellini, Ian Campbell, Christoffer Dall, xen-devel

Hi Julien,

On 7 May 2015 at 17:20, Julien Grall <julien.grall@citrix.com> wrote:
> Hi Pranav,
>
> On 07/05/15 12:12, Pranavkumar Sawargaonkar wrote:
>> On 7 May 2015 at 15:11, Ian Campbell <ian.campbell@citrix.com> wrote:
>>> On Thu, 2015-05-07 at 14:19 +0530, Pranavkumar Sawargaonkar wrote:
>>>> Hi Julien,
>>>>
>>>> On 5 May 2015 at 19:22, Julien Grall <julien.grall@citrix.com> wrote:
>>>>> Hi Pranav,
>>>>>
>>>>> On 29/04/15 10:38, Pranavkumar Sawargaonkar wrote:
>>>>>> In old X-Gene Storm firmware and DT, secure mode addresses have been
>>>>>> mentioned in GICv2 node. In this case maintenance interrupt is used
>>>>>> instead of EOI HW method.
>>>>>>
>>>>>> This patch checks the GIC Distributor Base Address to enable EOI quirk
>>>>>> for old firmware.
>>>>>>
>>>>>> Ref:
>>>>>> http://lists.xen.org/archives/html/xen-devel/2014-07/msg01263.html
>>>>>
>>>>> Do you know if the new firmware is publicly available?
>>>>
>>>> No there is no direct link available to download this. One has to got
>>>> through apm support to get this.
>>>
>>> Is it available on request to anybody who has a Mustang system? Or only
>>> to e.g. partners?
>>>
>>
>> As far as my knowledge it is available to the people having mustang
>> (and also to partners) on a request.
>
> Thanks. I will send a patch to drop the EOI quirk and panic if the user
> is using an old firmware.

Sure, this is a good idea.

-
Pranav
>
> Regards,
>
> --
> Julien Grall

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-05-08  7:16 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-29  9:38 [PATCH V3] xen: arm: X-Gene Storm check GIC DIST address for EOI quirk Pranavkumar Sawargaonkar
2015-04-29 11:00 ` Julien Grall
2015-04-30 10:06 ` Stefano Stabellini
2015-05-05 12:27 ` Ian Campbell
2015-05-05 13:52 ` Julien Grall
2015-05-07  8:49   ` Pranavkumar Sawargaonkar
2015-05-07  9:41     ` Ian Campbell
2015-05-07 11:12       ` Pranavkumar Sawargaonkar
2015-05-07 11:50         ` Julien Grall
2015-05-08  7:16           ` Pranavkumar Sawargaonkar

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.