aboutsummaryrefslogtreecommitdiff
path: root/target/s390x/machine.c
diff options
context:
space:
mode:
authorChristian Borntraeger <borntraeger@de.ibm.com>2018-07-31 11:04:48 +0200
committerCornelia Huck <cohuck@redhat.com>2018-08-20 14:18:49 +0200
commit27e84d4ebd25b981ab27cb590fe06d1b0fcd06d2 (patch)
tree4561750f46fb9076c1050e079f5e4fd157f28526 /target/s390x/machine.c
parentd36f7de82995a42b749c29c5b60ba31483995a42 (diff)
downloadqemu-27e84d4ebd25b981ab27cb590fe06d1b0fcd06d2.zip
qemu-27e84d4ebd25b981ab27cb590fe06d1b0fcd06d2.tar.gz
qemu-27e84d4ebd25b981ab27cb590fe06d1b0fcd06d2.tar.bz2
s390x/kvm: add etoken facility
Provide the etoken facility. We need to handle cpu model, migration and clear reset. Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Acked-by: Janosch Frank <frankja@linux.ibm.com> Message-Id: <20180731090448.36662-3-borntraeger@de.ibm.com> Reviewed-by: David Hildenbrand <david@redhat.com> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
Diffstat (limited to 'target/s390x/machine.c')
-rw-r--r--target/s390x/machine.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/target/s390x/machine.c b/target/s390x/machine.c
index bd3230d..cb792aa 100644
--- a/target/s390x/machine.c
+++ b/target/s390x/machine.c
@@ -1,7 +1,7 @@
/*
* S390x machine definitions and functions
*
- * Copyright IBM Corp. 2014
+ * Copyright IBM Corp. 2014, 2018
*
* Authors:
* Thomas Huth <thuth@linux.vnet.ibm.com>
@@ -216,6 +216,23 @@ const VMStateDescription vmstate_bpbc = {
}
};
+static bool etoken_needed(void *opaque)
+{
+ return s390_has_feat(S390_FEAT_ETOKEN);
+}
+
+const VMStateDescription vmstate_etoken = {
+ .name = "cpu/etoken",
+ .version_id = 1,
+ .minimum_version_id = 1,
+ .needed = etoken_needed,
+ .fields = (VMStateField[]) {
+ VMSTATE_UINT64(env.etoken, S390CPU),
+ VMSTATE_UINT64(env.etoken_extension, S390CPU),
+ VMSTATE_END_OF_LIST()
+ }
+};
+
const VMStateDescription vmstate_s390_cpu = {
.name = "cpu",
.post_load = cpu_post_load,
@@ -251,6 +268,7 @@ const VMStateDescription vmstate_s390_cpu = {
&vmstate_exval,
&vmstate_gscb,
&vmstate_bpbc,
+ &vmstate_etoken,
NULL
},
};