aboutsummaryrefslogtreecommitdiff
path: root/target/s390x/machine.c
diff options
context:
space:
mode:
authorFan Zhang <zhangfan@linux.vnet.ibm.com>2017-02-15 04:47:49 +0100
committerChristian Borntraeger <borntraeger@de.ibm.com>2017-07-14 12:29:49 +0200
commit62deb62d999cf9e2be61272c6b720104f764bd6a (patch)
tree5462d3a6f5935ece77b6a9e560e91c7cad50797c /target/s390x/machine.c
parentc0a9cd940e6bbad75cef3b5e87b826125702c353 (diff)
s390x/kvm: enable guarded storage
Introduce guarded storage support for KVM guests on s390. We need to enable the capability, extend machine check validity, sigp store-additional-status-at-address, and migration. The feature is fenced for older machine type versions. Signed-off-by: Fan Zhang <zhangfan@linux.vnet.ibm.com> Reviewed-by: Cornelia Huck <cohuck@redhat.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Diffstat (limited to 'target/s390x/machine.c')
-rw-r--r--target/s390x/machine.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/target/s390x/machine.c b/target/s390x/machine.c
index 8f908bbe82..2dcadfdd29 100644
--- a/target/s390x/machine.c
+++ b/target/s390x/machine.c
@@ -174,6 +174,22 @@ const VMStateDescription vmstate_exval = {
}
};
+static bool gscb_needed(void *opaque)
+{
+ return kvm_s390_get_gs();
+}
+
+const VMStateDescription vmstate_gscb = {
+ .name = "cpu/gscb",
+ .version_id = 1,
+ .minimum_version_id = 1,
+ .needed = gscb_needed,
+ .fields = (VMStateField[]) {
+ VMSTATE_UINT64_ARRAY(env.gscb, S390CPU, 4),
+ VMSTATE_END_OF_LIST()
+ }
+};
+
const VMStateDescription vmstate_s390_cpu = {
.name = "cpu",
.post_load = cpu_post_load,
@@ -207,6 +223,7 @@ const VMStateDescription vmstate_s390_cpu = {
&vmstate_vregs,
&vmstate_riccb,
&vmstate_exval,
+ &vmstate_gscb,
NULL
},
};