Skip to content

Commit a5c7f01

Browse files
committed
KVM: arm64: vgic: Free LPI vgic_irq structs in an RCU-safe manner
Free the vgic_irq structs in an RCU-safe manner to allow reads of the LPI configuration data to happen in parallel with the release of LPIs. Reviewed-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Oliver Upton <[email protected]>
1 parent 05f4d4f commit a5c7f01

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

arch/arm64/kvm/vgic/vgic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ void __vgic_put_lpi_locked(struct kvm *kvm, struct vgic_irq *irq)
125125
xa_erase(&dist->lpi_xa, irq->intid);
126126
atomic_dec(&dist->lpi_count);
127127

128-
kfree(irq);
128+
kfree_rcu(irq, rcu);
129129
}
130130

131131
void vgic_put_irq(struct kvm *kvm, struct vgic_irq *irq)

include/kvm/arm_vgic.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ struct irq_ops {
117117

118118
struct vgic_irq {
119119
raw_spinlock_t irq_lock; /* Protects the content of the struct */
120+
struct rcu_head rcu;
120121
struct list_head ap_list;
121122

122123
struct kvm_vcpu *vcpu; /* SGIs and PPIs: The VCPU

0 commit comments

Comments
 (0)