[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC v5 08/12] accel: extend AccelState and AccelClass to user-mode
From: |
Claudio Fontana |
Subject: |
Re: [RFC v5 08/12] accel: extend AccelState and AccelClass to user-mode |
Date: |
Tue, 24 Nov 2020 19:16:35 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 |
Hi Eduardo,
thanks for looking at this,
On 11/24/20 6:56 PM, Eduardo Habkost wrote:
> On Tue, Nov 24, 2020 at 05:22:06PM +0100, Claudio Fontana wrote:
>> Signed-off-by: Claudio Fontana <cfontana@suse.de>
>> ---
> [...]
>> @@ -908,8 +909,12 @@ int main(int argc, char **argv)
>> }
>>
>> /* init tcg before creating CPUs and to get qemu_host_page_size */
>> - tcg_exec_init(0);
>> + {
>> + AccelClass *ac = accel_find("tcg");
>>
>> + g_assert(ac != NULL);
>> + ac->init_machine(NULL);
>
> Most init_machine() methods will crash if you call them with a
> NULL argument.
not tcg though,
>
> This looks like another reason for having a
> void accel_init(AccelState*)
> function and a
> void (*init)(AccelState*)
> method in AccelClass.
>
> Then the whole code block above would be as trivial as:
>
> accel_init(current_accel());
but this does look like an attractive result,
thanks!
CLaudio
>
>
>> + }
> [...]
>>
>
- [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, 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, 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