On 12/11/20 10:55 AM, Richard Henderson wrote:
> On 12/11/20 2:31 AM, Claudio Fontana wrote:
>> --- a/cpu.c
>> +++ b/cpu.c
>> @@ -174,14 +174,18 @@ void cpu_exec_initfn(CPUState *cpu)
>> void cpu_exec_realizefn(CPUState *cpu, Error **errp)
>> {
>> CPUClass *cc = CPU_GET_CLASS(cpu);
>> +#ifdef CONFIG_TCG
>> static bool tcg_target_initialized;
>> +#endif /* CONFIG_TCG */
>>
>> cpu_list_add(cpu);
>>
>> +#ifdef CONFIG_TCG
>> if (tcg_enabled() && !tcg_target_initialized) {
>> tcg_target_initialized = true;
>> - cc->tcg_initialize();
>> + cc->tcg_ops.initialize();
>> }
>> +#endif /* CONFIG_TCG */
>
> Not a big fan of the extra ifdefs. Are we expecting that there won't be any
> more of these, that other references to cc->tcg_ops will be completely within
> accel/tcg/?
>
> We can at least combine these two,
>
> #ifdef CONFIG_TCG
> if (tcg_enabled()) {
> static bool tcg_target_initialized;
> if (!tcg_target_initialized) {
> tcg_target_initialized = true;
> cc->tcg_ops.initialize();
> }
> }
> #endif
Nevermind, I now see this is cleaned up further in patch 17.
Reviewed-by: Richard Henderson <[email protected]>
r~