From: Paolo Bonzini <pbonzini@redhat.com>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>,
qemu-devel@nongnu.org, "Eduardo Habkost" <eduardo@habkost.net>
Cc: peter.maydell@linaro.org, mst@redhat.com,
alistair.francis@wdc.com, xiaoyao.li@intel.com,
Markus Armbruster <armbru@redhat.com>,
Bernhard Beschow <shentey@gmail.com>
Subject: Re: [PATCH] qom: reverse order of instance_post_init calls
Date: Tue, 4 Feb 2025 16:26:47 +0100 [thread overview]
Message-ID: <43d702c3-ac6c-4acf-9904-5c087549c682@redhat.com> (raw)
In-Reply-To: <bd5ccffc-5e8c-4b87-9168-01a964dd6f0a@linaro.org>
On 2/4/25 16:08, Philippe Mathieu-Daudé wrote:
> Hi Paolo,
>
> On 3/2/25 12:41, Paolo Bonzini wrote:
>> Currently, the instance_post_init calls are performed from the leaf
>> class and all the way up to Object. This is incorrect because the
>> leaf class cannot observe property values applied by the superclasses;
>> for example, a compat property will be set on a device *after*
>> the class's post_init callback has run.
>>
>> In particular this makes it impossible for implementations of
>> accel_cpu_instance_init() to operate based on the actual values of
>> the properties, though it seems that cxl_dsp_instance_post_init and
>> rp_instance_post_init might have similar issues.
>
> I'm not opposed to this change as I had a similar issue there few weeks
> ago, but I feel we are changing one problem by another. IIRC some class
> post_init() handlers check the instance correctly did something.
There are five - one does not have any subclass and the other four are
all mentioned in the commit message:
- x86 and risc-v use accel_cpu_instance_init(), which is where I found
the bug
- the other two seem broken too
> * @instance_post_init: This function is called to finish
> * initialization of an object, after
> * all @instance_init functions were
> * called.
Yeah I didn't adjust it because it now is simply the same order as
instance_init (and the opposite as instance_finalize). I can change it
to "after all @instance_init functions were called, as well as the
@instance_post_init functions for the parent classes".
Paolo
prev parent reply other threads:[~2025-02-04 15:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-03 11:41 [PATCH] qom: reverse order of instance_post_init calls Paolo Bonzini
2025-02-04 15:08 ` Philippe Mathieu-Daudé
2025-02-04 15:18 ` Peter Maydell
2025-02-04 15:26 ` Paolo Bonzini [this message]
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=43d702c3-ac6c-4acf-9904-5c087549c682@redhat.com \
--to=pbonzini@redhat.com \
--cc=alistair.francis@wdc.com \
--cc=armbru@redhat.com \
--cc=eduardo@habkost.net \
--cc=mst@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=shentey@gmail.com \
--cc=xiaoyao.li@intel.com \
/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).