All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] target/s390x: query-cpu-definitions filter deprecated features
@ 2026-07-08 20:21 Collin Walling
  2026-07-09  5:13 ` Markus Armbruster
  0 siblings, 1 reply; 3+ messages in thread
From: Collin Walling @ 2026-07-08 20:21 UTC (permalink / raw)
  To: qemu-s390x, qemu-devel
  Cc: mjrosato, farman, cohuck, david, iii, richard.henderson

Part of the query-cpu-definitions return payload includes an array of
of "unavailable-features" which helps determine if the CPU model is
compatible with the system's configuration.  When a KVM guest is
using a CPU model with deprecated features disabled,
query-cpu-definitions will claim that certain models are incompatible
due to these features missing.

Since deprecated features are preferred to be disabled for s390 CPU
models, lets filter them out from the "missing" features list.

Signed-off-by: Collin Walling <walling@linux.ibm.com>
---

Examples output of query-cpu-definitions ran on a gen17a host:

WithOUT patch:

```
{
  "return": [
    {
      "name": "z13",
      "typename": "z13-s390x-cpu",
      "unavailable-features": [
        "csske"
      ],
      "static": false,
      "migration-safe": true,
      "deprecated": false
    },
    ...
```

WITH patch:

```
{
  "return": [
    {
      "name": "z13",
      "typename": "z13-s390x-cpu",
      "unavailable-features": [],
      "static": false,
      "migration-safe": true,
      "deprecated": false
    },
    ...
```

---

 target/s390x/cpu_models_system.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/target/s390x/cpu_models_system.c b/target/s390x/cpu_models_system.c
index 5b846048675..f2f6b00b547 100644
--- a/target/s390x/cpu_models_system.c
+++ b/target/s390x/cpu_models_system.c
@@ -28,6 +28,7 @@ static void check_unavailable_features(const S390CPUModel *max_model,
                                        strList **unavailable)
 {
     S390FeatBitmap missing;
+    S390FeatBitmap deprecated_feats;
 
     /* check general model compatibility */
     if (max_model->def->gen < model->def->gen ||
@@ -39,6 +40,13 @@ static void check_unavailable_features(const S390CPUModel *max_model,
     /* detect missing features if any to properly report them */
     bitmap_andnot(missing, model->features, max_model->features,
                   S390_FEAT_MAX);
+
+    /* deprecated features are optional so do not report them as missing */
+    bitmap_zero(deprecated_feats, S390_FEAT_MAX);
+    s390_get_deprecated_features(deprecated_feats);
+
+    bitmap_andnot(missing, missing, deprecated_feats, S390_FEAT_MAX);
+
     if (!bitmap_empty(missing, S390_FEAT_MAX)) {
         s390_feat_bitmap_to_ascii(missing, unavailable, list_add_feat);
     }
-- 
2.54.0



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-07-09 16:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-08 20:21 [PATCH] target/s390x: query-cpu-definitions filter deprecated features Collin Walling
2026-07-09  5:13 ` Markus Armbruster
2026-07-09 16:50   ` Collin Walling

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.