[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v6 01/11] sysemu/tcg: Introduce tcg_builtin() helper
From: |
Claudio Fontana |
Subject: |
Re: [PATCH v6 01/11] sysemu/tcg: Introduce tcg_builtin() helper |
Date: |
Sun, 31 Jan 2021 15:18:09 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 |
On 1/31/21 12:50 PM, Philippe Mathieu-Daudé wrote:
> Modules are registered early with type_register_static().
>
> We would like to call tcg_enabled() when registering QOM types,
Hi Philippe,
could this not be controlled by meson at this stage?
On X86, I register the tcg-specific types in tcg/* in modules that are only
built for TCG.
Maybe tcg_builtin() is useful anyway, thinking long term at loadable modules,
but there we are interested in whether tcg code is available or not, regardless
of whether it's builtin,
or needs to be loaded via a .so plugin..
maybe tcg_available()?
Ciao,
Claudio
> but tcg_enabled() returns tcg_allowed which is a runtime property
> initialized later (See commit 2f181fbd5a9 which introduced the
> MachineInitPhase in "hw/qdev-core.h" representing the different
> phases of machine initialization and commit 0427b6257e2 which
> document the initialization order).
>
> As we are only interested if the TCG accelerator is builtin,
> regardless of being enabled, introduce the tcg_builtin() helper.
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> Cc: Markus Armbruster <armbru@redhat.com>
> ---
> include/sysemu/tcg.h | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/include/sysemu/tcg.h b/include/sysemu/tcg.h
> index 00349fb18a7..6ac5c2ca89d 100644
> --- a/include/sysemu/tcg.h
> +++ b/include/sysemu/tcg.h
> @@ -13,8 +13,10 @@ void tcg_exec_init(unsigned long tb_size, int splitwx);
> #ifdef CONFIG_TCG
> extern bool tcg_allowed;
> #define tcg_enabled() (tcg_allowed)
> +#define tcg_builtin() 1
> #else
> #define tcg_enabled() 0
> +#define tcg_builtin() 0
> #endif
>
> #endif
>
- [PATCH v6 00/11] Support disabling TCG on ARM (part 2), Philippe Mathieu-Daudé, 2021/01/31
- [PATCH v6 01/11] sysemu/tcg: Introduce tcg_builtin() helper, Philippe Mathieu-Daudé, 2021/01/31
- Re: [PATCH v6 01/11] sysemu/tcg: Introduce tcg_builtin() helper,
Claudio Fontana <=
- [PATCH v6 02/11] exec: Restrict TCG specific headers, Philippe Mathieu-Daudé, 2021/01/31
- [PATCH v6 03/11] target/arm: Restrict ARMv4 cpus to TCG accel, Philippe Mathieu-Daudé, 2021/01/31
- [PATCH v6 04/11] target/arm: Restrict ARMv5 cpus to TCG accel, Philippe Mathieu-Daudé, 2021/01/31
- [PATCH v6 07/11] target/arm: Restrict ARMv7 M-profile cpus to TCG accel, Philippe Mathieu-Daudé, 2021/01/31
- [PATCH v6 08/11] target/arm: Make m_helper.c optional via CONFIG_ARM_V7M, Philippe Mathieu-Daudé, 2021/01/31