QEMU-Devel Archive mirror
 help / color / mirror / Atom feed
From: Collin Walling <walling@linux.ibm.com>
To: qemu-s390x@nongnu.org, qemu-devel@nongnu.org
Cc: thuth@redhat.com, david@redhat.com, wangyanan55@huawei.com,
	philmd@linaro.org, marcel.apfelbaum@gmail.com,
	eduardo@habkost.net, armbru@redhat.com,
	Collin Walling <walling@linux.ibm.com>
Subject: [PATCH v4 0/2] query-cpu-model-expansion: report deprecated features
Date: Mon, 29 Apr 2024 15:10:57 -0400	[thread overview]
Message-ID: <20240429191059.11806-1-walling@linux.ibm.com> (raw)

Changelog

    v4
        - updated cover letter to show example output
        - deprecated features are now a subset of the full CPU model's
            list of features
            - value: 
                1. no longer listing the deprecated features for CPU
                     models that never had these features available in the
                     first place
                2. deprecated features will not show up for future CPU 
                     models that out-right drop these features
        - updated qapi documentation
            - now reflects that these props are a subset of the full
                model's definition of properties
            - added Since: tag to deprecated-props (assuming 9.1)

    v3
        - removed optional disable-deprecated-feats argument
        - added deprecated-props array to CpuModelInfo struct
        - amended cover letter language to reflect design

    v2 
        - removed "static-recommended" expansion type
        - implemented optional disable-deprecated-feats argument

---

The current implementation of query-cpu-model-expansion is lacking a way to retrieve
CPU models with properties (i.e. features) that are flagged as deprecated.  To remedy
this, a list of deprecated-props has been appended to the CpuModelInfo struct, and
will currently be reported by a query-cpu-model-expansion.  The features reported in
the output are a subset of the full CPU model expansion.

Output example with host-model (z14):

{
  "execute": "query-cpu-model-expansion",
  "arguments": {
    "type": "static",
    "model": {
      "name": "host"
    }
  }
}
{
  "return": {
    "model": {
      "name": "z14.2-base",
      "deprecated-props": [
        "bpb",
        "te",
        "cte",
        "csske"
      ],
      "props": {
        "aen": true,
        "cmmnt": true,
        "aefsi": true,
        "diag318": true,
        "mepoch": true,
        "msa8": true,
        "msa7": true,
        "msa6": true,
        "msa5": true,
        "msa4": true,
        "msa3": true,
        "msa2": true,
        "msa1": true,
        "sthyi": true,
        "edat": true,
        "ri": true,
        "edat2": true,
        "etoken": true,
        "vx": true,
        "ipter": true,
        "mepochptff": true,
        "ap": true,
        "vxeh": true,
        "vxpd": true,
        "esop": true,
        "apqi": true,
        "apft": true,
        "els": true,
        "iep": true,
        "apqci": true,
        "cte": true,
        "ais": true,
        "bpb": true,
        "ctop": true,
        "gs": true,
        "ppa15": true,
        "zpci": true,
        "sea_esop2": true,
        "te": true,
        "cmm": true
      }
    }
  }
}

Example output with an older CPU model:

{
  "execute": "query-cpu-model-expansion",
  "arguments": {
    "type": "static",
    "model": {
      "name": "z10EC"
    }
  }
}
{
  "return": {
    "model": {
      "name": "z10EC-base",
      "deprecated-props": [
        "bpb",
        "csske"
      ],
      "props": {
        "msa2": true,
        "msa1": true,
        "sthyi": true,
        "edat": true,
        "cmm": true
      }
    }
  }
}

A simple interface is designed that contains an array of feature bits that are flagged
as deprecated.  This list may be easily populated with more features in the future.

    void s390_get_deprecated_features(S390FeatBitmap features)
    {
        static const int feats[] = {
             /* CSSKE is deprecated on newer generations */
             S390_FEAT_CONDITIONAL_SSKE,
             S390_FEAT_BPB,
             /* Deprecated on z16 */
             S390_FEAT_CONSTRAINT_TRANSACTIONAL_EXE,
             S390_FEAT_TRANSACTIONAL_EXE
        };
        int i;

        for (i = 0; i < ARRAY_SIZE(feats); i++) {
            set_bit(feats[i], features);
        }
    }

Use case example:

Newer s390 machines may signal the end-of-support for particular CPU features,
rendering guests operating with older CPU models incapable of running on
said machines.  A manual effort to disable certain CPU features would be
required.

Reporting a list of deprecated features allows the user / management app to
take the next steps to ensure the guest is defined in a way that ensures
a migration in the future.

Collin L. Walling (2):
  target/s390x: report deprecated-props in cpu-model-expansion reply
  target/s390x: flag te and cte as deprecated

 qapi/machine-target.json         |  7 ++++++-
 target/s390x/cpu_features.c      | 17 +++++++++++++++++
 target/s390x/cpu_features.h      |  1 +
 target/s390x/cpu_models_sysemu.c |  8 ++++++++
 4 files changed, 32 insertions(+), 1 deletion(-)

-- 
2.43.0



             reply	other threads:[~2024-04-29 19:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-29 19:10 Collin Walling [this message]
2024-04-29 19:10 ` [PATCH v4 1/2] target/s390x: report deprecated-props in cpu-model-expansion reply Collin Walling
2024-04-30  5:26   ` Markus Armbruster
2024-04-30 10:13   ` David Hildenbrand
2024-04-29 19:10 ` [PATCH v4 2/2] target/s390x: flag te and cte as deprecated Collin Walling
2024-04-30 10:12   ` David Hildenbrand
2024-04-30 17:17 ` [PATCH v4 0/2] query-cpu-model-expansion: report deprecated features Collin Walling
2024-05-06 12:13 ` Thomas Huth
2024-05-07 22:35   ` 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=20240429191059.11806-1-walling@linux.ibm.com \
    --to=walling@linux.ibm.com \
    --cc=armbru@redhat.com \
    --cc=david@redhat.com \
    --cc=eduardo@habkost.net \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=thuth@redhat.com \
    --cc=wangyanan55@huawei.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).