[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC v5 09/12] module: introduce MODULE_INIT_ACCEL_CPU
From: |
Eduardo Habkost |
Subject: |
Re: [RFC v5 09/12] module: introduce MODULE_INIT_ACCEL_CPU |
Date: |
Tue, 24 Nov 2020 12:08:32 -0500 |
On Tue, Nov 24, 2020 at 05:22:07PM +0100, Claudio Fontana wrote:
> apply this to the registration of the cpus accel interfaces,
>
> but this will be also in preparation for later use of this
> new module init step to also register per-accel x86 cpu type
> interfaces.
>
> Signed-off-by: Claudio Fontana <cfontana@suse.de>
> ---
[...]
> diff --git a/accel/qtest/qtest.c b/accel/qtest/qtest.c
> index b4e731cb2b..482f89729f 100644
> --- a/accel/qtest/qtest.c
> +++ b/accel/qtest/qtest.c
> @@ -32,7 +32,6 @@ const CpusAccel qtest_cpus = {
>
> static int qtest_init_accel(MachineState *ms)
> {
> - cpus_register_accel(&qtest_cpus);
> return 0;
> }
>
> @@ -58,3 +57,12 @@ static void qtest_type_init(void)
> }
>
> type_init(qtest_type_init);
> +
> +static void qtest_accel_cpu_init(void)
> +{
> + if (qtest_enabled()) {
> + cpus_register_accel(&qtest_cpus);
> + }
> +}
> +
> +accel_cpu_init(qtest_accel_cpu_init);
I don't understand why this (and the similar changes on other
accelerators) is an improvement.
You are replacing a trivial AccelClass-specific init method with
a module_init() function that has a hidden dependency on runtime
state.
--
Eduardo
- [RFC v5 00/12] i386 cleanup, Claudio Fontana, 2020/11/24
- [RFC v5 02/12] i386: move whpx accel files into whpx/, Claudio Fontana, 2020/11/24
- [RFC v5 06/12] i386: move cpu dump out of helper.c into cpu-dump.c, Claudio Fontana, 2020/11/24
- [RFC v5 08/12] accel: extend AccelState and AccelClass to user-mode, Claudio Fontana, 2020/11/24
- [RFC v5 09/12] module: introduce MODULE_INIT_ACCEL_CPU, Claudio Fontana, 2020/11/24
- Re: [RFC v5 09/12] module: introduce MODULE_INIT_ACCEL_CPU,
Eduardo Habkost <=
- Re: [RFC v5 09/12] module: introduce MODULE_INIT_ACCEL_CPU, Claudio Fontana, 2020/11/24
- Re: [RFC v5 09/12] module: introduce MODULE_INIT_ACCEL_CPU, Eduardo Habkost, 2020/11/24
- Re: [RFC v5 09/12] module: introduce MODULE_INIT_ACCEL_CPU, Paolo Bonzini, 2020/11/24
- Re: [RFC v5 09/12] module: introduce MODULE_INIT_ACCEL_CPU, Claudio Fontana, 2020/11/25
- Re: [RFC v5 09/12] module: introduce MODULE_INIT_ACCEL_CPU, Paolo Bonzini, 2020/11/25
- Re: [RFC v5 09/12] module: introduce MODULE_INIT_ACCEL_CPU, Claudio Fontana, 2020/11/25
- Re: [RFC v5 09/12] module: introduce MODULE_INIT_ACCEL_CPU, Claudio Fontana, 2020/11/26
Re: [RFC v5 09/12] module: introduce MODULE_INIT_ACCEL_CPU, Philippe Mathieu-Daudé, 2020/11/26
[RFC v5 04/12] i386: hvf: remove stale MAINTAINERS entry for old hvf stubs, Claudio Fontana, 2020/11/24