diff options
author | Christian Borntraeger | 2017-10-20 16:31:38 +0200 |
---|---|---|
committer | Christian Borntraeger | 2017-10-30 09:03:45 +0100 |
commit | 0280b3eb7c0519b43452c05cf51f8777d9e38975 (patch) | |
tree | 7d3b069a5de99f348688d690ccaa221ed84e05eb /target | |
parent | target/s390x: change CPU type name to "s390x-cpu" (diff) | |
download | qemu-0280b3eb7c0519b43452c05cf51f8777d9e38975.tar.gz qemu-0280b3eb7c0519b43452c05cf51f8777d9e38975.tar.xz qemu-0280b3eb7c0519b43452c05cf51f8777d9e38975.zip |
s390x/kvm: use cpu model for gscb on compat machines
Starting a guest with
<os>
<type arch='s390x' machine='s390-ccw-virtio-2.9'>hvm</type>
</os>
<cpu mode='host-model'/>
on an IBM z14 results in
"qemu-system-s390x: Some features requested in the CPU model are not
available in the configuration: gs"
This is because guarded storage is fenced for compat machines that did
not have guarded storage support. While this prevents future migration
abort (by not starting the guest at all), not being able to start a
"host-model" guest is very much unexpected. As it turns out, even if we
would modify libvirt to not expand the cpu model to contain "gs" for
compat machines, it cannot guarantee that a migration will succeed. For
example if the kernel changes its features (or the user has nested=1 on
one host but not on the other) the migration will fail nevertheless. So
instead of fencing "gs" for machines <= 2.9 lets allow it for all
machine types that support the CPU model. This will make "host-model"
runnable all the time, while relying on the CPU model to reject invalid
migration attempts. We also need to change the migration for guarded
storage.
Additional discussions about host-model are still pending but are out
of scope of this patch.
Suggested-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Acked-by: David Hildenbrand <david@redhat.com>
Acked-by: Cornelia Huck <Cornelia Huck <cohuck@redhat.com>
Acked-by: Halil Pasic <pasic@linux.vnet.ibm.com>
Diffstat (limited to 'target')
-rw-r--r-- | target/s390x/kvm.c | 2 | ||||
-rw-r--r-- | target/s390x/machine.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c index 88f27d75b9..b03f583032 100644 --- a/target/s390x/kvm.c +++ b/target/s390x/kvm.c @@ -306,7 +306,7 @@ int kvm_arch_init(MachineState *ms, KVMState *s) cap_ri = 1; } } - if (gs_allowed()) { + if (cpu_model_allowed()) { if (kvm_vm_enable_cap(s, KVM_CAP_S390_GS, 0) == 0) { cap_gs = 1; } diff --git a/target/s390x/machine.c b/target/s390x/machine.c index e1b7015d20..b78f326d3a 100644 --- a/target/s390x/machine.c +++ b/target/s390x/machine.c @@ -180,7 +180,7 @@ const VMStateDescription vmstate_exval = { static bool gscb_needed(void *opaque) { - return kvm_s390_get_gs(); + return s390_has_feat(S390_FEAT_GUARDED_STORAGE); } const VMStateDescription vmstate_gscb = { |