From: Claudio Fontana <cfontana@suse.de>
To: Eduardo Habkost <ehabkost@redhat.com>, Andrew Jones <drjones@redhat.com>
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
"Richard Henderson" <richard.henderson@linaro.org>,
qemu-devel <qemu-devel@nongnu.org>,
"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
qemu-arm <qemu-arm@nongnu.org>,
"Paolo Bonzini" <pbonzini@redhat.com>
Subject: Re: arm_cpu_post_init (Was: Re: arm: "max" CPU class hierarchy changes possible?)
Date: Fri, 19 Mar 2021 09:19:02 +0100 [thread overview]
Message-ID: <ce57f177-9215-fcb7-1b93-5cc738e50f4e@suse.de> (raw)
In-Reply-To: <20210318131010.GT3139005@habkost.net>
On 3/18/21 2:10 PM, Eduardo Habkost wrote:
> On Thu, Mar 18, 2021 at 01:59:08PM +0100, Andrew Jones wrote:
>> On Thu, Mar 18, 2021 at 01:42:36PM +0100, Claudio Fontana wrote:
>>> On 3/18/21 1:08 PM, Andrew Jones wrote:
>>>> On Thu, Mar 18, 2021 at 12:32:30PM +0100, Claudio Fontana wrote:
>>>>> And why do we have a separate arm_cpu_finalize_features()?
>>>>
>>>> Separate, because it's not just called from arm_cpu_realizefn().
>>>
>>> In particular it is also called by the monitor.c in qmp_query_cpu_model_expansion(),
>>>
>>> which basically creates an object of the cpu subclass,
>>> and then calls arm_cpu_finalize_[features]() explicitly on the object.
>>>
>>> Is the qdev realize() method not called in this case? Should instead it be triggered, rather than initializing/realizing an incomplete object?
>>
>> Can you elaborate on what you mean by "triggered"? The QMP query does the
>> least that it can get away with while still reusing the CPU model's
>> feature initialization code. Any suggestions for improving that,
>> preferably in the form of a patch, would be welcome. If it works well for
>> Arm, then it could probably be applied to other architectures. The Arm QMP
>> query is modeled off the others.
>
> This sound very similar to x86_cpu_expand_features(), so the
> approach makes sense to me.
Interesting, to me it sounds like a CPUClass method is hiding here, cc->cpu_expand_features(),
I could help kickstart the implementation but would need a good description / comment of exactly which features are supposed to be expanded there.
>
> It wouldn't make sense to call realize() inside
> qmp_query_cpu_model_expansion(). Realizing the CPU means
> plugging it into the guest, and we would never want to do that
> when executing a query command.
>
Makes sense, thanks for the explanation.
Ciao,
Claudio
next prev parent reply other threads:[~2021-03-19 8:20 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-11 14:27 arm: "max" CPU class hierarchy changes possible? Claudio Fontana
2021-03-11 15:02 ` Peter Maydell
2021-03-11 15:21 ` Claudio Fontana
2021-03-11 16:02 ` Peter Maydell
2021-03-11 16:18 ` Paolo Bonzini
2021-03-11 17:16 ` Claudio Fontana
2021-03-11 17:35 ` Eduardo Habkost
2021-03-11 18:33 ` Peter Maydell
2021-03-11 19:10 ` Andrew Jones
2021-03-18 11:06 ` arm_cpu_post_init (Was: Re: arm: "max" CPU class hierarchy changes possible?) Claudio Fontana
2021-03-18 11:32 ` Claudio Fontana
2021-03-18 12:08 ` Andrew Jones
2021-03-18 12:42 ` Claudio Fontana
2021-03-18 12:59 ` Andrew Jones
2021-03-18 13:10 ` Eduardo Habkost
2021-03-19 8:19 ` Claudio Fontana [this message]
2021-03-19 8:23 ` Claudio Fontana
2021-03-19 8:33 ` Claudio Fontana
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=ce57f177-9215-fcb7-1b93-5cc738e50f4e@suse.de \
--to=cfontana@suse.de \
--cc=drjones@redhat.com \
--cc=ehabkost@redhat.com \
--cc=f4bug@amsat.org \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.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 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).