target/s390x: filter deprecated features based on model expansion type
PATCH 1/1 target/s390x: filter deprecated features based on model expansion type
It is beneficial to provide an interface to retrieve *all* deprecated features in one go. Management applications will need this information to determine which features need to be disabled regardless of the host-model's capabilities.
To remedy this, deprecated features are only filtered during a static expansion. All deperecated features are reported on a full expansion.
--- target/s390x/cpu_models_sysemu.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
target/s390x/cpu_models_sysemu.c +9 -1
@@ -211,7 +211,15 @@ static void cpu_info_from_model(CpuModelInfo *info, const S390CPUModel *model,bitmap_zero (bitmap,S390_FEAT_MAX );s390_get_deprecated_features (bitmap); -bitmap_and (bitmap, bitmap, model->def->full_feat,S390_FEAT_MAX ); +/* +* For static model expansion, filter out deprecated features that are +* not a subset of the model's feature set. Otherwise, report the entire +* deprecated features list. +*/ +if (delta_changes) { +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; }
Signature · 1 line
2.45.1
Quoted 22 lines · Collin Walling
It is beneficial to provide an interface to retrieve *all* deprecated features in one go. Management applications will need this information to determine which features need to be disabled regardless of the host-model's capabilities.
To remedy this, deprecated features are only filtered during a static expansion. All deperecated features are reported on a full expansion.
Suggested-by Jiri Denemark <[email protected]>Signed-off-by Collin Walling <[email protected]>--- target/s390x/cpu_models_sysemu.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)target/s390x/cpu_models_sysemu.c +0
-0@@ -211,7 +211,15 @@ static void cpu_info_from_model(CpuModelInfo *info, const S390CPUModel *model,bitmap_zero (bitmap,S390_FEAT_MAX );s390_get_deprecated_features (bitmap);
target/s390x/cpu_models_sysemu.c static void cpu_info_from_model(CpuModelInfo *info, const S390CPUModel *model, · line 222
Quoted 10 lines
target/s390x/cpu_models_sysemu.c +9
-1-bitmap_and (bitmap, bitmap, model->def->full_feat,S390_FEAT_MAX ); +/* +* For static model expansion, filter out deprecated features that are +* not a subset of the model's feature set. Otherwise, report the entire +* deprecated features list. +*/ +if (delta_changes) { +bitmap_and (bitmap, bitmap, model->def->full_feat,S390_FEAT_MAX ); + } +
This would likely be the only interface where we expose "more" features than a CPU model actually understands? I guess it wouldn't be that bad because disabling unsupported features will just work, even if the CPU model is not aware of them.
So no strong opinion.
Just noting that libvirt cannot really rely on that information because the behavior would change between QEMU versions? Maybe not an issue.
Signature · 3 lines
Cheers, David / dhildenb
Quoted 23 lines · David Hildenbrand
Quoted 22 lines · Collin Walling
It is beneficial to provide an interface to retrieve *all* deprecated features in one go. Management applications will need this information to determine which features need to be disabled regardless of the host-model's capabilities.
To remedy this, deprecated features are only filtered during a static expansion. All deperecated features are reported on a full expansion.
Suggested-by Jiri Denemark <[email protected]>Signed-off-by Collin Walling <[email protected]>--- target/s390x/cpu_models_sysemu.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)target/s390x/cpu_models_sysemu.c +0
-0@@ -211,7 +211,15 @@ static void cpu_info_from_model(CpuModelInfo *info, const S390CPUModel *model,bitmap_zero (bitmap,S390_FEAT_MAX );s390_get_deprecated_features (bitmap);
Quoted 16 lines
target/s390x/cpu_models_sysemu.c static void cpu_info_from_model(CpuModelInfo *info, const S390CPUModel *model, · line 222
Quoted 10 lines
target/s390x/cpu_models_sysemu.c +9
-1-bitmap_and (bitmap, bitmap, model->def->full_feat,S390_FEAT_MAX ); +/* +* For static model expansion, filter out deprecated features that are +* not a subset of the model's feature set. Otherwise, report the entire +* deprecated features list. +*/ +if (delta_changes) { +bitmap_and (bitmap, bitmap, model->def->full_feat,S390_FEAT_MAX ); + } +This would likely be the only interface where we expose "more" features than a CPU model actually understands? I guess it wouldn't be that bad because disabling unsupported features will just work, even if the CPU model is not aware of them.
Yes, and for a full expansion an exhaustive list of features are reported, even the ones that the model does not support (they're paired with "false"). So I think it makes sense to report *all* features that are deprecated as well.
Quoted 5 lines
So no strong opinion.
Just noting that libvirt cannot really rely on that information because the behavior would change between QEMU versions? Maybe not an issue.
Right. If it's appropriate, I could handle back porting of this patch if requested. But that's not for me to decide :)
Quoted 2 lines
Thanks!
Signature · 2 lines
Regards, Collin
Quoted 10 lines · Collin Walling
It is beneficial to provide an interface to retrieve *all* deprecated features in one go. Management applications will need this information to determine which features need to be disabled regardless of the host-model's capabilities.
To remedy this, deprecated features are only filtered during a static expansion. All deperecated features are reported on a full expansion.
Suggested-by Jiri Denemark <[email protected]>Signed-off-by Collin Walling <[email protected]>
Which command(s) exactly are affected?
Do they need a doc update?
Quoted 25 lines
--- target/s390x/cpu_models_sysemu.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)target/s390x/cpu_models_sysemu.c +9
-1@@ -211,7 +211,15 @@ static void cpu_info_from_model(CpuModelInfo *info, const S390CPUModel *model,bitmap_zero (bitmap,S390_FEAT_MAX );s390_get_deprecated_features (bitmap); -bitmap_and (bitmap, bitmap, model->def->full_feat,S390_FEAT_MAX ); +/* +* For static model expansion, filter out deprecated features that are +* not a subset of the model's feature set. Otherwise, report the entire +* deprecated features list. +*/ +if (delta_changes) { +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; }
Quoted 7 lines · Markus Armbruster
Quoted 5 lines · Collin Walling
It is beneficial to provide an interface to retrieve *all* deprecated features in one go. Management applications will need this information to determine which features need to be disabled regardless of the host-model's capabilities.
Quoted 8 lines
Quoted 5 lines
To remedy this, deprecated features are only filtered during a static expansion. All deperecated features are reported on a full expansion.
Suggested-by Jiri Denemark <[email protected]>Signed-off-by Collin Walling <[email protected]>Which command(s) exactly are affected?
The query-cpu-model-expansion result will now report all deprecated features when a user requests a full expansion. The inputs are not affects, but the output is modified. I will make this more concise on the v2 commit message.
Quoted 2 lines
Do they need a doc update?
Yes, I forgot to add this. This is what is currently documented:
##
# @CpuModelInfo:
#
...
#
# @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)
#
I will change to:
#
# @deprecated-props: a list of properties that are flagged as deprecated
# by the CPU vendor. These are a subset of the reported @props.
# (since 9.1)
#
(I will also the correct typo in my commit message).
[...]
Thanks!
Signature · 2 lines
Regards, Collin
Quoted 14 lines · Collin Walling
Quoted 13 lines · Markus Armbruster
Quoted 10 lines · Collin Walling
It is beneficial to provide an interface to retrieve *all* deprecated features in one go. Management applications will need this information to determine which features need to be disabled regardless of the host-model's capabilities.
To remedy this, deprecated features are only filtered during a static expansion. All deperecated features are reported on a full expansion.
Suggested-by Jiri Denemark <[email protected]>Signed-off-by Collin Walling <[email protected]>
Quoted 7 lines
Quoted 2 lines
Which command(s) exactly are affected?
The query-cpu-model-expansion result will now report all deprecated features when a user requests a full expansion. The inputs are not affects, but the output is modified. I will make this more concise on the v2 commit message.
Yes, please. Consider including an example.
Quoted 15 lines
Quoted 2 lines
Do they need a doc update?
Yes, I forgot to add this. This is what is currently documented:
##
# @CpuModelInfo:
#
...
#
# @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)
#
Quoted 7 lines
I will change to:
#
# @deprecated-props: a list of properties that are flagged as deprecated
# by the CPU vendor. These are a subset of the reported @props.
# (since 9.1)
#
Hasn't made it into a release, so we don't have to document the old behavior. Fortunate!
Separate sentences with two spaces for consistency, please.
Quoted 5 lines
(I will also the correct typo in my commit message).
[...]
Thanks!