KVM: s390: don't switch to ESCA for ucontrol
authorDavid Hildenbrand <dahi@linux.vnet.ibm.com>
Mon, 12 Oct 2015 10:57:22 +0000 (12:57 +0200)
committerChristian Borntraeger <borntraeger@de.ibm.com>
Mon, 30 Nov 2015 11:47:11 +0000 (12:47 +0100)
sca_add_vpcu is not called for ucontrol guests. We must also not
apply the sca checking for sca_can_add_vcpu as ucontrol guests
do not have to follow the sca limits.

As common code already checks that id < KVM_MAX_VCPUS all other
data structures are safe as well.

Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
arch/s390/kvm/kvm-s390.c

index d9d71bb9140442a73348fddf9595dc3c28f822b3..539d3857a59a05ccc96aab58dacd34402cb4d035 100644 (file)
@@ -1588,7 +1588,7 @@ struct kvm_vcpu *kvm_arch_vcpu_create(struct kvm *kvm,
        struct sie_page *sie_page;
        int rc = -EINVAL;
 
-       if (!sca_can_add_vcpu(kvm, id))
+       if (!kvm_is_ucontrol(kvm) && !sca_can_add_vcpu(kvm, id))
                goto out;
 
        rc = -ENOMEM;