From: Igor Mammedov <imammedo@redhat.com>
To: bibo mao <maobibo@loongson.cn>
Cc: Song Gao <gaosong@loongson.cn>, qemu-devel@nongnu.org
Subject: Re: [PATCH] target/loongarch: Add full type support for query-cpu-model-expansion
Date: Thu, 13 Feb 2025 17:52:41 +0100 [thread overview]
Message-ID: <20250213175241.03bde8c1@imammedo.users.ipa.redhat.com> (raw)
In-Reply-To: <3a1f0744-4795-8f07-7258-0922745906ac@loongson.cn>
On Thu, 13 Feb 2025 17:40:56 +0800
bibo mao <maobibo@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'
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 <maobibo@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
> >
>
>
next prev parent reply other threads:[~2025-02-13 16:54 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-13 9:16 [PATCH] target/loongarch: Add full type support for query-cpu-model-expansion Bibo Mao
2025-02-13 9:40 ` bibo mao
2025-02-13 16:52 ` Igor Mammedov [this message]
2025-02-14 1:57 ` bibo mao
2025-02-13 10:07 ` gaosong
2025-02-13 11:48 ` Markus Armbruster
2025-02-13 16:17 ` Igor Mammedov
2025-02-13 16:25 ` David Hildenbrand
2025-02-14 12:29 ` Markus Armbruster
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250213175241.03bde8c1@imammedo.users.ipa.redhat.com \
--to=imammedo@redhat.com \
--cc=gaosong@loongson.cn \
--cc=maobibo@loongson.cn \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.