[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC v5 09/12] module: introduce MODULE_INIT_ACCEL_CPU
From: |
Claudio Fontana |
Subject: |
Re: [RFC v5 09/12] module: introduce MODULE_INIT_ACCEL_CPU |
Date: |
Wed, 25 Nov 2020 10:21:25 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 |
On 11/24/20 9:01 PM, Paolo Bonzini wrote:
> On 24/11/20 20:08, Eduardo Habkost wrote:
>>> Not a big advantage I agree,
>>> I think however there is one, in using the existing framework that exists,
>>> for the purposes that it was built for.
>>>
>>> As I understand it, the global module init framework is supposed to mark
>>> the major initialization steps,
>>> and this seems to fit the bill.
>> That seems to be the main source of disagreement. I don't agree
>> that's the purpose of module_init().
>>
>> The module init framework is used to unconditionally register
>> module-provided entities like option names, QOM types, block
>> drivers, trace events, etc. The entities registered by module
>> init functions represent a passive dynamically loadable piece of
>> code.
>
> Indeed. Think of module_init() as C++ global constructors.
>
> Anything that has an "if" does not belong in module_init.
>
> If you look at my review of the previous versions, I was not necessarily
> against MODULE_INIT_ACCEL_CPU, but I was (and am) strongly against
> calling it in the middle of the machine creation sequence.
>
> Paolo
>
>
Hi Paolo,
in RFC v5 , module init for ACCEL_CPU is not conditional anymore, right?
But the fact that its behavior depends on current_accel() still disqualifies it?
It is called right after the accelerator is chosen and initialized in RFC v5,
this still is "in the middle of the machine creation sequence"?
I am trying to find the actual things to fix, since when doing RFC v5 I tried
to specifically address two points:
1) no if () inside module init functions
2) no proliferation of module init functions
which I accomplished via AccelClass extension to user mode, current_accel(),
and class lookup.
If MODULE_INIT_ACCEL_CPU remains an option, where would you like to see the
call so that it is not "in the middle"?
It is interesting for me to try to discern which meaning you folks give to
MODULE_INIT.
Keep in mind, I will experiment with Eduardo's option of "one accel_init() to
rule them all", without MODULE_INIT_ACCEL_CPU,
so I am not focused on using this no matter what.
Ciao,
Claudio
- [RFC v5 02/12] i386: move whpx accel files into whpx/, (continued)
- [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, 2020/11/24
- 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 <=
- 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
[RFC v5 07/12] i386: move TCG cpu class initialization out of helper.c, Claudio Fontana, 2020/11/24
[RFC v5 10/12] i386: split cpu accelerators from cpu.c, Claudio Fontana, 2020/11/24
[RFC v5 03/12] i386: move hax accel files into hax/, Claudio Fontana, 2020/11/24
[RFC v5 05/12] i386: move TCG accel files into tcg/, Claudio Fontana, 2020/11/24