mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
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 <[email protected]> Reviewed-by: Marc Zyngier <[email protected]> Tested-by: Eric Auger <[email protected]> Signed-off-by: Marc Zyngier <[email protected]>
This commit is contained in:
parent
424c33830f
commit
3802411d01
5 changed files with 73 additions and 6 deletions
|
|
@ -77,6 +77,7 @@ enum vgic_irq_config {
|
|||
|
||||
struct vgic_irq {
|
||||
spinlock_t irq_lock; /* Protects the content of the struct */
|
||||
struct list_head lpi_list; /* Used to link all LPIs together */
|
||||
struct list_head ap_list;
|
||||
|
||||
struct kvm_vcpu *vcpu; /* SGIs and PPIs: The VCPU
|
||||
|
|
@ -193,6 +194,11 @@ struct vgic_dist {
|
|||
* GICv3 spec: 6.1.2 "LPI Configuration tables"
|
||||
*/
|
||||
u64 propbaser;
|
||||
|
||||
/* Protects the lpi_list and the count value below. */
|
||||
spinlock_t lpi_list_lock;
|
||||
struct list_head lpi_list_head;
|
||||
int lpi_list_count;
|
||||
};
|
||||
|
||||
struct vgic_v2_cpu_if {
|
||||
|
|
|
|||
Loading…
Reference in a new issue