summaryrefslogtreecommitdiff
path: root/include/kvm
diff options
context:
space:
mode:
authorAndre Przywara <andre.przywara@arm.com>2016-03-07 13:32:29 +0300
committerChristoffer Dall <christoffer.dall@linaro.org>2016-05-20 16:39:43 +0300
commit2defaff48aaf16072a6eac4cf8234917197dfa72 (patch)
tree45979a2277254da13f71c0cf509140327cb46817 /include/kvm
parentd5a5a0eff368f039ed2222b47c15f09cb60e1245 (diff)
downloadlinux-2defaff48aaf16072a6eac4cf8234917197dfa72.tar.xz
KVM: arm/arm64: pmu: abstract access to number of SPIs
Currently the PMU uses a member of the struct vgic_dist directly, which not only breaks abstraction, but will fail with the new VGIC. Abstract this access in the VGIC header file and refactor the validity check in the PMU code. Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Diffstat (limited to 'include/kvm')
-rw-r--r--include/kvm/arm_vgic.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/kvm/arm_vgic.h b/include/kvm/arm_vgic.h
index 67a66371356d..ade70056cbd6 100644
--- a/include/kvm/arm_vgic.h
+++ b/include/kvm/arm_vgic.h
@@ -348,6 +348,8 @@ bool kvm_vgic_map_is_active(struct kvm_vcpu *vcpu, unsigned int virt_irq);
#define irqchip_in_kernel(k) (!!((k)->arch.vgic.in_kernel))
#define vgic_initialized(k) (!!((k)->arch.vgic.nr_cpus))
#define vgic_ready(k) ((k)->arch.vgic.ready)
+#define vgic_valid_spi(k, i) (((i) >= VGIC_NR_PRIVATE_IRQS) && \
+ ((i) < (k)->arch.vgic.nr_irqs))
int vgic_v2_probe(const struct gic_kvm_info *gic_kvm_info,
const struct vgic_ops **ops,