qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v11 15/25] cpu: Introduce TCGCpuOperations struct


From: Richard Henderson
Subject: Re: [PATCH v11 15/25] cpu: Introduce TCGCpuOperations struct
Date: Fri, 11 Dec 2020 10:55:06 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

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


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]