[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v15 21/23] hw/core/cpu: call qemu_init_vcpu in cpu_common_rea
From: |
Alex Bennée |
Subject: |
Re: [PATCH v15 21/23] hw/core/cpu: call qemu_init_vcpu in cpu_common_realizefn |
Date: |
Wed, 03 Feb 2021 16:51:24 +0000 |
User-agent: |
mu4e 1.5.7; emacs 28.0.50 |
Claudio Fontana <cfontana@suse.de> writes:
> move the call to qemu_init_vcpu inside cpu_common_realizefn,
> so it does not need to be done explicitly in each target cpu.
>
> Despite this, the way cpu realize is done continues to be not ideal;
>
> ideally the cpu_list_add would be done in common_cpu,
> and in this case we could avoid even more redundant open coded
> additional calls in target/xxx/cpu.c,
>
> but this cannot happen because target cpu code, plugins, etc
> now all came to rely on cpu->index
> (which is updated in cpu_list_add), since no particular order
> was defined previously, so we are stuck with the freak call
> order for the target cpu realizefn.
>
> After this patch the target/xxx/cpu.c realizefn body becomes:
>
> void mycpu_realizefn(DeviceState *dev, Error **errp)
> {
> /* ... */
> cpu_exec_realizefn(CPU_STATE(dev), errp);
>
> /* ... anything that needs done pre-qemu_vcpu_init */
>
> xcc->parent_realize(dev, errp); /* does qemu_vcpu_init */
>
> /* ... anything that needs to be done after qemu_vcpu_init */
> }
Uggh, introducing a magic order seems like inviting trouble for later
on. Is there anyway we can improve things? Paolo?
--
Alex Bennée
- [PATCH v15 16/23] accel: extend AccelState and AccelClass to user-mode, (continued)
[PATCH v15 21/23] hw/core/cpu: call qemu_init_vcpu in cpu_common_realizefn, Claudio Fontana, 2021/02/01
- Re: [PATCH v15 21/23] hw/core/cpu: call qemu_init_vcpu in cpu_common_realizefn,
Alex Bennée <=
- Re: [PATCH v15 21/23] hw/core/cpu: call qemu_init_vcpu in cpu_common_realizefn, Claudio Fontana, 2021/02/04
- Re: [PATCH v15 21/23] hw/core/cpu: call qemu_init_vcpu in cpu_common_realizefn, Philippe Mathieu-Daudé, 2021/02/04
- Re: [PATCH v15 21/23] hw/core/cpu: call qemu_init_vcpu in cpu_common_realizefn, Claudio Fontana, 2021/02/04
- Re: [PATCH v15 21/23] hw/core/cpu: call qemu_init_vcpu in cpu_common_realizefn, Peter Maydell, 2021/02/04
- Re: [PATCH v15 21/23] hw/core/cpu: call qemu_init_vcpu in cpu_common_realizefn, Claudio Fontana, 2021/02/04
[PATCH v15 19/23] i386: split cpu accelerators from cpu.c, using AccelCPUClass, Claudio Fontana, 2021/02/01
[PATCH v15 18/23] accel: introduce AccelCPUClass extending CPUClass, Claudio Fontana, 2021/02/01