qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Jones <drjones@redhat.com>
To: Claudio Fontana <cfontana@suse.de>
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	"Eduardo Habkost" <ehabkost@redhat.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	qemu-devel <qemu-devel@nongnu.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: Thu, 18 Mar 2021 13:59:08 +0100	[thread overview]
Message-ID: <20210318125908.zwpm47ftlsuen3zo@kamzik.brq.redhat.com> (raw)
In-Reply-To: <fc769a96-a304-7429-5dee-a65b52179b1c@suse.de>

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.

> 
> > 
> >>
> >> Nothing in the ARM cpu classes initializations ever seems to be "final" to me.
> > 
> > Some CPU features cannot be simply switched on/off at the property
> > parse time. For example, there could be dependencies on multiple
> > properties, the mutual exclusion of properties, or other aspects
> > that can only be known later than property parse time. That stuff
> > goes in arm_cpu_finalize_features().
> 
> Seems like _part_ of that is in arm_cpu_finalize_[features]() (in practice, this ends up being AARCH64-only stuff,
> ie SVE, PAUTH and KVM).
> 
> After calling that, the arm realizefn() also does further setting and unsetting of features, checking previous feature states.
> 
> There is a whole lot following the arm_cpu_finalize_[features]() call,
> there are ~300 lines of features initializations happening _after_ the call to arm_cpu_finalize_[features]().
>

Any feature that needs a finalizer (i.e. it can't be managed at property
parsing time) and wants to be probable by the QMP query will need to have
its finalizing moved to arm_cpu_finalize_features(). Some of those ~300
lines might be better pushed into property set/get handlers, others will
never want to be advertised in the QMP query, but the rest will get moved
when the need is great enough.

Thanks,
drew



  reply	other threads:[~2021-03-18 13:00 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 [this message]
2021-03-18 13:10                     ` Eduardo Habkost
2021-03-19  8:19                       ` Claudio Fontana
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=20210318125908.zwpm47ftlsuen3zo@kamzik.brq.redhat.com \
    --to=drjones@redhat.com \
    --cc=cfontana@suse.de \
    --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).