xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@citrix.com>
To: Vijay Kilari <vijay.kilari@gmail.com>
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>,
	Tim Deegan <tim@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Stefano Stabellini <stefano.stabellini@citrix.com>,
	manish.jaggi@caviumnetworks.com
Subject: Re: [PATCH v4 05/17] xen/arm: ITS: implement hw_irq_controller for LPIs
Date: Wed, 15 Jul 2015 10:26:40 +0200	[thread overview]
Message-ID: <55A61940.9010408@citrix.com> (raw)
In-Reply-To: <CALicx6smApjaKRJHjDZYt3voVrLk-9nfinmE9Fa7gD35PKf31g@mail.gmail.com>

Hi Vijay,

On 15/07/2015 09:16, Vijay Kilari wrote:
> On Tue, Jul 14, 2015 at 2:48 AM, Julien Grall <julien.grall@citrix.com> wrote:
>> Hi,
>>
>> On 10/07/2015 09:42, vijay.kilari@gmail.com wrote:
>>>
>>> diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
>>> index c41e82e..4f3801b 100644
>>> --- a/xen/arch/arm/gic.c
>>> +++ b/xen/arch/arm/gic.c
>>> +static inline hw_irq_controller *get_host_hw_irq_controller(unsigned int
>>> irq)
>>> +{
>>> +    if ( is_lpi(irq) )
>>> +        return its_hw_ops->lpi_host_irq_type;
>>> +    else
>>> +        return gic_hw_ops->gic_host_irq_type;
>>> +}
>>
>>
>> This is not what I asked on v3 [1]. The ITS hardware controller shouldn't be
>> exposed to the common GIC. We have to keep a clean and comprehensible
>> interface.
>>
>> What I asked is to replace the gic_host_irq_type variable by a new callback
>> which will return the correct hw_irq_controller.
>>
>> For GICv2, it will return the same hw_irq_controller as today. For GICv3, it
>> will check is the IRQ is an LPI and return the correct controller.
>>
>> FWIW, it was "ack" by Ian [2].
>
>   If we don't want to expose any ITS interfaces to common gic code, then we
> have to register callbacks to GICv3 driver.

Why? In fine, the ITS is an integral part of the GICv3, so you could 
directly call the ITS code within the GICv3 without any callback.

Actually, you already do that in some place. So I don't see why you 
can't do it there...

>>> @@ -149,7 +173,7 @@ int gic_route_irq_to_guest(struct domain *d, unsigned
>>> int virq,
>>>             test_bit(GIC_IRQ_GUEST_ENABLED, &p->status) )
>>>            goto out;
>>>
>>> -    desc->handler = gic_hw_ops->gic_guest_irq_type;
>>> +    desc->handler = get_guest_hw_irq_controller(desc->irq);
>>>        set_bit(_IRQ_GUEST, &desc->status);
>>>
>>>        gic_set_irq_properties(desc, cpumask_of(v_target->processor),
>>> priority);
>>> diff --git a/xen/arch/arm/irq.c b/xen/arch/arm/irq.c
>>> index 2dd43ee..ba8528a 100644
>>> --- a/xen/arch/arm/irq.c
>>> +++ b/xen/arch/arm/irq.c
>>> @@ -35,7 +35,13 @@ static DEFINE_SPINLOCK(local_irqs_type_lock);
>>>    struct irq_guest
>>>    {
>>>        struct domain *d;
>>> -    unsigned int virq;
>>> +    union
>>> +    {
>>> +        /* virq refer to virtual irq in case of spi */
>>> +        unsigned int virq;
>>> +        /* virq refer to event ID in case of lpi */
>>> +        unsigned int vid;
>>
>>
>> Why can't we store the event ID in the irq_guest? As said on v3, this is not
>
> Are you referring to irq_desc in above statement?

Yes sorry.

>
>> domain specific [3]. Furthermore, you add support to route LPI in Xen (see
>> gic_route_irq_to_xen) where you will clearly need the event ID.
>>
>>>    void irq_set_affinity(struct irq_desc *desc, const cpumask_t *cpu_mask)
>>>    {
>>>        if ( desc != NULL )
>>> diff --git a/xen/include/asm-arm/gic-its.h b/xen/include/asm-arm/gic-its.h
>>> index b5e09bd..e8d244f 100644
>>> --- a/xen/include/asm-arm/gic-its.h
>>> +++ b/xen/include/asm-arm/gic-its.h
>>> @@ -161,6 +161,10 @@ typedef union {
>>>     * The ITS view of a device.
>>>     */
>>>    struct its_device {
>>> +    /* Physical ITS */
>>> +    struct its_node         *its;
>>> +    /* Number of Physical LPIs assigned */
>>> +    int                     nr_lpis;
>>
>>
>> Why didn't you add this field directly in the patch #4? It would be more
>> logical.
>>
>>>    /*
>>>     * ITS registers, offsets from ITS_base
>>> diff --git a/xen/include/asm-arm/irq.h b/xen/include/asm-arm/irq.h
>>> index 34b492b..55e219f 100644
>>> --- a/xen/include/asm-arm/irq.h
>>> +++ b/xen/include/asm-arm/irq.h
>>> @@ -17,6 +17,8 @@ struct arch_pirq
>>>    struct arch_irq_desc {
>>>        int eoi_cpu;
>>>        unsigned int type;
>>> +    struct its_device *dev;
>>> +    u16 col_id;
>>
>>
>> It has been suggested by Ian to move col_id in the its_device in the
>> previous version [4]. Any reason to not doing it?
>
> In round robin fashion each plpi is attached to col_id. So storing
> in its_device is not possible. In linux latest col_id is stored in its_device
> structure for which set_affinity is called.

You could do round robin on its_device... It would be exactly the same 
and save 2 byte if not more with the alignment per irq_desc.

Don't forget that 1 byte in the irq_desc means 1KB added in Xen binary. 
These bytes saved could be used to store the event ID.

That remind me, these 2 new fields should only be defined when GICv3 is 
used (#ifdef HAS_GICV3).

I'm would be fine if you skip the former for 4.6, but the latter is 
mandatory. ITS code shouldn't be compiled on arm32.

Regards,

-- 
Julien Grall

  reply	other threads:[~2015-07-15  8:26 UTC|newest]

Thread overview: 113+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-10  7:42 [PATCH v4 00/17] Add ITS support vijay.kilari
2015-07-10  7:42 ` [PATCH v4 01/17] xen/arm: Add bitmap_find_next_zero_area helper function vijay.kilari
2015-07-10  9:01   ` Jan Beulich
2015-07-10  9:28     ` Vijay Kilari
2015-07-10  9:30       ` Vijay Kilari
2015-07-10  9:45     ` Vijay Kilari
2015-07-10 10:07       ` Jan Beulich
2015-07-10  7:42 ` [PATCH v4 02/17] xen: Add log2 functionality vijay.kilari
2015-07-10  7:42 ` [PATCH v4 03/17] xen/arm: ITS: Port ITS driver to Xen vijay.kilari
2015-07-10 13:01   ` Ian Campbell
2015-07-15 10:23   ` Julien Grall
2015-07-10  7:42 ` [PATCH v4 04/17] xen/arm: ITS: Add helper functions to manage its_devices vijay.kilari
2015-07-10 13:05   ` Ian Campbell
2015-07-15 10:37   ` Julien Grall
2015-07-15 14:21     ` Vijay Kilari
2015-07-15 14:28       ` Julien Grall
2015-07-10  7:42 ` [PATCH v4 05/17] xen/arm: ITS: implement hw_irq_controller for LPIs vijay.kilari
2015-07-10 13:46   ` Ian Campbell
2015-07-11 14:40     ` Vijay Kilari
2015-07-11 18:08       ` Julien Grall
2015-07-13  9:17       ` Ian Campbell
2015-07-13 21:18   ` Julien Grall
2015-07-15  7:16     ` Vijay Kilari
2015-07-15  8:26       ` Julien Grall [this message]
2015-07-15  9:32         ` Ian Campbell
2015-07-15  9:49           ` Julien Grall
2015-07-15 10:01             ` Ian Campbell
2015-07-15 14:15           ` Vijay Kilari
2015-07-15 14:22             ` Julien Grall
2015-07-15 14:28             ` Ian Campbell
2015-07-15 17:01               ` Vijay Kilari
2015-07-16 14:49                 ` Ian Campbell
2015-07-16 15:21                   ` Marc Zyngier
2015-07-16 16:18                     ` Ian Campbell
2015-07-16 16:27                       ` Marc Zyngier
2015-07-16 16:37                         ` Ian Campbell
2015-07-18 10:13           ` Julien Grall
2015-07-20 11:52             ` Ian Campbell
2015-07-20 12:22             ` Ian Campbell
2015-07-15 18:19   ` Julien Grall
2015-07-10  7:42 ` [PATCH v4 06/17] xen/arm: ITS: Add virtual ITS driver vijay.kilari
2015-07-10 13:54   ` Ian Campbell
2015-07-11 14:48     ` Vijay Kilari
2015-07-13  9:27       ` Ian Campbell
2015-07-10 14:15   ` Ian Campbell
2015-07-11 14:48     ` Vijay Kilari
2015-07-13  9:25       ` Ian Campbell
2015-07-15 12:17   ` Julien Grall
2015-07-10  7:42 ` [PATCH v4 07/17] xen/arm: ITS: Add virtual ITS commands support vijay.kilari
2015-07-10 14:35   ` Ian Campbell
2015-07-11 14:49     ` Vijay Kilari
2015-07-13  9:22       ` Ian Campbell
2015-07-13 11:15         ` Vijay Kilari
2015-07-13 11:37           ` Ian Campbell
2015-07-17 15:01             ` Vijay Kilari
2015-07-15 13:02     ` Julien Grall
2015-07-15 13:56       ` Ian Campbell
2015-07-15 12:57   ` Julien Grall
2015-07-17 14:12     ` Vijay Kilari
2015-07-17 15:15       ` Julien Grall
2015-07-17 15:34         ` Ian Campbell
2015-07-17 15:44           ` Julien Grall
2015-07-10  7:42 ` [PATCH v4 08/17] xen/arm: ITS: Add APIs to add and assign device vijay.kilari
2015-07-10 14:52   ` Ian Campbell
2015-07-15 13:14     ` Julien Grall
2015-07-16 13:40       ` Vijay Kilari
2015-07-16 14:38         ` Julien Grall
2015-07-15 14:15   ` Julien Grall
2015-07-18  9:44     ` Vijay Kilari
2015-07-18 10:06       ` Julien Grall
2015-07-10  7:42 ` [PATCH v4 09/17] xen/arm: ITS: Add GITS registers emulation vijay.kilari
2015-07-10 14:56   ` Ian Campbell
2015-07-15 16:13   ` Julien Grall
2015-07-10  7:42 ` [PATCH v4 10/17] xen/arm: ITS: Enable physical and virtual ITS driver compilation vijay.kilari
2015-07-15 16:16   ` Julien Grall
2015-07-10  7:42 ` [PATCH v4 11/17] xen/arm: ITS: Add GICR register emulation vijay.kilari
2015-07-10 15:10   ` Ian Campbell
2015-07-11 18:25     ` Julien Grall
2015-07-13  9:28       ` Ian Campbell
2015-07-13  9:53         ` Ian Campbell
2015-07-13 16:53   ` Stefano Stabellini
2015-07-15 17:32   ` Julien Grall
2015-07-16 14:15     ` Vijay Kilari
2015-07-16 14:41       ` Julien Grall
2015-07-16 14:46         ` Vijay Kilari
2015-07-16 14:58           ` Julien Grall
2015-07-10  7:42 ` [PATCH v4 12/17] xen/arm: ITS: Initialize LPI irq descriptors and route vijay.kilari
2015-07-10 15:30   ` Ian Campbell
2015-07-20 13:07     ` Vijay Kilari
2015-07-20 13:25       ` Julien Grall
2015-07-22 13:31     ` Vijay Kilari
2015-07-22 13:39       ` Julien Grall
2015-07-22 14:17         ` Julien Grall
2015-07-13 17:03   ` Stefano Stabellini
2015-07-13 17:13   ` Stefano Stabellini
2015-07-13 17:36     ` Julien Grall
2015-07-15 18:13   ` Julien Grall
2015-07-16  8:06     ` Julien Grall
2015-07-16  8:37   ` Julien Grall
2015-07-10  7:42 ` [PATCH v4 13/17] xen/arm: ITS: Initialize physical ITS vijay.kilari
2015-07-13 17:06   ` Stefano Stabellini
2015-07-10  7:42 ` [PATCH v4 14/17] xen/arm: ITS: Add domain specific ITS initialization vijay.kilari
2015-07-10 15:41   ` Ian Campbell
2015-07-15 17:41   ` Julien Grall
2015-07-10  7:42 ` [PATCH v4 15/17] xen/arm: ITS: Map ITS translation space vijay.kilari
2015-07-10 15:43   ` Ian Campbell
2015-07-15  9:01   ` Julien Grall
2015-07-10  7:42 ` [PATCH v4 16/17] xen/arm: ITS: Generate ITS node for Dom0 vijay.kilari
2015-07-13 16:32   ` Stefano Stabellini
2015-07-13 17:31     ` Julien Grall
2015-07-13 17:36       ` Stefano Stabellini
2015-07-10  7:42 ` [PATCH v4 17/17] xen/arm: ITS: Add pci devices in ThunderX vijay.kilari
2015-07-10 15: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=55A61940.9010408@citrix.com \
    --to=julien.grall@citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=Prasun.Kapoor@caviumnetworks.com \
    --cc=manish.jaggi@caviumnetworks.com \
    --cc=stefano.stabellini@citrix.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=tim@xen.org \
    --cc=vijay.kilari@gmail.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 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).