All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vijay Kilari <vijay.kilari@gmail.com>
To: Julien Grall <julien.grall@linaro.org>
Cc: Ian Campbell <Ian.Campbell@citrix.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	Prasun Kapoor <Prasun.Kapoor@caviumnetworks.com>,
	Vijaya Kumar K <vijaya.kumar@caviumnetworks.com>,
	xen-devel@lists.xen.org,
	Stefano Stabellini <stefano.stabellini@citrix.com>
Subject: Re: [PATCH v2 05/15] xen/arm: segregate GIC low level functionality
Date: Wed, 9 Apr 2014 17:04:52 +0530	[thread overview]
Message-ID: <CALicx6uUf==dm-sFugpzu1fHgr+38ZKK5OR=gx141p_1e0uTsg@mail.gmail.com> (raw)
In-Reply-To: <534509EF.9010506@linaro.org>

On Wed, Apr 9, 2014 at 2:20 PM, Julien Grall <julien.grall@linaro.org> wrote:
>
> Hello Vijaya,
>
>
> On 04/04/14 12:56, vijay.kilari@gmail.com wrote:
>>
>> +static void gic_send_sgi(const cpumask_t *cpumask, enum gic_sgi sgi)
>>   {
>>       unsigned int mask = 0;
>>       cpumask_t online_mask;
>> @@ -498,30 +606,26 @@ void send_SGI_mask(const cpumask_t *cpumask, enum
>> gic_sgi sgi)
>>           | sgi;
>>   }
>>
>> -void send_SGI_one(unsigned int cpu, enum gic_sgi sgi)
>> +void send_SGI_mask(const cpumask_t *cpumask, enum gic_sgi sgi)
>>   {
>> -    ASSERT(cpu < NR_GIC_CPU_IF);  /* Targets bitmap only supports 8 CPUs
>> */
>> -    send_SGI_mask(cpumask_of(cpu), sgi);
>> +   gic_hw_ops->send_sgi(cpumask, sgi);
>>   }
>>
>> -void send_SGI_self(enum gic_sgi sgi)
>> +void send_SGI_one(unsigned int cpu, enum gic_sgi sgi)
>>   {
>> -    ASSERT(sgi < 16); /* There are only 16 SGIs */
>> -
>> -    dsb(sy);
>> -
>> -    GICD[GICD_SGIR] = GICD_SGI_TARGET_SELF
>> -        | sgi;
>> +    ASSERT(cpu < NR_GIC_CPU_IF);  /* Targets bitmap only supports 8 CPUs
>> */
>> +    send_SGI_mask(cpumask_of(cpu), sgi);
>>   }
>>
>>   void send_SGI_allbutself(enum gic_sgi sgi)
>>   {
>> -   ASSERT(sgi < 16); /* There are only 16 SGIs */
>> +    cpumask_t all_others_mask;
>> +    ASSERT(sgi < 16); /* There are only 16 SGIs */
>>
>> -   dsb(sy);
>> +    cpumask_andnot(&all_others_mask, &cpu_possible_map,
>> cpumask_of(smp_processor_id()));
>>
>> -   GICD[GICD_SGIR] = GICD_SGI_TARGET_OTHERS
>> -       | sgi;
>> +    dsb(sy);
>> +    send_SGI_mask(&all_others_mask, sgi);
>>   }
>
>
> As I said in V1, this change breaks SMP boot with GICv2...
>
> GICD_SGI_TARGERT_OTHERS will send an SGI to every CPUs even if the CPU is
> not yet online (i.e. not registered by Xen). It's used during secondary boot
> (cpu_up_send_sgi).


cpumask_andnot(&all_others_mask,
&cpu_possible_map,cpumask_of(smp_processor_id()));

In my understanding, with the above statement, I am using
cpu_possible_map (all possible cpu's) which should
contains all the cpu possible cpu masks. so this is fine.

The issue could be in gic_send_sgi() call which is always "and" with
cpu_online_map

static void gic_send_sgi(const cpumask_t *cpumask, enum gic_sgi sgi)
{
    unsigned int mask = 0;
    cpumask_t online_mask;

    ASSERT(sgi < 16); /* There are only 16 SGIs */

    cpumask_and(&online_mask, cpumask, &cpu_online_map);
    mask = gic_cpu_mask(&online_mask);

    dsb(sy);

    GICD[GICD_SGIR] = GICD_SGI_TARGET_LIST
        | (mask<<GICD_SGI_TARGET_SHIFT)
        | sgi;
}

I think gic_send_sgi should be passed with absolute mask value
and get rid of and'ing with cpu_online_map

> Your solution won't work because send_SGI_mask only deal with online CPU.
>
> All the changes of send_sgi is more than splitting functions... this should
> be moved on another patch and you should justify the modifications.
>

I will check if I could make this fix in a separate patch.

> [..]
>
>
>>   int gic_route_irq_to_guest(struct domain *d, const struct dt_irq *irq,
>> @@ -921,10 +1046,10 @@ out:
>>       return retval;
>>   }
>>
>> -static void do_sgi(struct cpu_user_regs *regs, int othercpu, enum gic_sgi
>> sgi)
>> +static void do_sgi(struct cpu_user_regs *regs, enum gic_sgi sgi)
>
>
> Why did you drop the othercpu here?
>
othercpu is not used at all. and also othercpu is computed with
IAR fields #defines which is not required in this generic code.

> Again, please justify every change on the prototype of every functions. If
> it's not trivial, split in small patches...
>
> --
> Julien Grall

  reply	other threads:[~2014-04-09 11:34 UTC|newest]

Thread overview: 100+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-04 11:56 [PATCH v2 00/15] xen/arm: Add GICv3 support vijay.kilari
2014-04-04 11:56 ` [PATCH v2 01/15] xen/arm: register mmio handler at runtime vijay.kilari
2014-04-04 12:18   ` Julien Grall
2014-04-04 12:30     ` Vijay Kilari
2014-04-04 12:42       ` Ian Campbell
2014-04-04 12:54         ` Julien Grall
2014-04-04 12:59           ` Ian Campbell
2014-04-04 13:06             ` Julien Grall
2014-04-04 12:59       ` Julien Grall
2014-04-08  4:47         ` Vijay Kilari
2014-04-08 10:17           ` Julien Grall
2014-04-08 10:34             ` Vijay Kilari
2014-04-08 10:51               ` Julien Grall
2014-04-08 11:41                 ` Vijay Kilari
2014-04-08 12:29                   ` Ian Campbell
2014-04-04 15:24       ` Vijay Kilari
2014-04-04 15:27         ` Julien Grall
2014-04-08  6:35           ` Vijay Kilari
2014-04-08 10:25             ` Julien Grall
2014-04-09 15:34       ` Ian Campbell
2014-04-04 11:56 ` [PATCH v2 02/15] xen/arm: move vgic rank data to gic header file vijay.kilari
2014-04-04 13:16   ` Julien Grall
2014-04-04 15:27     ` Vijay Kilari
2014-04-04 11:56 ` [PATCH v2 03/15] arm/xen: move gic save and restore registers to gic driver vijay.kilari
2014-04-04 13:23   ` Julien Grall
2014-04-09 16:51   ` Ian Campbell
2014-04-10  4:50     ` Vijay Kilari
2014-04-10  8:32       ` Ian Campbell
2014-04-04 11:56 ` [PATCH v2 04/15] xen/arm: move gic definitions to seperate file vijay.kilari
2014-04-04 13:27   ` Julien Grall
2014-04-04 15:29     ` Vijay Kilari
2014-04-04 15:37       ` Julien Grall
2014-04-09 15:41       ` Ian Campbell
2014-04-04 11:56 ` [PATCH v2 05/15] xen/arm: segregate GIC low level functionality vijay.kilari
2014-04-04 13:55   ` Julien Grall
2014-04-09  7:43     ` Vijay Kilari
2014-04-09  8:36       ` Julien Grall
2014-04-09 15:55         ` Ian Campbell
2014-04-09 17:00     ` Ian Campbell
2014-04-09 17:07       ` Julien Grall
2014-04-10  5:24         ` Vijay Kilari
2014-04-10  8:59         ` Ian Campbell
2014-04-09  8:50   ` Julien Grall
2014-04-09 11:34     ` Vijay Kilari [this message]
2014-04-09 12:10       ` Julien Grall
2014-04-09 15:54   ` Ian Campbell
2014-04-04 11:56 ` [PATCH v2 06/15] xen/arm: move gic lock out of gic data structure vijay.kilari
2014-04-10  8:52   ` Ian Campbell
2014-04-10  9:24     ` Vijay Kilari
2014-04-10 10:02       ` Ian Campbell
2014-04-10 10:12         ` Vijay Kilari
2014-04-10 10:31           ` Ian Campbell
2014-04-04 11:56 ` [PATCH v2 07/15] xen/arm: split gic driver into generic and gic-v2 driver vijay.kilari
2014-04-10  8:58   ` Ian Campbell
2014-04-10  9:27     ` Vijay Kilari
2014-04-04 11:56 ` [PATCH v2 08/15] xen/arm: use device api to detect GIC version vijay.kilari
2014-04-04 14:07   ` Julien Grall
2014-04-09 14:28     ` Vijay Kilari
2014-04-09 14:32       ` Julien Grall
2014-04-10  9:05         ` Ian Campbell
2014-04-04 11:56 ` [PATCH v2 09/15] xen/arm: segregate VGIC low level functionality vijay.kilari
2014-04-04 14:13   ` Julien Grall
2014-04-10  9:08     ` Ian Campbell
2014-04-04 11:56 ` [PATCH v2 10/15] xen/arm: split vgic driver into generic and vgic-v2 driver vijay.kilari
2014-04-10  9:12   ` Ian Campbell
2014-04-04 11:56 ` [PATCH v2 11/15] xen/arm: make GIC context data version specific vijay.kilari
2014-04-04 14:09   ` Julien Grall
2014-04-10  9:14     ` Ian Campbell
2014-04-04 11:56 ` [PATCH v2 12/15] xen/arm: move GIC data to driver from domain structure vijay.kilari
2014-04-10  9:21   ` Ian Campbell
2014-04-04 11:56 ` [PATCH v2 13/15] xen/arm: Add support for GIC v3 vijay.kilari
2014-04-10  9:25   ` Ian Campbell
2014-04-10 10:00   ` Ian Campbell
2014-04-10 10:34     ` Julien Grall
2014-04-10 11:06       ` Vijay Kilari
2014-04-10 11:21         ` Julien Grall
2014-04-10 11:24     ` Julien Grall
2014-04-11 12:59     ` Vijay Kilari
2014-04-14  8:27       ` Ian Campbell
2014-04-14  9:52         ` Vijay Kilari
2014-04-04 11:56 ` [PATCH v2 14/15] xen/arm: Add vgic " vijay.kilari
2014-04-10 10:23   ` Ian Campbell
2014-04-10 10:43     ` Vijay Kilari
2014-04-10 10:51       ` Ian Campbell
2014-04-10 11:19         ` Vijay Kilari
2014-04-10 11:26           ` Ian Campbell
2014-04-10 11:38             ` Vijay Kilari
2014-04-10 12:08               ` Ian Campbell
2014-04-10 13:14                 ` Vijay Kilari
2014-04-04 11:56 ` [PATCH v2 15/15] xen/arm: update GIC dt node with GIC v3 information vijay.kilari
2014-04-04 14:22   ` Julien Grall
2014-04-04 15:45     ` Vijay Kilari
2014-04-04 16:00       ` Julien Grall
2014-04-04 16:13         ` Vijay Kilari
2014-04-04 16:42           ` Julien Grall
2014-04-10 10:28   ` Ian Campbell
2014-04-04 13:01 ` [PATCH v2 00/15] xen/arm: Add GICv3 support Julien Grall
2014-04-04 15:56   ` Vijay Kilari
2014-04-04 16:03     ` Julien Grall
2014-04-10  8: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='CALicx6uUf==dm-sFugpzu1fHgr+38ZKK5OR=gx141p_1e0uTsg@mail.gmail.com' \
    --to=vijay.kilari@gmail.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=Prasun.Kapoor@caviumnetworks.com \
    --cc=julien.grall@linaro.org \
    --cc=stefano.stabellini@citrix.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=vijaya.kumar@caviumnetworks.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.