From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v7 19/28] xen/arm: ITS: Store LPIs allocated per domain Date: Wed, 23 Sep 2015 09:37:06 +0100 Message-ID: <560264B2.2050109@citrix.com> References: <1442581755-2668-1-git-send-email-vijay.kilari@gmail.com> <1442581755-2668-20-git-send-email-vijay.kilari@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1442581755-2668-20-git-send-email-vijay.kilari@gmail.com> 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@gmail.com, Ian.Campbell@citrix.com, stefano.stabellini@eu.citrix.com, stefano.stabellini@citrix.com, tim@xen.org, xen-devel@lists.xen.org Cc: Prasun.Kapoor@caviumnetworks.com, Vijaya Kumar K , manish.jaggi@caviumnetworks.com List-Id: xen-devel@lists.xenproject.org Hi Vijay, Commit title: Store the number of LPIs allocated per domain On 18/09/15 14:09, vijay.kilari@gmail.com wrote: > From: Vijaya Kumar K > > Store number of lpis allocated per domain in vgic structure NIT: It's not neccessary to repeat the commit title in the commit message. It would just let it empty. If you want to keep it: s/Store number of lpis/Store the number of LPIs/ > > Signed-off-by: Vijaya Kumar K > --- > v7: - Change commit message. > - Store only nr_lpis per domain in vgic structure and drop > id_bits. > --- > xen/arch/arm/vgic-v3-its.c | 2 ++ > xen/arch/arm/vgic.c | 1 + > xen/include/asm-arm/domain.h | 1 + > 3 files changed, 4 insertions(+) > > diff --git a/xen/arch/arm/vgic-v3-its.c b/xen/arch/arm/vgic-v3-its.c > index 3679d11..4285af3 100644 > --- a/xen/arch/arm/vgic-v3-its.c > +++ b/xen/arch/arm/vgic-v3-its.c > @@ -843,6 +843,8 @@ int vits_domain_init(struct domain *d) > ASSERT(is_hardware_domain(d)); > ASSERT(vits_hw.enabled); > > + d->arch.vgic.nr_lpis = gic_nr_irq_ids() - FIRST_GIC_LPI; Please add a comment to explain that we expose the same number of LPIs than the HW > + > d->arch.vgic.vits = xzalloc(struct vgic_its); > if ( !d->arch.vgic.vits ) > return -ENOMEM; > diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c > index baa74c7..a5ab99d9 100644 > --- a/xen/arch/arm/vgic.c > +++ b/xen/arch/arm/vgic.c > @@ -75,6 +75,7 @@ int domain_vgic_init(struct domain *d, unsigned int nr_spis) > int ret; > > d->arch.vgic.ctlr = 0; > + d->arch.vgic.nr_lpis = 0; The struct domain is always initialized to 0, so it's not necessary to set nr_lpis. > > /* Limit the number of virtual SPIs supported to (1020 - 32) = 988 */ > if ( nr_spis > (1020 - NR_LOCAL_IRQS) ) > diff --git a/xen/include/asm-arm/domain.h b/xen/include/asm-arm/domain.h > index 0f2aa66..011f85b 100644 > --- a/xen/include/asm-arm/domain.h > +++ b/xen/include/asm-arm/domain.h > @@ -92,6 +92,7 @@ struct arch_domain > spinlock_t lock; > int ctlr; > int nr_spis; /* Number of SPIs */ > + int nr_lpis; /* Number of LPIs */ > unsigned long *allocated_irqs; /* bitmap of IRQs allocated */ > struct vgic_irq_rank *shared_irqs; > /* > Regards, -- Julien Grall