|
@@ -3199,6 +3199,9 @@ long kvm_arch_vm_ioctl(struct file *filp,
|
|
|
r = -EEXIST;
|
|
|
if (kvm->arch.vpic)
|
|
|
goto create_irqchip_unlock;
|
|
|
+ r = -EINVAL;
|
|
|
+ if (atomic_read(&kvm->online_vcpus))
|
|
|
+ goto create_irqchip_unlock;
|
|
|
r = -ENOMEM;
|
|
|
vpic = kvm_create_pic(kvm);
|
|
|
if (vpic) {
|
|
@@ -6107,6 +6110,11 @@ void kvm_arch_check_processor_compat(void *rtn)
|
|
|
kvm_x86_ops->check_processor_compatibility(rtn);
|
|
|
}
|
|
|
|
|
|
+bool kvm_vcpu_compatible(struct kvm_vcpu *vcpu)
|
|
|
+{
|
|
|
+ return irqchip_in_kernel(vcpu->kvm) == (vcpu->arch.apic != NULL);
|
|
|
+}
|
|
|
+
|
|
|
int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu)
|
|
|
{
|
|
|
struct page *page;
|