On Tue, Nov 24, 2020 at 07:52:15PM +0100, Claudio Fontana wrote: [...] > >> + } > > > > Additionally, if you call arch_cpu_accel_init() here, you won't > > need MODULE_INIT_ACCEL_CPU anymore. The > > > > module_call_init(MODULE_INIT_ACCEL_CPU) > > > > call with implicit dependencies on runtime state inside vl.c and > > *-user/main.c becomes a trivial: > > > > accel_init(accel) > > > > call in accel_init_machine() and *-user:main(). > > > > I do need a separate thing for the arch cpu accel specialization though, > without MODULE_INIT_ACCEL_CPU that link between all operations done at > accel-chosen time is missing.. >
I think this is a key point we need to sort out. What do you mean by "link between all operations done at accel-chosen time" and why that's important? accel_init_machine() has 2-3 lines of code with side effects. It calls AccelClass.init_machine(), which may may have hundreds of lines of code. accel_setup_post() has one additional method call, which is triggered at a slightly different moment. You are using MODULE_INIT_ACCEL for 2 additional lines of code: - the cpus_register_accel() call - the x86_cpu_accel_init() call What makes those 2 lines of code so special, to make them deserve a completely new mechanism to trigger them, instead of using trivial function calls inside a accel_init() function? -- Eduardo