From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v7 20/28] xen/arm: ITS: Add virtual ITS availability check helper Date: Thu, 24 Sep 2015 12:47:21 +0100 Message-ID: <5603E2C9.6060803@citrix.com> References: <1442581755-2668-1-git-send-email-vijay.kilari@gmail.com> <1442581755-2668-21-git-send-email-vijay.kilari@gmail.com> <56026850.6010005@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Vijay Kilari Cc: Ian Campbell , Stefano Stabellini , Prasun Kapoor , Vijaya Kumar K , Tim Deegan , "xen-devel@lists.xen.org" , Stefano Stabellini , manish.jaggi@caviumnetworks.com List-Id: xen-devel@lists.xenproject.org On 24/09/15 07:44, Vijay Kilari wrote: > On Wed, Sep 23, 2015 at 2:22 PM, Julien Grall wrote: >> Hi Vijay, >> >> On 18/09/15 14:09, vijay.kilari@gmail.com wrote: >>> From: Vijaya Kumar K >>> >>> Introduce vgic_is_lpi_supported() helper function >>> to know virtual ITS availability for a domain >>> >>> Signed-off-by: Vijaya Kumar K >>> --- >>> 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. I though you knew that a static inline function can live in the header... > >>> + >>> 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); > } + static inline and move in the header. Regards, -- Julien Grall