KVM: s390: register flic ops dynamically
authorCornelia Huck <cornelia.huck@de.ibm.com>
Tue, 2 Sep 2014 09:27:35 +0000 (10:27 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 17 Sep 2014 11:10:09 +0000 (13:10 +0200)
Using the new kvm_register_device_ops() interface makes us get rid of
an #ifdef in common code.

Cc: Gleb Natapov <gleb@kernel.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/s390/kvm/kvm-s390.c
arch/s390/kvm/kvm-s390.h
include/linux/kvm_host.h
virt/kvm/kvm_main.c

index b95d4a481b0c19db09083c47c6ca01414c49de6c..56a411c0245a7db1be05034e8e1d82e127aff5e2 100644 (file)
@@ -122,7 +122,8 @@ void kvm_arch_hardware_unsetup(void)
 
 int kvm_arch_init(void *opaque)
 {
-       return 0;
+       /* Register floating interrupt controller interface. */
+       return kvm_register_device_ops(&kvm_flic_ops, KVM_DEV_TYPE_FLIC);
 }
 
 /* Section: device related */
index b1a77669137ba05c2c3f10a1d1caefd3e0349c7c..244d02303182804540cfd2f800edff6527615677 100644 (file)
@@ -227,6 +227,7 @@ int kvm_cpu_has_interrupt(struct kvm_vcpu *vcpu);
 int psw_extint_disabled(struct kvm_vcpu *vcpu);
 void kvm_s390_destroy_adapters(struct kvm *kvm);
 int kvm_s390_si_ext_call_pending(struct kvm_vcpu *vcpu);
+extern struct kvm_device_ops kvm_flic_ops;
 
 /* implemented in guestdbg.c */
 void kvm_s390_backup_guest_per_regs(struct kvm_vcpu *vcpu);
index 601d321f96e75ea2d7a536639650caf57d62f3a9..7ef088bec715de21718589c2b57d8580ae683069 100644 (file)
@@ -1069,7 +1069,6 @@ int kvm_register_device_ops(struct kvm_device_ops *ops, u32 type);
 extern struct kvm_device_ops kvm_mpic_ops;
 extern struct kvm_device_ops kvm_xics_ops;
 extern struct kvm_device_ops kvm_vfio_ops;
-extern struct kvm_device_ops kvm_flic_ops;
 
 #ifdef CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT
 
index 68d96f5dbfe23ce56caec67803dd02341f7e7086..f4e792fedb4fd649f827a50132339afa482264c2 100644 (file)
@@ -2285,10 +2285,6 @@ static struct kvm_device_ops *kvm_device_ops_table[KVM_DEV_TYPE_MAX] = {
 #ifdef CONFIG_KVM_VFIO
        [KVM_DEV_TYPE_VFIO]             = &kvm_vfio_ops,
 #endif
-
-#ifdef CONFIG_S390
-       [KVM_DEV_TYPE_FLIC]             = &kvm_flic_ops,
-#endif
 };
 
 int kvm_register_device_ops(struct kvm_device_ops *ops, u32 type)