aboutsummaryrefslogtreecommitdiff
path: root/target-s390x/cpu_features.h
diff options
context:
space:
mode:
authorDavid Hildenbrand <dahi@linux.vnet.ibm.com>2016-09-05 10:52:21 +0200
committerCornelia Huck <cornelia.huck@de.ibm.com>2016-09-06 17:06:49 +0200
commit8b3d6cb1fa6ae12e80ed8c266a637468b52835c7 (patch)
tree21fc95a0a97303dbcdde51d3838cfb80e6161ec8 /target-s390x/cpu_features.h
parent90229ebbad508ba604f215e90c7c5cc0fbc3559a (diff)
s390x/cpumodel: introduce CPU feature group definitions
Let's use the generated groups to create feature group representations for the user. These groups can later be used to enable/disable multiple features in one shot and will be used to reduce the amount of reported features to the user if all subfeatures are in place. 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 a proper bitmaps before they will ever be used. Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Message-Id: <20160905085244.99980-8-dahi@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Diffstat (limited to 'target-s390x/cpu_features.h')
-rw-r--r--target-s390x/cpu_features.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/target-s390x/cpu_features.h b/target-s390x/cpu_features.h
index c69ba36884..d669121786 100644
--- a/target-s390x/cpu_features.h
+++ b/target-s390x/cpu_features.h
@@ -63,6 +63,30 @@ void s390_add_from_feat_block(S390FeatBitmap features, S390FeatType type,
void s390_feat_bitmap_to_ascii(const S390FeatBitmap features, void *opaque,
void (*fn)(const char *name, void *opaque));
+/* static groups that will never change */
+typedef enum {
+ S390_FEAT_GROUP_PLO,
+ S390_FEAT_GROUP_TOD_CLOCK_STEERING,
+ S390_FEAT_GROUP_GEN13_PTFF_ENH,
+ S390_FEAT_GROUP_MSA,
+ S390_FEAT_GROUP_MSA_EXT_1,
+ S390_FEAT_GROUP_MSA_EXT_2,
+ S390_FEAT_GROUP_MSA_EXT_3,
+ S390_FEAT_GROUP_MSA_EXT_4,
+ S390_FEAT_GROUP_MSA_EXT_5,
+ S390_FEAT_GROUP_MAX,
+} S390FeatGroup;
+
+/* Definition of a CPU feature group */
+typedef struct {
+ const char *name; /* name exposed to the user */
+ const char *desc; /* description exposed to the user */
+ S390FeatBitmap feat; /* features contained in the group */
+ S390FeatInit init; /* used to init feat from generated data */
+} S390FeatGroupDef;
+
+const S390FeatGroupDef *s390_feat_group_def(S390FeatGroup group);
+
#define BE_BIT_NR(BIT) (BIT ^ (BITS_PER_LONG - 1))
#define BE_BIT(BIT) (1ULL < BE_BIT_NR(BIT))