Message ID | 20230918160257.30127-10-philmd@linaro.org |
---|---|
State | New |
Headers | show |
Series | exec/cpu: Call cpu_exec_realizefn() once in cpu_common_realize() | expand |
On 9/18/23 09:02, Philippe Mathieu-Daudé wrote: > Architecture specific hardware doesn't have a particular dependency > on the accelerator vCPU (created with cpu_exec_realizefn), and can > be initialized*after* the vCPU is realized. Doing so allows further > generic API simplification (in few commits). > > Signed-off-by: Philippe Mathieu-Daudé<philmd@linaro.org> > --- > target/arm/cpu.c | 14 ++++++++------ > 1 file changed, 8 insertions(+), 6 deletions(-) Hmm. I suppose so. Considering we have no error return from timer_new(). Reviewed-by: Richard Henderson <richard.henderson@linaro.org> r~
diff --git a/target/arm/cpu.c b/target/arm/cpu.c index fc3772025c..46d3f70d63 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -1748,7 +1748,15 @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp) return; } } +#endif + cpu_exec_realizefn(cs, &local_err); + if (local_err != NULL) { + error_propagate(errp, local_err); + return; + } + +#ifndef CONFIG_USER_ONLY { uint64_t scale; @@ -1776,12 +1784,6 @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp) } #endif - cpu_exec_realizefn(cs, &local_err); - if (local_err != NULL) { - error_propagate(errp, local_err); - return; - } - arm_cpu_finalize_features(cpu, &local_err); if (local_err != NULL) { error_propagate(errp, local_err);
Architecture specific hardware doesn't have a particular dependency on the accelerator vCPU (created with cpu_exec_realizefn), and can be initialized *after* the vCPU is realized. Doing so allows further generic API simplification (in few commits). Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> --- target/arm/cpu.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)