]> git.karo-electronics.de Git - linux-beck.git/commitdiff
KVM: arm64: vgic-its: Introduce config option to guard ITS specific code
authorVladimir Murzin <vladimir.murzin@arm.com>
Mon, 12 Sep 2016 14:49:18 +0000 (15:49 +0100)
committerChristoffer Dall <christoffer.dall@linaro.org>
Thu, 22 Sep 2016 11:21:47 +0000 (13:21 +0200)
By now ITS code guarded with KVM_ARM_VGIC_V3 config option which was
introduced to hide everything specific to vgic-v3 from 32-bit world.
We are going to support vgic-v3 in 32-bit world and KVM_ARM_VGIC_V3
will gone, but we don't have support for ITS there yet and we need to
continue keeping ITS away.
Introduce the new config option to prevent ITS code being build in
32-bit mode when support for vgic-v3 is done.

Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
arch/arm64/kvm/Kconfig
virt/kvm/arm/vgic/vgic-kvm-device.c
virt/kvm/arm/vgic/vgic-mmio-v3.c
virt/kvm/arm/vgic/vgic.h

index 9c9edc98d271fbcb4379cf0087744e7fc6396301..7ba91647d1c56d06e8627fdefceaad3124d9b3e9 100644 (file)
@@ -16,6 +16,9 @@ menuconfig VIRTUALIZATION
 
 if VIRTUALIZATION
 
+config KVM_ARM_VGIC_V3_ITS
+       bool
+
 config KVM_ARM_VGIC_V3
        bool
 
@@ -35,6 +38,7 @@ config KVM
        select HAVE_KVM_EVENTFD
        select HAVE_KVM_IRQFD
        select KVM_ARM_VGIC_V3
+       select KVM_ARM_VGIC_V3_ITS
        select KVM_ARM_PMU if HW_PERF_EVENTS
        select HAVE_KVM_MSI
        select HAVE_KVM_IRQCHIP
index 163b0578efc76e111983c5b74f302d453334dc65..89ef9bcc6de663be71ad81d10a5b6b3885293d39 100644 (file)
@@ -223,9 +223,12 @@ int kvm_register_vgic_device(unsigned long type)
        case KVM_DEV_TYPE_ARM_VGIC_V3:
                ret = kvm_register_device_ops(&kvm_arm_vgic_v3_ops,
                                              KVM_DEV_TYPE_ARM_VGIC_V3);
+
+#ifdef CONFIG_KVM_ARM_VGIC_V3_ITS
                if (ret)
                        break;
                ret = kvm_vgic_register_its_device();
+#endif
                break;
 #endif
        }
index 90d81811fdda0e653e19fe92c640bede9053f617..acbe6915d65782c0ff5c23e6a86c50b7373644af 100644 (file)
@@ -42,6 +42,7 @@ u64 update_64bit_reg(u64 reg, unsigned int offset, unsigned int len,
        return reg | ((u64)val << lower);
 }
 
+#ifdef CONFIG_KVM_ARM_VGIC_V3_ITS
 bool vgic_has_its(struct kvm *kvm)
 {
        struct vgic_dist *dist = &kvm->arch.vgic;
@@ -51,6 +52,7 @@ bool vgic_has_its(struct kvm *kvm)
 
        return dist->has_its;
 }
+#endif
 
 static unsigned long vgic_mmio_read_v3_misc(struct kvm_vcpu *vcpu,
                                            gpa_t addr, unsigned int len)
index 6c4625c4636843c551a23d26b6b1d849e26b52cd..100045f3d98a7a805e05aa4ff7991b8564b6d05b 100644 (file)
@@ -84,11 +84,15 @@ void vgic_v3_enable(struct kvm_vcpu *vcpu);
 int vgic_v3_probe(const struct gic_kvm_info *info);
 int vgic_v3_map_resources(struct kvm *kvm);
 int vgic_register_redist_iodevs(struct kvm *kvm, gpa_t dist_base_address);
+
+#ifdef CONFIG_KVM_ARM_VGIC_V3_ITS
 int vgic_register_its_iodevs(struct kvm *kvm);
 bool vgic_has_its(struct kvm *kvm);
 int kvm_vgic_register_its_device(void);
 void vgic_enable_lpis(struct kvm_vcpu *vcpu);
 int vgic_its_inject_msi(struct kvm *kvm, struct kvm_msi *msi);
+#endif
+
 #else
 static inline void vgic_v3_process_maintenance(struct kvm_vcpu *vcpu)
 {