[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~
- [PATCH v11 08/25] i386: move TCG accel files into tcg/, (continued)
- [PATCH v11 08/25] i386: move TCG accel files into tcg/, Claudio Fontana, 2020/12/11
- [PATCH v11 12/25] tcg: make CPUClass.cpu_exec_* optional, Claudio Fontana, 2020/12/11
- [PATCH v11 07/25] i386: hvf: remove stale MAINTAINERS entry for old hvf stubs, Claudio Fontana, 2020/12/11
- [PATCH v11 09/25] i386: move cpu dump out of helper.c into cpu-dump.c, Claudio Fontana, 2020/12/11
- [PATCH v11 11/25] tcg: cpu_exec_{enter,exit} helpers, Claudio Fontana, 2020/12/11
- [PATCH v11 15/25] cpu: Introduce TCGCpuOperations struct, Claudio Fontana, 2020/12/11
- Re: [PATCH v11 15/25] cpu: Introduce TCGCpuOperations struct,
Richard Henderson <=
- [PATCH v11 13/25] tcg: Make CPUClass.debug_excp_handler optional, Claudio Fontana, 2020/12/11
- [PATCH v11 16/25] target/riscv: remove CONFIG_TCG, as it is always TCG, Claudio Fontana, 2020/12/11
- [PATCH v11 21/25] cpu: Move debug_excp_handler to tcg_ops, Claudio Fontana, 2020/12/11
- [PATCH v11 18/25] cpu: Move synchronize_from_tb() to tcg_ops, Claudio Fontana, 2020/12/11