* [PATCH v4 0/2] query-cpu-model-expansion: report deprecated features
@ 2024-04-29 19:10 Collin Walling
2024-04-29 19:10 ` [PATCH v4 1/2] target/s390x: report deprecated-props in cpu-model-expansion reply Collin Walling
` (3 more replies)
0 siblings, 4 replies; 9+ messages in thread
From: Collin Walling @ 2024-04-29 19:10 UTC (permalink / raw)
To: qemu-s390x, qemu-devel
Cc: thuth, david, wangyanan55, philmd, marcel.apfelbaum, eduardo,
armbru, Collin Walling
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
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v4 1/2] target/s390x: report deprecated-props in cpu-model-expansion reply
2024-04-29 19:10 [PATCH v4 0/2] query-cpu-model-expansion: report deprecated features Collin Walling
@ 2024-04-29 19:10 ` 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
` (2 subsequent siblings)
3 siblings, 2 replies; 9+ messages in thread
From: Collin Walling @ 2024-04-29 19:10 UTC (permalink / raw)
To: qemu-s390x, qemu-devel
Cc: thuth, david, wangyanan55, philmd, marcel.apfelbaum, eduardo,
armbru, Collin Walling
Retain a list of deprecated features disjoint from any particular
CPU model. A query-cpu-model-expansion reply will now provide a list of
properties (i.e. features) that are flagged as deprecated. Example:
{
"return": {
"model": {
"name": "z14.2-base",
"deprecated-props": [
"bpb",
"csske"
],
"props": {
"pfmfi": false,
"exrl": true,
...a lot more props...
"skey": false,
"vxpdeh2": false
}
}
}
}
It is recommended that s390 guests operate with these features
explicitly disabled to ensure compatability with future hardware.
Signed-off-by: Collin Walling <walling@linux.ibm.com>
---
qapi/machine-target.json | 7 ++++++-
target/s390x/cpu_features.c | 14 ++++++++++++++
target/s390x/cpu_features.h | 1 +
target/s390x/cpu_models_sysemu.c | 8 ++++++++
4 files changed, 29 insertions(+), 1 deletion(-)
diff --git a/qapi/machine-target.json b/qapi/machine-target.json
index 29e695aa06..2942853092 100644
--- a/qapi/machine-target.json
+++ b/qapi/machine-target.json
@@ -20,11 +20,16 @@
#
# @props: a dictionary of QOM properties to be applied
#
+# @deprecated-props: a list of properties that are flagged as deprecated
+# by the CPU vendor. These props are a subset of the full model's
+# definition list of properties. (since 9.1)
+#
# Since: 2.8
##
{ 'struct': 'CpuModelInfo',
'data': { 'name': 'str',
- '*props': 'any' } }
+ '*props': 'any',
+ '*deprecated-props': ['str'] } }
##
# @CpuModelExpansionType:
diff --git a/target/s390x/cpu_features.c b/target/s390x/cpu_features.c
index d28eb65845..efafc9711c 100644
--- a/target/s390x/cpu_features.c
+++ b/target/s390x/cpu_features.c
@@ -212,6 +212,20 @@ void s390_feat_bitmap_to_ascii(const S390FeatBitmap features, void *opaque,
};
}
+void s390_get_deprecated_features(S390FeatBitmap features)
+{
+ static const int feats[] = {
+ /* CSSKE is deprecated on newer generations */
+ S390_FEAT_CONDITIONAL_SSKE,
+ S390_FEAT_BPB,
+ };
+ int i;
+
+ for (i = 0; i < ARRAY_SIZE(feats); i++) {
+ set_bit(feats[i], features);
+ }
+}
+
#define FEAT_GROUP_INIT(_name, _group, _desc) \
{ \
.name = _name, \
diff --git a/target/s390x/cpu_features.h b/target/s390x/cpu_features.h
index a9bd68a2e1..661a8cd6db 100644
--- a/target/s390x/cpu_features.h
+++ b/target/s390x/cpu_features.h
@@ -69,6 +69,7 @@ void s390_add_from_feat_block(S390FeatBitmap features, S390FeatType type,
uint8_t *data);
void s390_feat_bitmap_to_ascii(const S390FeatBitmap features, void *opaque,
void (*fn)(const char *name, void *opaque));
+void s390_get_deprecated_features(S390FeatBitmap features);
/* Definition of a CPU feature group */
typedef struct {
diff --git a/target/s390x/cpu_models_sysemu.c b/target/s390x/cpu_models_sysemu.c
index 2d99218069..abdd0e19d8 100644
--- a/target/s390x/cpu_models_sysemu.c
+++ b/target/s390x/cpu_models_sysemu.c
@@ -206,6 +206,14 @@ static void cpu_info_from_model(CpuModelInfo *info, const S390CPUModel *model,
} else {
info->props = QOBJECT(qdict);
}
+
+ /* features flagged as deprecated */
+ bitmap_zero(bitmap, S390_FEAT_MAX);
+ s390_get_deprecated_features(bitmap);
+
+ bitmap_and(bitmap, bitmap, model->def->full_feat, S390_FEAT_MAX);
+ s390_feat_bitmap_to_ascii(bitmap, &info->deprecated_props, list_add_feat);
+ info->has_deprecated_props = !!info->deprecated_props;
}
CpuModelExpansionInfo *qmp_query_cpu_model_expansion(CpuModelExpansionType type,
--
2.43.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH v4 2/2] target/s390x: flag te and cte as deprecated
2024-04-29 19:10 [PATCH v4 0/2] query-cpu-model-expansion: report deprecated features Collin Walling
2024-04-29 19:10 ` [PATCH v4 1/2] target/s390x: report deprecated-props in cpu-model-expansion reply Collin Walling
@ 2024-04-29 19:10 ` 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
3 siblings, 1 reply; 9+ messages in thread
From: Collin Walling @ 2024-04-29 19:10 UTC (permalink / raw)
To: qemu-s390x, qemu-devel
Cc: thuth, david, wangyanan55, philmd, marcel.apfelbaum, eduardo,
armbru, Collin Walling
Add the CONSTRAINT_TRANSACTIONAL_EXE (cte) and TRANSACTIONAL_EXE (te)
to the list of deprecated features.
Signed-off-by: Collin Walling <walling@linux.ibm.com>
---
target/s390x/cpu_features.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/target/s390x/cpu_features.c b/target/s390x/cpu_features.c
index efafc9711c..cb4e2b8920 100644
--- a/target/s390x/cpu_features.c
+++ b/target/s390x/cpu_features.c
@@ -218,6 +218,9 @@ void s390_get_deprecated_features(S390FeatBitmap features)
/* 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;
--
2.43.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH v4 1/2] target/s390x: report deprecated-props in cpu-model-expansion reply
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
1 sibling, 0 replies; 9+ messages in thread
From: Markus Armbruster @ 2024-04-30 5:26 UTC (permalink / raw)
To: Collin Walling
Cc: qemu-s390x, qemu-devel, thuth, david, wangyanan55, philmd,
marcel.apfelbaum, eduardo
Collin Walling <walling@linux.ibm.com> writes:
> Retain a list of deprecated features disjoint from any particular
> CPU model. A query-cpu-model-expansion reply will now provide a list of
> properties (i.e. features) that are flagged as deprecated. Example:
>
> {
> "return": {
> "model": {
> "name": "z14.2-base",
> "deprecated-props": [
> "bpb",
> "csske"
> ],
> "props": {
> "pfmfi": false,
> "exrl": true,
> ...a lot more props...
> "skey": false,
> "vxpdeh2": false
> }
> }
> }
> }
>
> It is recommended that s390 guests operate with these features
> explicitly disabled to ensure compatability with future hardware.
>
> Signed-off-by: Collin Walling <walling@linux.ibm.com>
QAPI schema
Acked-by: Markus Armbruster <armbru@redhat.com>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v4 2/2] target/s390x: flag te and cte as deprecated
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
0 siblings, 0 replies; 9+ messages in thread
From: David Hildenbrand @ 2024-04-30 10:12 UTC (permalink / raw)
To: Collin Walling, qemu-s390x, qemu-devel
Cc: thuth, wangyanan55, philmd, marcel.apfelbaum, eduardo, armbru
On 29.04.24 21:10, Collin Walling wrote:
> Add the CONSTRAINT_TRANSACTIONAL_EXE (cte) and TRANSACTIONAL_EXE (te)
> to the list of deprecated features.
>
> Signed-off-by: Collin Walling <walling@linux.ibm.com>
> ---
> target/s390x/cpu_features.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/target/s390x/cpu_features.c b/target/s390x/cpu_features.c
> index efafc9711c..cb4e2b8920 100644
> --- a/target/s390x/cpu_features.c
> +++ b/target/s390x/cpu_features.c
> @@ -218,6 +218,9 @@ void s390_get_deprecated_features(S390FeatBitmap features)
> /* 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;
>
Reviewed-by: David Hildenbrand <david@redhat.com>
--
Cheers,
David / dhildenb
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v4 1/2] target/s390x: report deprecated-props in cpu-model-expansion reply
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
1 sibling, 0 replies; 9+ messages in thread
From: David Hildenbrand @ 2024-04-30 10:13 UTC (permalink / raw)
To: Collin Walling, qemu-s390x, qemu-devel
Cc: thuth, wangyanan55, philmd, marcel.apfelbaum, eduardo, armbru
On 29.04.24 21:10, Collin Walling wrote:
> Retain a list of deprecated features disjoint from any particular
> CPU model. A query-cpu-model-expansion reply will now provide a list of
> properties (i.e. features) that are flagged as deprecated. Example:
>
> {
> "return": {
> "model": {
> "name": "z14.2-base",
> "deprecated-props": [
> "bpb",
> "csske"
> ],
> "props": {
> "pfmfi": false,
> "exrl": true,
> ...a lot more props...
> "skey": false,
> "vxpdeh2": false
> }
> }
> }
> }
>
> It is recommended that s390 guests operate with these features
> explicitly disabled to ensure compatability with future hardware.
>
> Signed-off-by: Collin Walling <walling@linux.ibm.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
--
Cheers,
David / dhildenb
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v4 0/2] query-cpu-model-expansion: report deprecated features
2024-04-29 19:10 [PATCH v4 0/2] query-cpu-model-expansion: report deprecated features Collin Walling
2024-04-29 19:10 ` [PATCH v4 1/2] target/s390x: report deprecated-props in cpu-model-expansion reply Collin Walling
2024-04-29 19:10 ` [PATCH v4 2/2] target/s390x: flag te and cte as deprecated Collin Walling
@ 2024-04-30 17:17 ` Collin Walling
2024-05-06 12:13 ` Thomas Huth
3 siblings, 0 replies; 9+ messages in thread
From: Collin Walling @ 2024-04-30 17:17 UTC (permalink / raw)
To: qemu-s390x, qemu-devel
Cc: thuth, david, wangyanan55, philmd, marcel.apfelbaum, eduardo,
armbru
[...]
Thank you all for the valuable feedback. Since the QEMU interface seems
stable, I will rework my libvirt (not upstream) and post as an RFC.
--
Regards,
Collin
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v4 0/2] query-cpu-model-expansion: report deprecated features
2024-04-29 19:10 [PATCH v4 0/2] query-cpu-model-expansion: report deprecated features Collin Walling
` (2 preceding siblings ...)
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
3 siblings, 1 reply; 9+ messages in thread
From: Thomas Huth @ 2024-05-06 12:13 UTC (permalink / raw)
To: Collin Walling, qemu-s390x, qemu-devel
Cc: david, wangyanan55, philmd, marcel.apfelbaum, eduardo, armbru
On 29/04/2024 21.10, Collin Walling wrote:
> 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.
>
Thanks, queued for my next pull request now.
Thomas
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v4 0/2] query-cpu-model-expansion: report deprecated features
2024-05-06 12:13 ` Thomas Huth
@ 2024-05-07 22:35 ` Collin Walling
0 siblings, 0 replies; 9+ messages in thread
From: Collin Walling @ 2024-05-07 22:35 UTC (permalink / raw)
To: Thomas Huth, qemu-s390x, qemu-devel
Cc: david, wangyanan55, philmd, marcel.apfelbaum, eduardo, armbru
[...]
Thanks everyone! The RFC for the analogous libvirt patches have been
posted under the subject:
[RFC PATCH 0/1] support deprecated-props from query-cpu-model-expansion
Any and all feedback is welcome.
--
Regards,
Collin
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2024-05-07 22:36 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-29 19:10 [PATCH v4 0/2] query-cpu-model-expansion: report deprecated features Collin Walling
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
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).