aboutsummaryrefslogtreecommitdiffstats
path: root/include/kvm
diff options
context:
space:
mode:
authorAndre Przywara <andre.przywara@arm.com>2016-07-15 07:43:33 -0400
committerMarc Zyngier <marc.zyngier@arm.com>2016-07-18 13:14:36 -0400
commit3802411d01880c4283426d22653e011159b1c947 (patch)
tree07aa88896048f97dc8c8a3156c4468410c6692df /include/kvm
parent424c33830f53f248a68da125e70d9a4d95a8e010 (diff)
KVM: arm64: vgic-its: Connect LPIs to the VGIC emulation
LPIs are dynamically created (mapped) at guest runtime and their actual number can be quite high, but is mostly assigned using a very sparse allocation scheme. So arrays are not an ideal data structure to hold the information. We use a spin-lock protected linked list to hold all mapped LPIs, represented by their struct vgic_irq. This lock is grouped between the ap_list_lock and the vgic_irq lock in our locking order. Also we store a pointer to that struct vgic_irq in our struct its_itte, so we can easily access it. Eventually we call our new vgic_get_lpi() from vgic_get_irq(), so the VGIC code gets transparently access to LPIs. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Marc Zyngier <marc.zyngier@arm.com> Tested-by: Eric Auger <eric.auger@redhat.com> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'include/kvm')
-rw-r--r--include/kvm/arm_vgic.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/kvm/arm_vgic.h b/include/kvm/arm_vgic.h
index 61867492d361..a6ca326055cf 100644
--- a/include/kvm/arm_vgic.h
+++ b/include/kvm/arm_vgic.h
@@ -77,6 +77,7 @@ enum vgic_irq_config {
77 77
78struct vgic_irq { 78struct vgic_irq {
79 spinlock_t irq_lock; /* Protects the content of the struct */ 79 spinlock_t irq_lock; /* Protects the content of the struct */
80 struct list_head lpi_list; /* Used to link all LPIs together */
80 struct list_head ap_list; 81 struct list_head ap_list;
81 82
82 struct kvm_vcpu *vcpu; /* SGIs and PPIs: The VCPU 83 struct kvm_vcpu *vcpu; /* SGIs and PPIs: The VCPU
@@ -193,6 +194,11 @@ struct vgic_dist {
193 * GICv3 spec: 6.1.2 "LPI Configuration tables" 194 * GICv3 spec: 6.1.2 "LPI Configuration tables"
194 */ 195 */
195 u64 propbaser; 196 u64 propbaser;
197
198 /* Protects the lpi_list and the count value below. */
199 spinlock_t lpi_list_lock;
200 struct list_head lpi_list_head;
201 int lpi_list_count;
196}; 202};
197 203
198struct vgic_v2_cpu_if { 204struct vgic_v2_cpu_if {