On 2025/2/14 上午12:52, Igor Mammedov wrote:
On Thu, 13 Feb 2025 17:40:56 +0800
bibo mao <maob...@loongson.cn> wrote:
please discard this patch :(
libvirt uses static type already on LoongArch platform, there is
compatibility issue. Static type cannot be removed, although I do
not know the difference between static type and full type.
looking at loongarch-qmp-cmds.c:qmp_query_cpu_model_expansion(),
you do filter reported features by global cpu_model_advertised_features[] list.
Also cpu 'definition' is mainly governed by its initfn() and
properties mentioned in cpu_model_advertised_features[] are created
only by loongarch_cpu_post_init() , which is part of la464 and max models.
The later call however mutates depending on accelerator, which
sort of contradicts 'static' description and feets more to 'full' category.
What I'd suggest doing is to support both
i.e. do keep 'static' for compat reasons and run the same code for 'full'
That is a good idea. will keep static type the same with full type for
the present, and implement real static type iff all basic features are
implemented and compatible machine requirement is added in future.
Regards
Bibo Mao
In nutshell drop if(type) check or explicitly allow both types.
Regards
Bibo Mao
On 2025/2/13 下午5:16, Bibo Mao wrote:
With full type for query-cpu-model-expansion qmp command, it shows that
it is not supported. For instance,
query-cpu-model-expansion type=full model={"name":"max"}
Here is is output,
{"error": {"class": "GenericError", "desc": "The requested expansion type is not
supported"}}
Since full type is not supported and only static type is supported, Here
replace static type with full type for command query-cpu-model-expansion.
And there is result with this patch,
{"return": {"model": {"name": "max", "props": {"lbt": true, "lasx": true, "pmu":
true, "lsx": true}}}}
Signed-off-by: Bibo Mao <maob...@loongson.cn>
---
target/loongarch/loongarch-qmp-cmds.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/target/loongarch/loongarch-qmp-cmds.c
b/target/loongarch/loongarch-qmp-cmds.c
index 3fde5a5a20..429c6d35fd 100644
--- a/target/loongarch/loongarch-qmp-cmds.c
+++ b/target/loongarch/loongarch-qmp-cmds.c
@@ -56,7 +56,7 @@ CpuModelExpansionInfo
*qmp_query_cpu_model_expansion(CpuModelExpansionType type,
const char *name;
int i;
- if (type != CPU_MODEL_EXPANSION_TYPE_STATIC) {
+ if (type != CPU_MODEL_EXPANSION_TYPE_FULL) {
error_setg(errp, "The requested expansion type is not supported");
return NULL;
}
base-commit: de278e54aefed143526174335f8286f7437d20be