qemu-devel
[Top][All Lists]
Advanced

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

Re: [RFC v9 17/32] accel/tcg: split TCG-only code from cpu_exec_realizef


From: Alex Bennée
Subject: Re: [RFC v9 17/32] accel/tcg: split TCG-only code from cpu_exec_realizefn
Date: Wed, 09 Dec 2020 10:42:54 +0000
User-agent: mu4e 1.5.7; emacs 28.0.50

Claudio Fontana <cfontana@suse.de> writes:

> move away TCG-only code, make it compile only on TCG.
>
> Signed-off-by: Claudio Fontana <cfontana@suse.de>
> ---
>  accel/tcg/cpu-exec.c  | 28 +++++++++++++++++
>  cpu.c                 | 70 ++++++++++++++++++++-----------------------
>  hw/core/cpu.c         |  6 +++-
>  include/hw/core/cpu.h |  8 +++++
>  4 files changed, 74 insertions(+), 38 deletions(-)
>
> diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c
> index 64cba89356..436dfbf155 100644
> --- a/accel/tcg/cpu-exec.c
> +++ b/accel/tcg/cpu-exec.c
> @@ -801,6 +801,34 @@ int cpu_exec(CPUState *cpu)
>      return ret;
>  }
>  
> +void tcg_exec_realizefn(CPUState *cpu, Error **errp)
> +{
> +    static bool tcg_target_initialized;
> +    CPUClass *cc = CPU_GET_CLASS(cpu);
> +
> +    if (!tcg_target_initialized) {
> +        tcg_target_initialized = true;
> +        cc->tcg_ops.initialize();

nit: it makes no difference but stylistically it makes sense to set
tcg_target_initialized after we have in fact initialised.

Also we've dropped the tcg_enabled() check, if indeed it will always be
true should we not assert it to ensure the statement for tcg_exec_init
remains the case: "Must be called before using the QEMU cpus."

Otherwise LGTM:

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>

-- 
Alex Bennée



reply via email to

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