diff options
author | Marc Zyngier <marc.zyngier@arm.com> | 2016-07-17 12:27:23 +0200 |
---|---|---|
committer | Marc Zyngier <marc.zyngier@arm.com> | 2016-07-18 19:15:16 +0200 |
commit | d97594e6bc1b4aaad3ccae3ef678513b63dd5221 (patch) | |
tree | 921513cb42ad71bfb73eb1652d4158e3492f60df /virt/kvm/arm/vgic/vgic.h | |
parent | irqchip/gicv3-its: Restore all cacheability attributes (diff) | |
download | linux-d97594e6bc1b4aaad3ccae3ef678513b63dd5221.tar.xz linux-d97594e6bc1b4aaad3ccae3ef678513b63dd5221.zip |
KVM: arm64: vgic-its: Generalize use of vgic_get_irq_kref
Instead of sprinkling raw kref_get() calls everytime we cannot
do a normal vgic_get_irq(), use the existing vgic_get_irq_kref(),
which does the same thing and is paired with a vgic_put_irq().
vgic_get_irq_kref is moved to vgic.h in order to be easily shared.
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to '')
-rw-r--r-- | virt/kvm/arm/vgic/vgic.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/virt/kvm/arm/vgic/vgic.h b/virt/kvm/arm/vgic/vgic.h index 9d40d7bb89f7..1d8e21d5c13f 100644 --- a/virt/kvm/arm/vgic/vgic.h +++ b/virt/kvm/arm/vgic/vgic.h @@ -64,6 +64,14 @@ int vgic_v2_map_resources(struct kvm *kvm); int vgic_register_dist_iodev(struct kvm *kvm, gpa_t dist_base_address, enum vgic_type); +static inline void vgic_get_irq_kref(struct vgic_irq *irq) +{ + if (irq->intid < VGIC_MIN_LPI) + return; + + kref_get(&irq->refcount); +} + #ifdef CONFIG_KVM_ARM_VGIC_V3 void vgic_v3_process_maintenance(struct kvm_vcpu *vcpu); void vgic_v3_fold_lr_state(struct kvm_vcpu *vcpu); |