From: Igor Mammedov <imammedo@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: gaosong <gaosong@loongson.cn>, Bibo Mao <maobibo@loongson.cn>,
QEMU devel <qemu-devel@nongnu.org>,
David Hildenbrand <david@redhat.com>,
Eduardo Habkost <eduardo@habkost.net>
Subject: Re: [PATCH] target/loongarch: Add full type support for query-cpu-model-expansion
Date: Thu, 13 Feb 2025 17:17:05 +0100 [thread overview]
Message-ID: <20250213171705.6dde38cf@imammedo.users.ipa.redhat.com> (raw)
In-Reply-To: <87a5aqhxpt.fsf@pond.sub.org>
On Thu, 13 Feb 2025 12:48:30 +0100
Markus Armbruster <armbru@redhat.com> wrote:
> gaosong <gaosong@loongson.cn> writes:
>
> > Cc: Markus
> >
> > hi, Markus
> >
> > What is the difference between CPU_MODEL_EXPANSION_TYPE_STATIC and
> > CPU_MODEL_EXPANSION_TYPE_FULL?
the only difference is that 'static' expansion will not report properties
not mentioned in hard-codded CPU model definition see: builtin_x86_defs
while 'full' will iterate over/report all rw properties of CPU object
created from provided model name.
> I don't know :)
>
> Here's the documentation:
>
> ##
> # @CpuModelExpansionType:
> #
> # An enumeration of CPU model expansion types.
> #
> # @static: Expand to a static CPU model, a combination of a static
> # base model name and property delta changes. As the static base
> # model will never change, the expanded CPU model will be the
> # same, independent of QEMU version, machine type, machine
> # options, and accelerator options. Therefore, the resulting
> # model can be used by tooling without having to specify a
> # compatibility machine - e.g. when displaying the "host" model.
> # The @static CPU models are migration-safe.
Looking at related x86 code above description sounds like a fiction.
Both 'static' and 'full' do use
qmp_query_cpu_model_expansion()
x86_cpu_from_model()
cpu = object_new(foo_cpu_class)
x86_cpu_expand_features(cpu)
and the later 2 calls are subjects to being influenced by:
"QEMU version, machine type (compat machinery), machine options, and accelerator options"
and -cpu option
> #
> # @full: Expand all properties. The produced model is not guaranteed
> # to be migration-safe, but allows tooling to get an insight and
> # work with model details.
> #
> # .. note:: When a non-migration-safe CPU model is expanded in static
> # mode, some features enabled by the CPU model may be omitted,
> # because they can't be implemented by a static CPU model
> # definition (e.g. cache info passthrough and PMU passthrough in
> # x86). If you need an accurate representation of the features
> # enabled by a non-migration-safe CPU model, use @full. If you
> # need a static representation that will keep ABI compatibility
> # even when changing QEMU version or machine-type, use @static (but
> # keep in mind that some features may be omitted).
> #
> # Since: 2.8
> ##
>
> If you have further questions, David Hildenbrand or Eduardo Habkost
> (cc'ed) might be able to help.
>
>
next prev parent reply other threads:[~2025-02-13 16:18 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
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 [this message]
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=20250213171705.6dde38cf@imammedo.users.ipa.redhat.com \
--to=imammedo@redhat.com \
--cc=armbru@redhat.com \
--cc=david@redhat.com \
--cc=eduardo@habkost.net \
--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.