* [RFC PATCH] qapi: Make CpuModelExpansionInfo::deprecated-props optional and generic
@ 2025-04-29 10:04 Philippe Mathieu-Daudé
2025-05-06 13:51 ` Philippe Mathieu-Daudé
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-29 10:04 UTC (permalink / raw)
To: qemu-devel
Cc: Eduardo Habkost, Markus Armbruster, Marcel Apfelbaum,
Daniel P . Berrangé, Philippe Mathieu-Daudé, qemu-s390x,
Eric Blake, Zhao Liu, Yanan Wang
We'd like to have some unified QAPI schema. Having a structure field
conditional to a target being built in is not very practical.
While @deprecated-props is only used by s390x target, it is generic
enough and could be used by other targets (assuming we expand
CpuModelExpansionType enum values).
Let's always include this field, regardless of the target, but
make it optional.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
qapi/machine-target.json | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/qapi/machine-target.json b/qapi/machine-target.json
index 541f93eeb78..3b109b4af87 100644
--- a/qapi/machine-target.json
+++ b/qapi/machine-target.json
@@ -244,19 +244,18 @@
#
# @model: the expanded CpuModelInfo.
#
-# @deprecated-props: a list of properties that are flagged as
+# @deprecated-props: an optional list of properties that are flagged as
# deprecated by the CPU vendor. The list depends on the
# CpuModelExpansionType: "static" properties are a subset of the
# enabled-properties for the expanded model; "full" properties are
# a set of properties that are deprecated across all models for
-# the architecture. (since: 9.1).
+# the architecture. (since: 10.1 -- since 9.1 on s390x --).
#
# Since: 2.8
##
{ 'struct': 'CpuModelExpansionInfo',
'data': { 'model': 'CpuModelInfo',
- 'deprecated-props' : { 'type': ['str'],
- 'if': 'TARGET_S390X' } },
+ '*deprecated-props' : { 'type': ['str'] } },
'if': { 'any': [ 'TARGET_S390X',
'TARGET_I386',
'TARGET_ARM',
--
2.47.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [RFC PATCH] qapi: Make CpuModelExpansionInfo::deprecated-props optional and generic
2025-04-29 10:04 [RFC PATCH] qapi: Make CpuModelExpansionInfo::deprecated-props optional and generic Philippe Mathieu-Daudé
@ 2025-05-06 13:51 ` Philippe Mathieu-Daudé
2025-05-06 16:15 ` Zhao Liu
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-05-06 13:51 UTC (permalink / raw)
To: qemu-devel
Cc: Eduardo Habkost, Markus Armbruster, Marcel Apfelbaum,
Daniel P . Berrangé, qemu-s390x, Eric Blake, Zhao Liu,
Yanan Wang
ping?
On 29/4/25 12:04, Philippe Mathieu-Daudé wrote:
> We'd like to have some unified QAPI schema. Having a structure field
> conditional to a target being built in is not very practical.
>
> While @deprecated-props is only used by s390x target, it is generic
> enough and could be used by other targets (assuming we expand
> CpuModelExpansionType enum values).
>
> Let's always include this field, regardless of the target, but
> make it optional.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> qapi/machine-target.json | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/qapi/machine-target.json b/qapi/machine-target.json
> index 541f93eeb78..3b109b4af87 100644
> --- a/qapi/machine-target.json
> +++ b/qapi/machine-target.json
> @@ -244,19 +244,18 @@
> #
> # @model: the expanded CpuModelInfo.
> #
> -# @deprecated-props: a list of properties that are flagged as
> +# @deprecated-props: an optional list of properties that are flagged as
> # deprecated by the CPU vendor. The list depends on the
> # CpuModelExpansionType: "static" properties are a subset of the
> # enabled-properties for the expanded model; "full" properties are
> # a set of properties that are deprecated across all models for
> -# the architecture. (since: 9.1).
> +# the architecture. (since: 10.1 -- since 9.1 on s390x --).
> #
> # Since: 2.8
> ##
> { 'struct': 'CpuModelExpansionInfo',
> 'data': { 'model': 'CpuModelInfo',
> - 'deprecated-props' : { 'type': ['str'],
> - 'if': 'TARGET_S390X' } },
> + '*deprecated-props' : { 'type': ['str'] } },
> 'if': { 'any': [ 'TARGET_S390X',
> 'TARGET_I386',
> 'TARGET_ARM',
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RFC PATCH] qapi: Make CpuModelExpansionInfo::deprecated-props optional and generic
2025-04-29 10:04 [RFC PATCH] qapi: Make CpuModelExpansionInfo::deprecated-props optional and generic Philippe Mathieu-Daudé
2025-05-06 13:51 ` Philippe Mathieu-Daudé
@ 2025-05-06 16:15 ` Zhao Liu
2025-05-07 14:41 ` Markus Armbruster
2025-05-08 12:18 ` Markus Armbruster
3 siblings, 0 replies; 6+ messages in thread
From: Zhao Liu @ 2025-05-06 16:15 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: qemu-devel, Eduardo Habkost, Markus Armbruster, Marcel Apfelbaum,
Daniel P . Berrangé, qemu-s390x, Eric Blake, Yanan Wang
On Tue, Apr 29, 2025 at 12:04:19PM +0200, Philippe Mathieu-Daudé wrote:
> Date: Tue, 29 Apr 2025 12:04:19 +0200
> From: Philippe Mathieu-Daudé <philmd@linaro.org>
> Subject: [RFC PATCH] qapi: Make CpuModelExpansionInfo::deprecated-props
> optional and generic
> X-Mailer: git-send-email 2.47.1
>
> We'd like to have some unified QAPI schema. Having a structure field
> conditional to a target being built in is not very practical.
>
> While @deprecated-props is only used by s390x target, it is generic
> enough and could be used by other targets (assuming we expand
> CpuModelExpansionType enum values).
>
> Let's always include this field, regardless of the target, but
> make it optional.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> qapi/machine-target.json | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/qapi/machine-target.json b/qapi/machine-target.json
> index 541f93eeb78..3b109b4af87 100644
> --- a/qapi/machine-target.json
> +++ b/qapi/machine-target.json
> @@ -244,19 +244,18 @@
> #
> # @model: the expanded CpuModelInfo.
> #
> -# @deprecated-props: a list of properties that are flagged as
> +# @deprecated-props: an optional list of properties that are flagged as
> # deprecated by the CPU vendor. The list depends on the
> # CpuModelExpansionType: "static" properties are a subset of the
> # enabled-properties for the expanded model; "full" properties are
> # a set of properties that are deprecated across all models for
> -# the architecture. (since: 9.1).
> +# the architecture. (since: 10.1 -- since 9.1 on s390x --).
> #
> # Since: 2.8
> ##
> { 'struct': 'CpuModelExpansionInfo',
> 'data': { 'model': 'CpuModelInfo',
> - 'deprecated-props' : { 'type': ['str'],
> - 'if': 'TARGET_S390X' } },
> + '*deprecated-props' : { 'type': ['str'] } },
> 'if': { 'any': [ 'TARGET_S390X',
> 'TARGET_I386',
> 'TARGET_ARM',
This changes CpuModelExpansionInfo from:
#if defined(TARGET_S390X) || defined(TARGET_I386) || defined(TARGET_ARM) || defined(TARGET_LOONGARCH64) || defined(TARGET_RISCV)
struct CpuModelExpansionInfo {
CpuModelInfo *model;
#if defined(TARGET_S390X)
strList *deprecated_props;
#endif /* defined(TARGET_S390X) */
};
#endif
to:
#if defined(TARGET_S390X) || defined(TARGET_I386) || defined(TARGET_ARM) || defined(TARGET_LOONGARCH64) || defined(TARGET_RISCV)
struct CpuModelExpansionInfo {
CpuModelInfo *model;
bool has_deprecated_props;
strList *deprecated_props;
};
#endif
Do we need to set has_deprecated_props as true?
diff --git a/target/s390x/cpu_models_system.c b/target/s390x/cpu_models_system.c
index 4351182f7209..ab05cf99a214 100644
--- a/target/s390x/cpu_models_system.c
+++ b/target/s390x/cpu_models_system.c
@@ -252,6 +252,7 @@ CpuModelExpansionInfo *qmp_query_cpu_model_expansion(CpuModelExpansionType type,
s390_feat_bitmap_to_ascii(deprecated_feats,
&expansion_info->deprecated_props, list_add_feat);
+ expansion_info->has_deprecated_props = true;
return expansion_info;
}
---
Regards,
Zhao
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [RFC PATCH] qapi: Make CpuModelExpansionInfo::deprecated-props optional and generic
2025-04-29 10:04 [RFC PATCH] qapi: Make CpuModelExpansionInfo::deprecated-props optional and generic Philippe Mathieu-Daudé
2025-05-06 13:51 ` Philippe Mathieu-Daudé
2025-05-06 16:15 ` Zhao Liu
@ 2025-05-07 14:41 ` Markus Armbruster
2025-05-07 15:12 ` Philippe Mathieu-Daudé
2025-05-08 12:18 ` Markus Armbruster
3 siblings, 1 reply; 6+ messages in thread
From: Markus Armbruster @ 2025-05-07 14:41 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: qemu-devel, Eduardo Habkost, Marcel Apfelbaum,
Daniel P . Berrangé, qemu-s390x, Eric Blake, Zhao Liu,
Yanan Wang, Collin L. Walling, David Hildenbrand
Cc: author and reviewer of the @deprecated-props feature
Philippe Mathieu-Daudé <philmd@linaro.org> writes:
> We'd like to have some unified QAPI schema. Having a structure field
> conditional to a target being built in is not very practical.
>
> While @deprecated-props is only used by s390x target, it is generic
> enough and could be used by other targets (assuming we expand
> CpuModelExpansionType enum values).
>
> Let's always include this field, regardless of the target, but
> make it optional.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> qapi/machine-target.json | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/qapi/machine-target.json b/qapi/machine-target.json
> index 541f93eeb78..3b109b4af87 100644
> --- a/qapi/machine-target.json
> +++ b/qapi/machine-target.json
> @@ -244,19 +244,18 @@
> #
> # @model: the expanded CpuModelInfo.
> #
> -# @deprecated-props: a list of properties that are flagged as
> +# @deprecated-props: an optional list of properties that are flagged as
> # deprecated by the CPU vendor. The list depends on the
> # CpuModelExpansionType: "static" properties are a subset of the
> # enabled-properties for the expanded model; "full" properties are
> # a set of properties that are deprecated across all models for
> -# the architecture. (since: 9.1).
> +# the architecture. (since: 10.1 -- since 9.1 on s390x --).
> #
> # Since: 2.8
> ##
> { 'struct': 'CpuModelExpansionInfo',
> 'data': { 'model': 'CpuModelInfo',
> - 'deprecated-props' : { 'type': ['str'],
> - 'if': 'TARGET_S390X' } },
> + '*deprecated-props' : { 'type': ['str'] } },
> 'if': { 'any': [ 'TARGET_S390X',
> 'TARGET_I386',
> 'TARGET_ARM',
When I see "optional array", I wonder about the difference between
"absent" and "present and empty". The doc comment doesn't quite explain
it. I figure "present and empty" means empty, while "absent" means we
don't know / not implemented.
Is the difference useful?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RFC PATCH] qapi: Make CpuModelExpansionInfo::deprecated-props optional and generic
2025-05-07 14:41 ` Markus Armbruster
@ 2025-05-07 15:12 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 6+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-05-07 15:12 UTC (permalink / raw)
To: Markus Armbruster
Cc: qemu-devel, Eduardo Habkost, Marcel Apfelbaum,
Daniel P.Berrangé, qemu-s390x, Eric Blake, Zhao Liu,
Yanan Wang, Collin L. Walling, David Hildenbrand
On 7/5/25 16:41, Markus Armbruster wrote:
> Cc: author and reviewer of the @deprecated-props feature
>
> Philippe Mathieu-Daudé <philmd@linaro.org> writes:
>
>> We'd like to have some unified QAPI schema. Having a structure field
>> conditional to a target being built in is not very practical.
>>
>> While @deprecated-props is only used by s390x target, it is generic
>> enough and could be used by other targets (assuming we expand
>> CpuModelExpansionType enum values).
>>
>> Let's always include this field, regardless of the target, but
>> make it optional.
>>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> ---
>> qapi/machine-target.json | 7 +++----
>> 1 file changed, 3 insertions(+), 4 deletions(-)
>>
>> diff --git a/qapi/machine-target.json b/qapi/machine-target.json
>> index 541f93eeb78..3b109b4af87 100644
>> --- a/qapi/machine-target.json
>> +++ b/qapi/machine-target.json
>> @@ -244,19 +244,18 @@
>> #
>> # @model: the expanded CpuModelInfo.
>> #
>> -# @deprecated-props: a list of properties that are flagged as
>> +# @deprecated-props: an optional list of properties that are flagged as
>> # deprecated by the CPU vendor. The list depends on the
>> # CpuModelExpansionType: "static" properties are a subset of the
>> # enabled-properties for the expanded model; "full" properties are
>> # a set of properties that are deprecated across all models for
>> -# the architecture. (since: 9.1).
>> +# the architecture. (since: 10.1 -- since 9.1 on s390x --).
>> #
>> # Since: 2.8
>> ##
>> { 'struct': 'CpuModelExpansionInfo',
>> 'data': { 'model': 'CpuModelInfo',
>> - 'deprecated-props' : { 'type': ['str'],
>> - 'if': 'TARGET_S390X' } },
>> + '*deprecated-props' : { 'type': ['str'] } },
>> 'if': { 'any': [ 'TARGET_S390X',
>> 'TARGET_I386',
>> 'TARGET_ARM',
>
> When I see "optional array", I wonder about the difference between
> "absent" and "present and empty". The doc comment doesn't quite explain
> it. I figure "present and empty" means empty, while "absent" means we
> don't know / not implemented.
>
> Is the difference useful?
>
I'm also happy to implement as "present but empty".
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RFC PATCH] qapi: Make CpuModelExpansionInfo::deprecated-props optional and generic
2025-04-29 10:04 [RFC PATCH] qapi: Make CpuModelExpansionInfo::deprecated-props optional and generic Philippe Mathieu-Daudé
` (2 preceding siblings ...)
2025-05-07 14:41 ` Markus Armbruster
@ 2025-05-08 12:18 ` Markus Armbruster
3 siblings, 0 replies; 6+ messages in thread
From: Markus Armbruster @ 2025-05-08 12:18 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: qemu-devel, Eduardo Habkost, Marcel Apfelbaum,
Daniel P . Berrangé, qemu-s390x, Eric Blake, Zhao Liu,
Yanan Wang
Philippe Mathieu-Daudé <philmd@linaro.org> writes:
> We'd like to have some unified QAPI schema. Having a structure field
> conditional to a target being built in is not very practical.
>
> While @deprecated-props is only used by s390x target, it is generic
> enough and could be used by other targets (assuming we expand
> CpuModelExpansionType enum values).
>
> Let's always include this field, regardless of the target, but
> make it optional.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> qapi/machine-target.json | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/qapi/machine-target.json b/qapi/machine-target.json
> index 541f93eeb78..3b109b4af87 100644
> --- a/qapi/machine-target.json
> +++ b/qapi/machine-target.json
> @@ -244,19 +244,18 @@
> #
> # @model: the expanded CpuModelInfo.
> #
> -# @deprecated-props: a list of properties that are flagged as
> +# @deprecated-props: an optional list of properties that are flagged as
> # deprecated by the CPU vendor. The list depends on the
> # CpuModelExpansionType: "static" properties are a subset of the
> # enabled-properties for the expanded model; "full" properties are
> # a set of properties that are deprecated across all models for
> -# the architecture. (since: 9.1).
> +# the architecture. (since: 10.1 -- since 9.1 on s390x --).
> #
> # Since: 2.8
> ##
> { 'struct': 'CpuModelExpansionInfo',
> 'data': { 'model': 'CpuModelInfo',
> - 'deprecated-props' : { 'type': ['str'],
> - 'if': 'TARGET_S390X' } },
> + '*deprecated-props' : { 'type': ['str'] } },
Make this
'*deprecated-props' : ['str'] },
please.
> 'if': { 'any': [ 'TARGET_S390X',
> 'TARGET_I386',
> 'TARGET_ARM',
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-05-08 12:19 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-29 10:04 [RFC PATCH] qapi: Make CpuModelExpansionInfo::deprecated-props optional and generic Philippe Mathieu-Daudé
2025-05-06 13:51 ` Philippe Mathieu-Daudé
2025-05-06 16:15 ` Zhao Liu
2025-05-07 14:41 ` Markus Armbruster
2025-05-07 15:12 ` Philippe Mathieu-Daudé
2025-05-08 12:18 ` Markus Armbruster
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).