aboutsummaryrefslogtreecommitdiff
path: root/target-s390x/cpu_models.h
diff options
context:
space:
mode:
authorDavid Hildenbrand <dahi@linux.vnet.ibm.com>2016-09-05 10:52:22 +0200
committerCornelia Huck <cornelia.huck@de.ibm.com>2016-09-06 17:06:49 +0200
commit6c064de1e08f425e2852ea9b38ea0723994aa4fd (patch)
tree9a4c3edb47dc105fea65b26275cfc4efbe7b1ca1 /target-s390x/cpu_models.h
parent8b3d6cb1fa6ae12e80ed8c266a637468b52835c7 (diff)
downloadqemu-6c064de1e08f425e2852ea9b38ea0723994aa4fd.zip
qemu-6c064de1e08f425e2852ea9b38ea0723994aa4fd.tar.gz
qemu-6c064de1e08f425e2852ea9b38ea0723994aa4fd.tar.bz2
s390x/cpumodel: register defined CPU models as subclasses
This patch adds the CPU model definitions that are known on s390x - like z900, zBC12 or z13. For each definition, introduce two CPU models: 1. Base model (e.g. z13-base): Minimum feature set we expect to be around on all z13 systems. These models are migration-safe and will never change. 2. Flexible models (e.g. z13): Models that can change between QEMU versions and will be extended over time as we implement further features that are already part of such a model in real hardware of certain configurations. We want to work on features using ordinary bitmap operations, however we can't initialize a bitmap statically (unsigned long[] ...). Therefore we store the generated feature lists in separate arrays and convert them to proper bitmaps before registering all our CPU model classes. Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Message-Id: <20160905085244.99980-9-dahi@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Diffstat (limited to 'target-s390x/cpu_models.h')
-rw-r--r--target-s390x/cpu_models.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/target-s390x/cpu_models.h b/target-s390x/cpu_models.h
new file mode 100644
index 0000000..0b87134
--- /dev/null
+++ b/target-s390x/cpu_models.h
@@ -0,0 +1,42 @@
+/*
+ * CPU models for s390x
+ *
+ * Copyright 2016 IBM Corp.
+ *
+ * Author(s): David Hildenbrand <dahi@linux.vnet.ibm.com>
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or (at
+ * your option) any later version. See the COPYING file in the top-level
+ * directory.
+ */
+
+#ifndef TARGET_S390X_CPU_MODELS_H
+#define TARGET_S390X_CPU_MODELS_H
+
+#include "cpu_features.h"
+#include "qom/cpu.h"
+
+/* static CPU definition */
+typedef struct S390CPUDef {
+ const char *name; /* name exposed to the user */
+ const char *desc; /* description exposed to the user */
+ uint8_t gen; /* hw generation identification */
+ uint16_t type; /* cpu type identification */
+ uint8_t ec_ga; /* EC GA version (on which also the BC is based) */
+ uint8_t mha_pow; /* Maximum Host Adress Power, mha = 2^pow-1 */
+ uint32_t hmfai; /* hypervisor-managed facilities */
+ /* base/min features, must never be changed between QEMU versions */
+ S390FeatBitmap base_feat;
+ /* used to init base_feat from generated data */
+ S390FeatInit base_init;
+ /* deafault features, QEMU version specific */
+ S390FeatBitmap default_feat;
+ /* used to init default_feat from generated data */
+ S390FeatInit default_init;
+ /* max allowed features, QEMU version specific */
+ S390FeatBitmap full_feat;
+ /* used to init full_feat from generated data */
+ S390FeatInit full_init;
+} S390CPUDef;
+
+#endif /* TARGET_S390X_CPU_MODELS_H */