[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v7 20/28] xen/arm: ITS: Add virtual ITS availability check helper



On Wed, Sep 23, 2015 at 2:22 PM, Julien Grall <julien.grall@xxxxxxxxxx> wrote:
> Hi Vijay,
>
> On 18/09/15 14:09, vijay.kilari@xxxxxxxxx wrote:
>> From: Vijaya Kumar K <Vijaya.Kumar@xxxxxxxxxxxxxxxxxx>
>>
>> Introduce vgic_is_lpi_supported() helper function
>> to know virtual ITS availability for a domain
>>
>> Signed-off-by: Vijaya Kumar K <Vijaya.Kumar@xxxxxxxxxxxxxxxxxx>
>> ---
>> v7: - its_enabled field is added to vgic structure
>> ---
[...]
>> diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
>> index a5ab99d9..3555833 100644
>> --- a/xen/arch/arm/vgic.c
>> +++ b/xen/arch/arm/vgic.c
>> @@ -62,6 +62,11 @@ struct vgic_irq_rank *vgic_rank_irq(struct vcpu *v, 
>> unsigned int irq)
>>      return vgic_get_rank(v, rank);
>>  }
>>
>> +bool_t vgic_is_lpi_supported(struct domain *d)
>> +{
>> +    return d->arch.vgic.its_enabled;
>> +}
>
> Please move this helper as a static inline to allow the compiler
> inlining the code.
>

  This function is used in vgic-v3.c later. Hence this function is exported.

>> +
>>  static void vgic_init_pending_irq(struct pending_irq *p, unsigned int virq)
>>  {
>>      INIT_LIST_HEAD(&p->inflight);
>> diff --git a/xen/include/asm-arm/domain.h b/xen/include/asm-arm/domain.h
>> index 011f85b..0f6f9d8 100644
>> --- a/xen/include/asm-arm/domain.h
>> +++ b/xen/include/asm-arm/domain.h
>> @@ -93,6 +93,7 @@ struct arch_domain
>>          int ctlr;
>>          int nr_spis; /* Number of SPIs */
>>          int nr_lpis; /* Number of LPIs */
>> +        bool_t its_enabled;
>
> The field is GICv3 specific and should go within the HAS_GICV3 section
> below.
>
> Although, I don't think having this boolean is necessary. You can know
> whether we support LPIs or not by checking either the nr_lpis > 0 or
> vits != NULL.
>
> The former would be the best if you plan to keep an helper.

I will drop its_enabled field and helper will be updated as below.

bool_t vgic_is_lpi_supported(struct domain *d)
{
    return (d->arch.vgic.nr_lpis != 0);
}

>
>>          unsigned long *allocated_irqs; /* bitmap of IRQs allocated */
>>          struct vgic_irq_rank *shared_irqs;
>>          /*
>> diff --git a/xen/include/asm-arm/vgic.h b/xen/include/asm-arm/vgic.h
>> index 2bf061f..edeec9c 100644
>> --- a/xen/include/asm-arm/vgic.h
>> +++ b/xen/include/asm-arm/vgic.h
>> @@ -309,6 +309,7 @@ enum gic_sgi_mode;
>>
>>  #define vgic_num_irq_lines(d)   ((d)->arch.vgic.nr_spis + 32)
>>
>> +extern bool_t vgic_is_lpi_supported(struct domain *d);
>>  extern int domain_vgic_init(struct domain *d, unsigned int nr_spis);
>>  extern void domain_vgic_free(struct domain *d);
>>  extern int vcpu_vgic_init(struct vcpu *v);
>>
>
> Regards,
>
> --
> Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.