• David Hildenbrand's avatar
    KVM: s390: fix SCA related races and double use · 25508824
    David Hildenbrand authored
    If something goes wrong in kvm_arch_vcpu_create, the VCPU has already
    been added to the sca but will never be removed. Trying to create VCPUs
    with duplicate ids (e.g. after a failed attempt) is problematic.
    
    Also, when creating multiple VCPUs in parallel, we could theoretically
    forget to set the correct SCA when the switch to ESCA happens just
    before the VCPU is registered.
    
    Let's add the VCPU to the SCA in kvm_arch_vcpu_postcreate, where we can
    be sure that no duplicate VCPU with the same id is around and the VCPU
    has already been registered at the VM. We also have to make sure to update
    ECB at that point.
    Signed-off-by: default avatarDavid Hildenbrand <dahi@linux.vnet.ibm.com>
    Signed-off-by: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
    25508824
kvm-s390.c 73 KB