qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] query-cpu-model-expansion: add disable-deprecated-feats arg
@ 2024-04-23 21:06 Collin Walling
  2024-04-23 21:06 ` [PATCH v2 1/3] cpu-models: add "disable-deprecated-feats" option to cpu model expansion Collin Walling
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Collin Walling @ 2024-04-23 21:06 UTC (permalink / raw)
  To: qemu-s390x, qemu-devel
  Cc: thuth, david, wangyanan55, philmd, marcel.apfelbaum, eduardo,
	armbru, Collin Walling

The current implementation of query-cpu-model-expansion is lacking a way to
conditionally retrieve CPU models with properties (i.e. features) that are
flagged as deprecated set to disabled. To remedy this, a new optional boolean
"disable-deprecated-feats" argument has been added to the query.

Here is a sample QMP command that includes this new argument:

    { "execute": "query-cpu-model-expansion", "arguments": { "type": "full", "model": { "name": "host" }, "disable-deprecated-features": true}}

This patchset adds full support for this argument on s390x. A simple interface is
designed that contains an array of feature bits that are flagged for deprecation.
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);
        }
    }

For architectures that support model expansion but do not support the new arg,
an error message will print to stdio if this option is present.

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.

This feature may alleviate this issue by allowing for a query of a CPU model
with deprecated features listed in the props response paired with false. The
caller of this query may use this information to explicitly disable these
features for the guest's CPU model, ensuring a safe migration to the next
generation if desired.

I have developed a way for libvirt to make use of this functionality, but I
will hold back review on those patches until a QEMU interface is agreed upon.

Collin L. Walling (3):
  cpu-models: add "disable-deprecated-feats" option to cpu model
    expansion
  target/s390x: add support for "disable-deprecated-feats" expansion
    option
  target/s390x: flag te and cte as deprecated

 qapi/machine-target.json         |  7 ++++++-
 target/arm/arm-qmp-cmds.c        |  7 +++++++
 target/i386/cpu-sysemu.c         |  7 +++++++
 target/s390x/cpu_features.c      | 17 +++++++++++++++++
 target/s390x/cpu_features.h      |  1 +
 target/s390x/cpu_models_sysemu.c | 17 ++++++++++++++---
 6 files changed, 52 insertions(+), 4 deletions(-)

-- 
2.43.0



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

end of thread, other threads:[~2024-04-26  8:19 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-23 21:06 [PATCH v2 0/3] query-cpu-model-expansion: add disable-deprecated-feats arg Collin Walling
2024-04-23 21:06 ` [PATCH v2 1/3] cpu-models: add "disable-deprecated-feats" option to cpu model expansion Collin Walling
2024-04-24  6:19   ` Markus Armbruster
2024-04-24 17:46     ` Collin Walling
2024-04-25  6:31       ` Markus Armbruster
2024-04-25 17:35         ` Collin Walling
2024-04-26  8:18           ` Markus Armbruster
2024-04-24  8:20   ` Daniel P. Berrangé
2024-04-24 17:51     ` Collin Walling
2024-04-24 19:12       ` Collin Walling
2024-04-25 13:35         ` Daniel P. Berrangé
2024-04-25 16:58           ` Collin Walling
2024-04-23 21:06 ` [PATCH v2 2/3] target/s390x: add support for "disable-deprecated-feats" expansion option Collin Walling
2024-04-24  7:24   ` David Hildenbrand
2024-04-24 18:33     ` Collin Walling
2024-04-25  8:10       ` David Hildenbrand
2024-04-25 16:56         ` Collin Walling
2024-04-23 21:06 ` [PATCH v2 3/3] target/s390x: flag te and cte as deprecated Collin Walling

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 NNTP newsgroup(s).