From: Collin Walling <walling@linux.ibm.com>
To: qemu-s390x@nongnu.org, qemu-devel@nongnu.org
Cc: mjrosato@linux.ibm.com, farman@linux.ibm.com, cohuck@redhat.com,
david@kernel.org, iii@linux.ibm.com,
richard.henderson@linaro.org
Subject: [PATCH] target/s390x: query-cpu-definitions filter deprecated features
Date: Wed, 8 Jul 2026 16:21:49 -0400 [thread overview]
Message-ID: <20260708202149.103063-1-walling@linux.ibm.com> (raw)
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
next reply other threads:[~2026-07-08 20:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-08 20:21 Collin Walling [this message]
2026-07-09 5:13 ` [PATCH] target/s390x: query-cpu-definitions filter deprecated features Markus Armbruster
2026-07-09 16:50 ` Collin Walling
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260708202149.103063-1-walling@linux.ibm.com \
--to=walling@linux.ibm.com \
--cc=cohuck@redhat.com \
--cc=david@kernel.org \
--cc=farman@linux.ibm.com \
--cc=iii@linux.ibm.com \
--cc=mjrosato@linux.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=richard.henderson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.