diff mbox

[v8,19/28] xen/arm: ITS: Store the number of LPIs allocated per domain

Message ID 1454318798-31913-20-git-send-email-vijayak@caviumnetworks.com (mailing list archive)
State New, archived
Headers show

Commit Message

vijayak@caviumnetworks.com Feb. 1, 2016, 9:26 a.m. UTC
From: Vijaya Kumar K <Vijaya.Kumar@caviumnetworks.com>

Store the number of lpis allocated per domain in vgic structure

Signed-off-by: Vijaya Kumar K <Vijaya.Kumar@caviumnetworks.com>
---
v8: - Updated commit message and added comments
    - Removed initialization of vgic.nr_lpis to zero
v7: - Change commit message.
    - Store only nr_lpis per domain in vgic structure and drop
      id_bits.
---
 xen/arch/arm/vgic-v3-its.c   |    6 ++++++
 xen/include/asm-arm/domain.h |    1 +
 2 files changed, 7 insertions(+)
diff mbox

Patch

diff --git a/xen/arch/arm/vgic-v3-its.c b/xen/arch/arm/vgic-v3-its.c
index 36e6385..913b49d 100644
--- a/xen/arch/arm/vgic-v3-its.c
+++ b/xen/arch/arm/vgic-v3-its.c
@@ -860,6 +860,12 @@  int vits_domain_init(struct domain *d)
     ASSERT(is_hardware_domain(d));
     ASSERT(vits_hw.enabled);
 
+    /*
+     * HW might support more number of LPIs than specified here for a domain.
+     * Here we limit number of LPIs supported for domain to nr_lpis.
+     */
+    d->arch.vgic.nr_lpis = gic_nr_irq_ids() - FIRST_GIC_LPI;
+
     d->arch.vgic.vits = xzalloc(struct vgic_its);
     if ( !d->arch.vgic.vits )
         return -ENOMEM;
diff --git a/xen/include/asm-arm/domain.h b/xen/include/asm-arm/domain.h
index 0ac62d9..0904204 100644
--- a/xen/include/asm-arm/domain.h
+++ b/xen/include/asm-arm/domain.h
@@ -93,6 +93,7 @@  struct arch_domain
         spinlock_t lock;
         uint32_t 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;
         /*