• Carsten Otte's avatar
    KVM: s390: Fix memory slot versus run - v3 · 2668dab7
    Carsten Otte authored
    This patch fixes an incorrectness in the kvm backend for s390.
    In case virtual cpus are being created before the corresponding
    memory slot is being registered, we need to update the sie
    control blocks for the virtual cpus.
    
    *updates in v3*
    In consideration of the s390 memslot constraints locking was changed
    to trylock. These locks should never be held, as vcpu's can't run without
    the single memslot we just assign when running this code. To ensure this
    never deadlocks in case other code changes the code uses trylocks and bail
    out if it can't get all locks.
    
    Additionally most of the discussed special conditions for s390 like
    only one memslot and no user_alloc are now checked for validity in
    kvm_arch_set_memory_region.
    Reported-by: default avatarMijo Safradin <mijo@linux.vnet.ibm.com>
    Signed-off-by: default avatarCarsten Otte <cotte@de.ibm.com>
    Signed-off-by: default avatarChristian Ehrhardt <ehrhardt@de.ibm.com>
    Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
    2668dab7
kvm-s390.c 18.7 KB