[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [Patch v4 06/30] s390x/cpumodel: generate CPU feature group
From: |
David Hildenbrand |
Subject: |
[Qemu-devel] [Patch v4 06/30] s390x/cpumodel: generate CPU feature group lists |
Date: |
Mon, 5 Sep 2016 10:52:20 +0200 |
Feature groups will be very helpful to reduce the amount of features
typically available in sane configurations. E.g. the MSA facilities
introduced loads of subfunctions, which could - in theory - go away
in the future, but we want to avoid reporting hundrets of features to
the user if usually all of them are in place.
Groups only contain features that were introduced in one shot, not just
random features. Therefore, groups can never change. This is an important
property regarding migration.
Acked-by: Cornelia Huck <address@hidden>
Signed-off-by: David Hildenbrand <address@hidden>
---
target-s390x/gen-features.c | 80 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 80 insertions(+)
diff --git a/target-s390x/gen-features.c b/target-s390x/gen-features.c
index 8f02c29..dfc7659 100644
--- a/target-s390x/gen-features.c
+++ b/target-s390x/gen-features.c
@@ -182,6 +182,35 @@
S390_FEAT_MSA_EXT_5, \
S390_FEAT_PPNO_SHA_512_DRNG
+/* cpu feature groups */
+static uint16_t group_PLO[] = {
+ S390_FEAT_GROUP_PLO,
+};
+static uint16_t group_TOD_CLOCK_STEERING[] = {
+ S390_FEAT_GROUP_TOD_CLOCK_STEERING,
+};
+static uint16_t group_GEN13_PTFF[] = {
+ S390_FEAT_GROUP_GEN13_PTFF,
+};
+static uint16_t group_MSA[] = {
+ S390_FEAT_GROUP_MSA,
+};
+static uint16_t group_MSA_EXT_1[] = {
+ S390_FEAT_GROUP_MSA_EXT_1,
+};
+static uint16_t group_MSA_EXT_2[] = {
+ S390_FEAT_GROUP_MSA_EXT_2,
+};
+static uint16_t group_MSA_EXT_3[] = {
+ S390_FEAT_GROUP_MSA_EXT_3,
+};
+static uint16_t group_MSA_EXT_4[] = {
+ S390_FEAT_GROUP_MSA_EXT_4,
+};
+static uint16_t group_MSA_EXT_5[] = {
+ S390_FEAT_GROUP_MSA_EXT_5,
+};
+
/* base features in order of release */
static uint16_t base_GEN7_GA1[] = {
S390_FEAT_GROUP_PLO,
@@ -435,6 +464,34 @@ static CpuFeatDefSpec CpuFeatDef[] = {
CPU_FEAT_INITIALIZER(GEN13_GA2),
};
+#define FEAT_GROUP_INITIALIZER(_name) \
+ { \
+ .name = "S390_FEAT_GROUP_LIST_" #_name, \
+ .bits = \
+ { .data = group_##_name, \
+ .len = ARRAY_SIZE(group_##_name) }, \
+ }
+
+typedef struct {
+ const char *name;
+ BitSpec bits;
+} FeatGroupDefSpec;
+
+/*******************************
+ * feature groups
+ *******************************/
+static FeatGroupDefSpec FeatGroupDef[] = {
+ FEAT_GROUP_INITIALIZER(PLO),
+ FEAT_GROUP_INITIALIZER(TOD_CLOCK_STEERING),
+ FEAT_GROUP_INITIALIZER(GEN13_PTFF),
+ FEAT_GROUP_INITIALIZER(MSA),
+ FEAT_GROUP_INITIALIZER(MSA_EXT_1),
+ FEAT_GROUP_INITIALIZER(MSA_EXT_2),
+ FEAT_GROUP_INITIALIZER(MSA_EXT_3),
+ FEAT_GROUP_INITIALIZER(MSA_EXT_4),
+ FEAT_GROUP_INITIALIZER(MSA_EXT_5),
+};
+
static void set_bits(uint64_t list[], BitSpec bits)
{
uint32_t i;
@@ -492,6 +549,28 @@ static void print_feature_defs(void)
}
}
+static void print_feature_group_defs(void)
+{
+ int i, j;
+
+ printf("\n/* CPU feature group list data */\n");
+
+ for (i = 0; i < ARRAY_SIZE(FeatGroupDef); i++) {
+ uint64_t feat[S390_FEAT_MAX / 64 + 1] = {};
+
+ set_bits(feat, FeatGroupDef[i].bits);
+ printf("#define %s\t", FeatGroupDef[i].name);
+ for (j = 0; j < ARRAY_SIZE(feat); j++) {
+ printf("0x%016"PRIx64"ULL", feat[j]);
+ if (j < ARRAY_SIZE(feat) - 1) {
+ printf(",");
+ } else {
+ printf("\n");
+ }
+ }
+ }
+}
+
int main(int argc, char *argv[])
{
printf("/*\n"
@@ -506,6 +585,7 @@ int main(int argc, char *argv[])
" */\n\n"
"#ifndef %s\n#define %s\n", __FILE__, _YEARS, _NAME_H, _NAME_H);
print_feature_defs();
+ print_feature_group_defs();
printf("\n#endif\n");
return 0;
}
--
2.8.4
- [Qemu-devel] [Patch v4 16/30] s390x/sclp: propagate the ibc val(lowest and unblocked ibc), (continued)
- [Qemu-devel] [Patch v4 16/30] s390x/sclp: propagate the ibc val(lowest and unblocked ibc), David Hildenbrand, 2016/09/05
- [Qemu-devel] [Patch v4 21/30] s390x/kvm: implement CPU model support, David Hildenbrand, 2016/09/05
- [Qemu-devel] [Patch v4 07/30] s390x/cpumodel: introduce CPU feature group definitions, David Hildenbrand, 2016/09/05
- [Qemu-devel] [Patch v4 20/30] s390x/kvm: allow runtime-instrumentation for "none" machine, David Hildenbrand, 2016/09/05
- [Qemu-devel] [Patch v4 28/30] s390x/cpumodel: implement QMP interface "query-cpu-model-expansion", David Hildenbrand, 2016/09/05
- [Qemu-devel] [Patch v4 27/30] qmp: add QMP interface "query-cpu-model-baseline", David Hildenbrand, 2016/09/05
- [Qemu-devel] [Patch v4 25/30] qmp: add QMP interface "query-cpu-model-expansion", David Hildenbrand, 2016/09/05
- [Qemu-devel] [Patch v4 04/30] s390x/cpumodel: introduce CPU features, David Hildenbrand, 2016/09/05
- [Qemu-devel] [Patch v4 29/30] s390x/cpumodel: implement QMP interface "query-cpu-model-comparison", David Hildenbrand, 2016/09/05
- [Qemu-devel] [Patch v4 14/30] s390x/sclp: introduce sclp feature blocks, David Hildenbrand, 2016/09/05
- [Qemu-devel] [Patch v4 06/30] s390x/cpumodel: generate CPU feature group lists,
David Hildenbrand <=
- [Qemu-devel] [Patch v4 13/30] s390x/sclp: factor out preparation of cpu entries, David Hildenbrand, 2016/09/05
- [Qemu-devel] [Patch v4 15/30] s390x/sclp: indicate sclp features, David Hildenbrand, 2016/09/05
- [Qemu-devel] [Patch v4 03/30] s390x/cpumodel: expose CPU class properties, David Hildenbrand, 2016/09/05
- [Qemu-devel] [Patch v4 10/30] s390x/cpumodel: expose features and feature groups as properties, David Hildenbrand, 2016/09/05
- [Qemu-devel] [Patch v4 30/30] s390x/cpumodel: implement QMP interface "query-cpu-model-baseline", David Hildenbrand, 2016/09/05
- [Qemu-devel] [Patch v4 12/30] s390x/cpumodel: check and apply the CPU model, David Hildenbrand, 2016/09/05
- [Qemu-devel] [Patch v4 23/30] s390x/kvm: let the CPU model control CMM(A), David Hildenbrand, 2016/09/05
- [Qemu-devel] [Patch v4 22/30] s390x/kvm: disable host model for problematic compat machines, David Hildenbrand, 2016/09/05
- [Qemu-devel] [Patch v4 02/30] s390x/cpumodel: "host" and "qemu" as CPU subclasses, David Hildenbrand, 2016/09/05
- [Qemu-devel] [Patch v4 11/30] s390x/cpumodel: let the CPU model handle feature checks, David Hildenbrand, 2016/09/05