|
From: | Philippe Mathieu-Daudé |
Subject: | Re: [PATCH v3 24/24] cpus: Remove CPUClass::has_work() handler |
Date: | Mon, 27 Jan 2025 08:50:26 +0100 |
User-agent: | Mozilla Thunderbird |
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...
[Prev in Thread] | Current Thread | [Next in Thread] |