From 4acb439f71797a92ad4d442becdeff28fc36c83a Mon Sep 17 00:00:00 2001
From: David Hildenbrand <david@redhat.com>
Date: Wed, 22 May 2019 08:04:01 +0100
Subject: [PATCH 09/12] s390x/cpumodel: add gen15 defintions
RH-Author: David Hildenbrand <david@redhat.com>
Message-id: <20190522080402.20173-10-david@redhat.com>
Patchwork-id: 88156
O-Subject: [RHEL8.1 qemu-kvm PATCH v2 09/10] s390x/cpumodel: add gen15 defintions
Bugzilla: 1660912
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
RH-Acked-by: Jens Freimann <jfreimann@redhat.com>
RH-Acked-by: Thomas Huth <thuth@redhat.com>
add several new features (msa9, sort, deflate, additional vector
instructions, new general purpose instructions) to generation 15.
Also disable csske and bpb from the default and base models >=15.
This will allow to migrate gen15 machines to future machines that
do not have these features.
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Message-Id: <20190429090250.7648-9-borntraeger@de.ibm.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
(cherry picked from commit caef62430fed6e732d3e43d76752d165cf02ad67)
Conflicts:
target/s390x/gen-features.c:
Minor contextual conflict due to a different z14-GA2
default model definition (upstream already adds these
features to the z14-GA1 model).
Signed-off-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
target/s390x/gen-features.c | 37 +++++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)
diff --git a/target/s390x/gen-features.c b/target/s390x/gen-features.c
index c61bce2..818d51c 100644
--- a/target/s390x/gen-features.c
+++ b/target/s390x/gen-features.c
@@ -13,6 +13,7 @@
#include <inttypes.h>
#include <stdio.h>
+#include <string.h>
#include "cpu_features_def.h"
#define ARRAY_SIZE(array) (sizeof(array) / sizeof(array[0]))
@@ -419,6 +420,10 @@ static uint16_t base_GEN14_GA1[] = {
#define base_GEN14_GA2 EmptyFeat
+static uint16_t base_GEN15_GA1[] = {
+ S390_FEAT_MISC_INSTRUCTION_EXT3,
+};
+
/* Full features (in order of release)
* Automatically includes corresponding base features.
* Full features are all features this hardware supports even if kvm/QEMU do not
@@ -548,6 +553,16 @@ static uint16_t full_GEN14_GA1[] = {
#define full_GEN14_GA2 EmptyFeat
+static uint16_t full_GEN15_GA1[] = {
+ S390_FEAT_VECTOR_ENH2,
+ S390_FEAT_GROUP_ENH_SORT,
+ S390_FEAT_GROUP_DEFLATE_CONVERSION,
+ S390_FEAT_VECTOR_BCD_ENH,
+ S390_FEAT_GROUP_MSA_EXT_9,
+ S390_FEAT_GROUP_MSA_EXT_9_PCKMO,
+ S390_FEAT_ETOKEN,
+};
+
/* Default features (in order of release)
* Automatically includes corresponding base features.
* Default features are all features this version of QEMU supports for this
@@ -630,6 +645,16 @@ static uint16_t default_GEN14_GA2[] = {
S390_FEAT_GROUP_MULTIPLE_EPOCH_PTFF,
};
+static uint16_t default_GEN15_GA1[] = {
+ S390_FEAT_VECTOR_ENH2,
+ S390_FEAT_GROUP_ENH_SORT,
+ S390_FEAT_GROUP_DEFLATE_CONVERSION,
+ S390_FEAT_VECTOR_BCD_ENH,
+ S390_FEAT_GROUP_MSA_EXT_9,
+ S390_FEAT_GROUP_MSA_EXT_9_PCKMO,
+ S390_FEAT_ETOKEN,
+};
+
/* QEMU (CPU model) features */
static uint16_t qemu_V2_11[] = {
@@ -739,6 +764,7 @@ static CpuFeatDefSpec CpuFeatDef[] = {
CPU_FEAT_INITIALIZER(GEN13_GA2),
CPU_FEAT_INITIALIZER(GEN14_GA1),
CPU_FEAT_INITIALIZER(GEN14_GA2),
+ CPU_FEAT_INITIALIZER(GEN15_GA1),
};
#define FEAT_GROUP_INITIALIZER(_name) \
@@ -806,6 +832,11 @@ static void set_bits(uint64_t list[], BitSpec bits)
}
}
+static inline void clear_bit(uint64_t list[], unsigned long nr)
+{
+ list[nr / 64] &= ~(1ULL << (nr % 64));
+}
+
static void print_feature_defs(void)
{
uint64_t base_feat[S390_FEAT_MAX / 64 + 1] = {};
@@ -816,6 +847,12 @@ static void print_feature_defs(void)
printf("\n/* CPU model feature list data */\n");
for (i = 0; i < ARRAY_SIZE(CpuFeatDef); i++) {
+ /* With gen15 CSSKE and BPB are deprecated */
+ if (strcmp(CpuFeatDef[i].name, "S390_FEAT_LIST_GEN15_GA1") == 0) {
+ clear_bit(base_feat, S390_FEAT_CONDITIONAL_SSKE);
+ clear_bit(default_feat, S390_FEAT_CONDITIONAL_SSKE);
+ clear_bit(default_feat, S390_FEAT_BPB);
+ }
set_bits(base_feat, CpuFeatDef[i].base_bits);
/* add the base to the default features */
set_bits(default_feat, CpuFeatDef[i].base_bits);
--
1.8.3.1