KVM: x86: don't allow kernel irqchip with split irqchip
authorRadim Krčmář <rkrcmar@redhat.com>
Fri, 16 Dec 2016 15:10:01 +0000 (16:10 +0100)
committerRadim Krčmář <rkrcmar@redhat.com>
Mon, 9 Jan 2017 13:38:19 +0000 (14:38 +0100)
Split irqchip cannot be created after creating the kernel irqchip, but
we forgot to restrict the other way.  This is an API change.

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/x86.c

index 2f22810a7e0c8e3106c77849a6a3ea78a2b00a0c..c72a8d00a1c00938de2a98bc652a90987147ac19 100644 (file)
@@ -3961,7 +3961,7 @@ long kvm_arch_vm_ioctl(struct file *filp,
 
                mutex_lock(&kvm->lock);
                r = -EEXIST;
-               if (kvm->arch.vpic)
+               if (irqchip_in_kernel(kvm))
                        goto create_irqchip_unlock;
                r = -EINVAL;
                if (kvm->created_vcpus)