29b115
From 8459c305914e2a7a19dcd1662d54a89def7acfa6 Mon Sep 17 00:00:00 2001
29b115
From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
29b115
Date: Thu, 17 Mar 2022 17:59:22 +0000
29b115
Subject: [PATCH 05/18] target/s390x: deprecate CPUs older than z14
29b115
MIME-Version: 1.0
29b115
Content-Type: text/plain; charset=UTF-8
29b115
Content-Transfer-Encoding: 8bit
29b115
29b115
RH-Author: Daniel P. Berrangé <berrange@redhat.com>
29b115
RH-MergeRequest: 94: i386, aarch64, s390x: deprecate many named CPU models
29b115
RH-Commit: [5/6] 2da9e06cf452287673f94f880a7eb8b2b37b7278 (berrange/centos-src-qemu)
29b115
RH-Bugzilla: 2060839
29b115
RH-Acked-by: Thomas Huth <thuth@redhat.com>
29b115
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
29b115
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
29b115
29b115
RHEL-9 is compiled with the z14 ABI. We use this as a baseline to
29b115
select which CPUs we want to support, such that there is at least one
29b115
supported guest CPU that can be launched for every physical
29b115
machine capable of running RHEL-9 KVM.
29b115
29b115
Supported CPUs:
29b115
29b115
      gen15a-base
29b115
      gen15a
29b115
      gen15b-base
29b115
      gen15b
29b115
      gen16a-base
29b115
      gen16a
29b115
      gen16b-base
29b115
      gen16b
29b115
      max
29b115
      qemu
29b115
      z14.2-base
29b115
      z14.2
29b115
      z14-base
29b115
      z14
29b115
      z14ZR1-base
29b115
      z14ZR1
29b115
29b115
Deprecated CPUs:
29b115
29b115
      z10BC.2-base
29b115
      z10BC.2
29b115
      z10BC-base
29b115
      z10BC
29b115
      z10EC.2-base
29b115
      z10EC.2
29b115
      z10EC.3-base
29b115
      z10EC.3
29b115
      z10EC-base
29b115
      z10EC
29b115
      z114-base
29b115
      z114
29b115
      z13.2-base
29b115
      z13.2
29b115
      z13-base
29b115
      z13s-base
29b115
      z13s
29b115
      z13
29b115
      z196.2-base
29b115
      z196.2
29b115
      z196-base
29b115
      z196
29b115
      z800-base
29b115
      z800
29b115
      z890.2-base
29b115
      z890.2
29b115
      z890.3-base
29b115
      z890.3
29b115
      z890-base
29b115
      z890
29b115
      z900.2-base
29b115
      z900.2
29b115
      z900.3-base
29b115
      z900.3
29b115
      z900-base
29b115
      z900
29b115
      z990.2-base
29b115
      z990.2
29b115
      z990.3-base
29b115
      z990.3
29b115
      z990.4-base
29b115
      z990.4
29b115
      z990.5-base
29b115
      z990.5
29b115
      z990-base
29b115
      z990
29b115
      z9BC.2-base
29b115
      z9BC.2
29b115
      z9BC-base
29b115
      z9BC
29b115
      z9EC.2-base
29b115
      z9EC.2
29b115
      z9EC.3-base
29b115
      z9EC.3
29b115
      z9EC-base
29b115
      z9EC
29b115
      zBC12-base
29b115
      zBC12
29b115
      zEC12.2-base
29b115
      zEC12.2
29b115
      zEC12-base
29b115
      zEC12
29b115
29b115
https://bugzilla.redhat.com/show_bug.cgi?id=2060839
29b115
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
29b115
---
29b115
 target/s390x/cpu_models.c        | 11 +++++++++++
29b115
 target/s390x/cpu_models.h        |  2 ++
29b115
 target/s390x/cpu_models_sysemu.c |  2 ++
29b115
 3 files changed, 15 insertions(+)
29b115
29b115
diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c
29b115
index 6d71428056..9b9fc41676 100644
29b115
--- a/target/s390x/cpu_models.c
29b115
+++ b/target/s390x/cpu_models.c
29b115
@@ -45,6 +45,9 @@
29b115
  * of a following release have been a superset of the previous release. With
29b115
  * generation 15 one base feature and one optional feature have been deprecated.
29b115
  */
29b115
+
29b115
+#define RHEL_CPU_DEPRECATION "use at least 'z14', or 'host' / 'qemu' / 'max'"
29b115
+
29b115
 static S390CPUDef s390_cpu_defs[] = {
29b115
     CPUDEF_INIT(0x2064, 7, 1, 38, 0x00000000U, "z900", "IBM zSeries 900 GA1"),
29b115
     CPUDEF_INIT(0x2064, 7, 2, 38, 0x00000000U, "z900.2", "IBM zSeries 900 GA2"),
29b115
@@ -852,22 +855,30 @@ static void s390_host_cpu_model_class_init(ObjectClass *oc, void *data)
29b115
 static void s390_base_cpu_model_class_init(ObjectClass *oc, void *data)
29b115
 {
29b115
     S390CPUClass *xcc = S390_CPU_CLASS(oc);
29b115
+    CPUClass *cc = CPU_CLASS(oc);
29b115
 
29b115
     /* all base models are migration safe */
29b115
     xcc->cpu_def = (const S390CPUDef *) data;
29b115
     xcc->is_migration_safe = true;
29b115
     xcc->is_static = true;
29b115
     xcc->desc = xcc->cpu_def->desc;
29b115
+    if (xcc->cpu_def->gen < 14) {
29b115
+        cc->deprecation_note = RHEL_CPU_DEPRECATION;
29b115
+    }
29b115
 }
29b115
 
29b115
 static void s390_cpu_model_class_init(ObjectClass *oc, void *data)
29b115
 {
29b115
     S390CPUClass *xcc = S390_CPU_CLASS(oc);
29b115
+    CPUClass *cc = CPU_CLASS(oc);
29b115
 
29b115
     /* model that can change between QEMU versions */
29b115
     xcc->cpu_def = (const S390CPUDef *) data;
29b115
     xcc->is_migration_safe = true;
29b115
     xcc->desc = xcc->cpu_def->desc;
29b115
+    if (xcc->cpu_def->gen < 14) {
29b115
+        cc->deprecation_note = RHEL_CPU_DEPRECATION;
29b115
+    }
29b115
 }
29b115
 
29b115
 static void s390_qemu_cpu_model_class_init(ObjectClass *oc, void *data)
29b115
diff --git a/target/s390x/cpu_models.h b/target/s390x/cpu_models.h
29b115
index 74d1f87e4f..372160bcd7 100644
29b115
--- a/target/s390x/cpu_models.h
29b115
+++ b/target/s390x/cpu_models.h
29b115
@@ -38,6 +38,8 @@ struct S390CPUDef {
29b115
     S390FeatBitmap full_feat;
29b115
     /* used to init full_feat from generated data */
29b115
     S390FeatInit full_init;
29b115
+    /* if deprecated, provides a suggestion */
29b115
+    const char *deprecation_note;
29b115
 };
29b115
 
29b115
 /* CPU model based on a CPU definition */
29b115
diff --git a/target/s390x/cpu_models_sysemu.c b/target/s390x/cpu_models_sysemu.c
29b115
index 6a04ccab1b..f3b7c304ec 100644
29b115
--- a/target/s390x/cpu_models_sysemu.c
29b115
+++ b/target/s390x/cpu_models_sysemu.c
29b115
@@ -61,6 +61,7 @@ static void create_cpu_model_list(ObjectClass *klass, void *opaque)
29b115
     CpuDefinitionInfo *info;
29b115
     char *name = g_strdup(object_class_get_name(klass));
29b115
     S390CPUClass *scc = S390_CPU_CLASS(klass);
29b115
+    CPUClass *cc = CPU_CLASS(klass);
29b115
 
29b115
     /* strip off the -s390x-cpu */
29b115
     g_strrstr(name, "-" TYPE_S390_CPU)[0] = 0;
29b115
@@ -70,6 +71,7 @@ static void create_cpu_model_list(ObjectClass *klass, void *opaque)
29b115
     info->migration_safe = scc->is_migration_safe;
29b115
     info->q_static = scc->is_static;
29b115
     info->q_typename = g_strdup(object_class_get_name(klass));
29b115
+    info->deprecated = !!cc->deprecation_note;
29b115
     /* check for unavailable features */
29b115
     if (cpu_list_data->model) {
29b115
         Object *obj;
29b115
-- 
29b115
2.35.3
29b115