From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Richard Henderson <richard.henderson@linaro.org>, qemu-devel@nongnu.org
Subject: Re: [PATCH v3 24/24] cpus: Remove CPUClass::has_work() handler
Date: Mon, 10 Feb 2025 22:36:16 +0100 [thread overview]
Message-ID: <256e36c4-d0d7-4d2b-96a1-888e516f917a@linaro.org> (raw)
In-Reply-To: <8da57d8a-a42a-446e-ad5b-a6ab07c65647@linaro.org>
On 27/1/25 08:50, Philippe Mathieu-Daudé wrote:
> On 26/1/25 13:31, Richard Henderson wrote:
>> On 1/25/25 09:01, Philippe Mathieu-Daudé wrote:
>>> diff --git a/cpu-target.c b/cpu-target.c
>>> index 98e9e7cc4a1..778f622b07a 100644
>>> --- a/cpu-target.c
>>> +++ b/cpu-target.c
>>> @@ -230,6 +230,14 @@ void cpu_class_init_props(DeviceClass *dc)
>>> device_class_set_props(dc, cpu_common_props);
>>> }
>>> +void cpu_exec_class_post_init(CPUClass *cc, void *data)
>>> +{
>>> +#ifndef CONFIG_USER_ONLY
>>> + /* Check mandatory SysemuCPUOps handlers */
>>> + g_assert(cc->sysemu_ops->has_work);
>>> +#endif
>>> +}
>>> +
>>
>> Does this really need to be split from...
>>
>
> > diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c
> >
>>> @@ -319,6 +313,11 @@ static void cpu_common_class_init(ObjectClass
>>> *klass, void *data)
>>> dc->user_creatable = false;
>>> }
>>> +static void cpu_common_post_class_init(ObjectClass *klass, void *data)
>>> +{
>>> + cpu_exec_class_post_init(CPU_CLASS(klass), data);
>>> +}
>>
>> ... here?
>
> cpu-target.c is in specific_ss[], cpu-common.c in common_ss[]
> where CONFIG_USER_ONLY is not available thus defined.
>
> We could define cpu_common_post_class_init() in cpu-target.c,
> which is odd because not common; or name it differently
> (cpu_exec_post_class_init?) and have it registered as common
> post_init handler but again it seems a dirty API mismatch, so
> I went this way, hoping that eventually cpu-common.c ends
> better abstracted and cpu-target.c disappearing...
I'll amend to the description:
---
Note, since cpu-common.c is in meson's common_ss[] source set, we
must define cpu_exec_class_post_init() in cpu-target.c (which is
in the specific_ss[] source set) to have CONFIG_USER_ONLY defined.
---
next prev parent reply other threads:[~2025-02-10 21:36 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-25 17:01 [PATCH v3 00/24] cpus: Restrict CPU has_work() handlers to system emulation Philippe Mathieu-Daudé
2025-01-25 17:01 ` [PATCH v3 01/24] cpus: Restrict cpu_has_work() " Philippe Mathieu-Daudé
2025-01-25 17:01 ` [PATCH v3 02/24] cpus: Un-inline cpu_has_work() Philippe Mathieu-Daudé
2025-01-25 17:01 ` [PATCH v3 03/24] cpus: Introduce SysemuCPUOps::has_work() handler Philippe Mathieu-Daudé
2025-01-25 17:01 ` [PATCH v3 04/24] target/alpha: Move has_work() from CPUClass to SysemuCPUOps Philippe Mathieu-Daudé
2025-01-25 17:01 ` [PATCH v3 05/24] target/arm: " Philippe Mathieu-Daudé
2025-01-25 17:01 ` [PATCH v3 06/24] target/avr: " Philippe Mathieu-Daudé
2025-01-25 17:01 ` [PATCH v3 07/24] target/hexagon: Remove CPUClass:has_work() handler Philippe Mathieu-Daudé
2025-01-25 17:01 ` [PATCH v3 08/24] target/hppa: Move has_work() from CPUClass to SysemuCPUOps Philippe Mathieu-Daudé
2025-01-25 17:01 ` [PATCH v3 09/24] target/i386: " Philippe Mathieu-Daudé
2025-01-25 17:01 ` [PATCH v3 10/24] target/loongarch: " Philippe Mathieu-Daudé
2025-01-25 17:01 ` [PATCH v3 11/24] target/m68k: " Philippe Mathieu-Daudé
2025-01-25 17:01 ` [PATCH v3 12/24] target/microblaze: " Philippe Mathieu-Daudé
2025-01-25 17:01 ` [PATCH v3 13/24] target/mips: " Philippe Mathieu-Daudé
2025-01-25 17:01 ` [PATCH v3 14/24] target/openrisc: " Philippe Mathieu-Daudé
2025-01-25 17:01 ` [PATCH v3 15/24] target/ppc: " Philippe Mathieu-Daudé
2025-01-25 17:01 ` [PATCH v3 16/24] target/riscv: " Philippe Mathieu-Daudé
2025-01-26 12:29 ` Richard Henderson
2025-01-25 17:01 ` [PATCH v3 17/24] target/rx: " Philippe Mathieu-Daudé
2025-01-25 17:01 ` [PATCH v3 18/24] target/s390x: Restrict I/O handler installers to system emulation Philippe Mathieu-Daudé
2025-01-25 17:01 ` [PATCH v3 19/24] target/s390x: Move has_work() from CPUClass to SysemuCPUOps Philippe Mathieu-Daudé
2025-01-25 17:01 ` [PATCH v3 20/24] target/sh4: " Philippe Mathieu-Daudé
2025-01-25 17:01 ` [PATCH v3 21/24] target/sparc: " Philippe Mathieu-Daudé
2025-01-25 17:01 ` [PATCH v3 22/24] target/tricore: " Philippe Mathieu-Daudé
2025-01-25 17:01 ` [PATCH v3 23/24] target/xtensa: " Philippe Mathieu-Daudé
2025-01-25 17:01 ` [PATCH v3 24/24] cpus: Remove CPUClass::has_work() handler Philippe Mathieu-Daudé
2025-01-26 12:31 ` Richard Henderson
2025-01-27 7:50 ` Philippe Mathieu-Daudé
2025-02-10 21:36 ` Philippe Mathieu-Daudé [this message]
2025-02-10 21:38 ` Richard Henderson
2025-02-10 21:57 ` [PATCH v3 00/24] cpus: Restrict CPU has_work() handlers to system emulation Philippe Mathieu-Daudé
2025-03-09 13:38 ` Philippe Mathieu-Daudé
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=256e36c4-d0d7-4d2b-96a1-888e516f917a@linaro.org \
--to=philmd@linaro.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).