All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [PATCH 1/2] xen/arm: save/restore irq flags in gic_disable_cpu
Date: Tue, 16 Apr 2013 11:39:22 +0100	[thread overview]
Message-ID: <516D2A5A.9020204@citrix.com> (raw)
In-Reply-To: <1366103569.8399.125.camel@zakaz.uk.xensource.com>

On 04/16/2013 10:12 AM, Ian Campbell wrote:

> On Mon, 2013-04-15 at 17:50 +0100, Julien Grall wrote:
>> On SMP board, gic_disable_cpu is called by an SGI call function when Xen is
>> halting. In this specific case, the interrupts are disabled.
> 
> In the only other existing caller (__cpu_disable) interrupts are also
> disabled and I'd argue that it would be invalid to call this function
> with interrupts enabled due to its nature. I think it should start with
> an assert to that effect.

Indeed, I didn't pay attention that interrupts are disabled in
__cpu_disable. I will use spin_lock and add an assert.


>> Signed-off-by: Julien Grall <julien.grall@citrix.com>
>> ---
>>  xen/arch/arm/gic.c |    6 ++++--
>>  1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
>> index aa179a9..c9f64f1 100644
>> --- a/xen/arch/arm/gic.c
>> +++ b/xen/arch/arm/gic.c
>> @@ -419,10 +419,12 @@ void __cpuinit gic_init_secondary_cpu(void)
>>  /* Shut down the per-CPU GIC interface */
>>  void gic_disable_cpu(void)
>>  {
>> -    spin_lock_irq(&gic.lock);
>> +    unsigned long flags;
>> +
>> +    spin_lock_irqsave(&gic.lock, flags);
>>      gic_cpu_disable();
> 
> So we apparently have gic_cpu_disable and gic_disable_cpu, nice!
> 
> Since the only caller of gic_cpu_disable is gic_disable_cpu I think we
> should just inline it. Or call it gic_(cpu_)disable_gicc
> 
>>      gic_hyp_disable();
> 
> Likewise this is the only caller of this function, either inline or
> gic_(cpu)disable_gich?


If we modify the name, we also need to modify gic_{hyp,cpu,dist}_init.
I would prefer to let in state or rename all the functions. It's clearer
to have separate functions (init and disable) for each part of the gic.

Julien

  reply	other threads:[~2013-04-16 10:39 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-15 16:50 [PATCH 0/2] xen/arm: implement smp_call_function Julien Grall
2013-04-15 16:50 ` [PATCH 1/2] xen/arm: save/restore irq flags in gic_disable_cpu Julien Grall
2013-04-16  9:12   ` Ian Campbell
2013-04-16 10:39     ` Julien Grall [this message]
2013-04-16 11:02       ` Ian Campbell
2013-04-15 16:50 ` [PATCH 2/2] xen/arm: implement smp_call_function Julien Grall
2013-04-16  9:24   ` Ian Campbell
2013-04-16 10:54     ` Julien Grall
2013-04-16 11:04       ` 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=516D2A5A.9020204@citrix.com \
    --to=julien.grall@citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --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.