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>
Cc: stefano.stabellini@eu.citrix.com, patches@linaro.org,
	xen-devel@lists.xen.org
Subject: Re: [PATCH v3 3/6] xen/arm: gic: Use the correct CPU ID
Date: Fri, 20 Sep 2013 14:49:09 +0100	[thread overview]
Message-ID: <523C5255.9010705@linaro.org> (raw)
In-Reply-To: <1379684183.8994.6.camel@hastur.hellion.org.uk>

On 09/20/2013 02:36 PM, Ian Campbell wrote:
> On Fri, 2013-09-20 at 13:44 +0100, Julien Grall wrote:
>>> diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
>>> index b969d23..4061691 100644
>>> --- a/xen/arch/arm/gic.c
>>> +++ b/xen/arch/arm/gic.c
>>> @@ -57,6 +57,29 @@ static DEFINE_PER_CPU(uint64_t, lr_mask);
>>>  
>>>  static unsigned nr_lrs;
>>>  
>>> +/* The GIC mapping of CPU interfaces does not necessarily match the
>>> + * logical CPU numbering. Let's use mapping as returned by the GIC
>>> + * itself
>>> + */
>>> +static DEFINE_PER_CPU(u8, gic_cpu_id);
>>> +
>>
>> Following the discussion on another thread
>> (http://lists.xen.org/archives/html/xen-devel/2013-09/msg02072.html), we
>> need to initialize each CPU ID to 0xff by default, to be able to bring
>> up secondary CPUs with an SGI (send_SGI_mask).
> 
> We may as well use the send_SGI_allbutself mechanism, which doesn't rely
> on knowing and target ids.
>> But as I understand, per_cpu area for a give area is initialized in
>> cpu_up and there is no way to give a default value. So user could call
>> send_SGI_mask to early function and use an invalid CPU area.
> 
> If we need to go down this path then I would write something like
> 	cpu_online(cpu) ? this_cpu(thing, cpu) :  0xff
> but I don't think we need to because we can easily avoid the problem.
> 
>> IMHO, this solution is too fragile and I would like to use the same
>> solution as my first version (ie with an array of 8 cells).
> 
> I think cpu bring up should use allbutself and the other callers can
> reasonable be restricted to only operate on cpus which are up and
> therefore have a valid mask already allocated and initialised.


Ok, so I will, at least, add a comment in the gic code to explain this
restriction.

-- 
Julien Grall

  reply	other threads:[~2013-09-20 13:49 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-18 13:15 [PATCH v3 0/6] Dissociate logical and gic/hardware CPU ID Julien Grall
2013-09-18 13:15 ` [PATCH v3 1/6] xen/arm: use cpumask_t to describe cpu mask in gic_route_dt_irq Julien Grall
2013-09-25 15:36   ` Ian Campbell
2013-09-18 13:15 ` [PATCH v3 2/6] xen/arm: Initialize correctly IRQ routing Julien Grall
2013-09-25 15:37   ` Ian Campbell
2013-09-18 13:15 ` [PATCH v3 3/6] xen/arm: gic: Use the correct CPU ID Julien Grall
2013-09-20 12:44   ` Julien Grall
2013-09-20 13:36     ` Ian Campbell
2013-09-20 13:49       ` Julien Grall [this message]
2013-09-20 15:03   ` Julien Grall
2013-09-20 15:44     ` Ian Campbell
2013-09-20 15:58       ` Julien Grall
2013-09-20 16:06         ` Ian Campbell
2013-09-20 18:48           ` Julien Grall
2013-09-25 15:35     ` Ian Campbell
2013-09-25 15:42       ` Julien Grall
2013-09-25 15:48         ` Ian Campbell
2013-09-25 15:53           ` Ian Campbell
2013-09-25 16:34             ` Tim Deegan
2013-09-18 13:15 ` [PATCH v3 4/6] xen/arm: Fix assert in send_SGI_one Julien Grall
2013-09-25 15:37   ` Ian Campbell
2013-09-18 13:15 ` [PATCH v3 5/6] xen/arm: Dissociate logical and hardware CPU ID Julien Grall
2013-09-25 15:38   ` Ian Campbell
2013-09-18 13:15 ` [PATCH v3 6/6] xen/arm: Use the hardware ID to boot correctly secondary cpus Julien Grall
2013-09-25 15:41   ` Ian Campbell
2013-09-26 10:18     ` 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=523C5255.9010705@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 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).