All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@linaro.org>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: stefano.stabellini@eu.citrix.com, patches@linaro.org,
	xen-devel@lists.xen.org
Subject: Re: [PATCH 3/7] xen/arm: Initialize correctly IRQ routing
Date: Tue, 10 Sep 2013 16:26:48 +0100	[thread overview]
Message-ID: <522F3A38.7010205@linaro.org> (raw)
In-Reply-To: <1378732639.19967.128.camel@kazak.uk.xensource.com>

On 09/09/2013 02:17 PM, Ian Campbell wrote:
> On Fri, 2013-08-30 at 14:30 +0100, Julien Grall wrote:
>> When Xen initialize the GIC distributor, we need to route all the IRQs to
>> the boot CPU. The CPU ID can differ between Xen and the GIC.
>>
>> When ITARGETSR0 is read, each field will return a value that corresponds
>> only to the processor reading the register.
> 
> This trick is used a few times in this series, is it really the best way
> to figure this out?
> Not in some ID register or in DT?

Unfortunately not. On the patch #4, I introduce an array to store the
mapping between logical ID and gic ID.
I didn't use this trick here, because the distributor is initialized
before each cpu interface.

>>  So Xen can use the PPI 0 to
>> initialize correctly the routing.
>>
>> Signed-off-by: Julien Grall <julien.grall@linaro.org>
>> ---
>>  xen/arch/arm/gic.c |    3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
>> index 37a73fb..cadc258 100644
>> --- a/xen/arch/arm/gic.c
>> +++ b/xen/arch/arm/gic.c
>> @@ -275,9 +275,10 @@ void gic_route_dt_irq(const struct dt_irq *irq, const cpumask_t *cpu_mask,
>>  static void __init gic_dist_init(void)
>>  {
>>      uint32_t type;
>> -    uint32_t cpumask = 1 << smp_processor_id();
>> +    uint32_t cpumask;
>>      int i;
>>  
>> +    cpumask = GICD[GICD_ITARGETSR] & 0xff;
>>      cpumask |= cpumask << 8;
>>      cpumask |= cpumask << 16;
>>  
> 
> 


-- 
Julien Grall

  reply	other threads:[~2013-09-10 15:26 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-30 13:30 [PATCH 0/7] Dissociate logical and gic/hardware CPUD ID Julien Grall
2013-08-30 13:30 ` [PATCH 1/7] xen/arm: Introduce MPIDR_HWID_MASK Julien Grall
2013-09-09 13:09   ` Ian Campbell
2013-09-09 14:06     ` Ian Campbell
2013-08-30 13:30 ` [PATCH 2/7] xen/arm: use cpumask_t to describe cpu mask in gic_route_dt_irq Julien Grall
2013-09-09 13:14   ` Ian Campbell
2013-09-10 15:09     ` Julien Grall
2013-08-30 13:30 ` [PATCH 3/7] xen/arm: Initialize correctly IRQ routing Julien Grall
2013-09-09 13:17   ` Ian Campbell
2013-09-10 15:26     ` Julien Grall [this message]
2013-09-10 15:29     ` Julien Grall
2013-09-10 15:36       ` Ian Campbell
2013-08-30 13:30 ` [PATCH 4/7] xen/arm: gic: Use the correct CPU ID Julien Grall
2013-09-09 13:28   ` Ian Campbell
2013-09-10 15:42     ` Julien Grall
2013-09-10 15:52       ` Ian Campbell
2013-09-10 16:45         ` Julien Grall
2013-09-10 16:48           ` Ian Campbell
2013-08-30 13:30 ` [PATCH 5/7] xen/arm: Fix assert in send_SGI_one Julien Grall
2013-09-09 13:30   ` Ian Campbell
2013-09-10 15:47     ` Julien Grall
2013-08-30 13:30 ` [PATCH 6/7] xen/arm: Dissociate logical and hardware CPU ID Julien Grall
2013-09-09 13:38   ` Ian Campbell
2013-09-10 16:18     ` Julien Grall
2013-08-30 13:30 ` [PATCH 7/7] xen/arm: Use the hardware ID TMP boot correctly secondary cpus Julien Grall
2013-09-09 13:40   ` Ian Campbell
2013-09-10 16:24     ` Julien Grall

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=522F3A38.7010205@linaro.org \
    --to=julien.grall@linaro.org \
    --cc=Ian.Campbell@citrix.com \
    --cc=patches@linaro.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --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 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.