KVM: s390: Fix memory slot versus run - v3
authorCarsten Otte <cotte@de.ibm.com>
Tue, 12 May 2009 15:21:48 +0000 (17:21 +0200)
committerAvi Kivity <avi@redhat.com>
Wed, 10 Jun 2009 08:48:55 +0000 (11:48 +0300)
commit2668dab794272f0898491acaf1e77e9a005abc0f
treeaeb223675bed96f0b5fc15bc3f9474381fe28364
parent58f8ac279a8c46eb0a3193edd521ed2e41c4f914
KVM: s390: Fix memory slot versus run - v3

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: Mijo Safradin <mijo@linux.vnet.ibm.com>
Signed-off-by: Carsten Otte <cotte@de.ibm.com>
Signed-off-by: Christian Ehrhardt <ehrhardt@de.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/s390/kvm/kvm-s390.c