[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 00/19] Split cpu_exec_init() into an init and a
From: |
Laurent Vivier |
Subject: |
Re: [Qemu-devel] [PATCH 00/19] Split cpu_exec_init() into an init and a realize part |
Date: |
Wed, 5 Oct 2016 23:25:35 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 |
On 05/10/2016 22:11, Peter Maydell wrote:
> On 5 October 2016 at 12:38, Laurent Vivier <address@hidden> wrote:
>> Since commit 42ecaba ("target-i386: Call cpu_exec_init() on realize"),
>> , commit 6dd0f83 ("target-ppc: Move cpu_exec_init() call to realize
>> function"),
>> and commit c6644fc ("s390x/cpu: Get rid of side effects when creating a
>> vcpu"),
>> cpu_exec_init() has been moved to realize function for some architectures
>> to implement CPU htoplug. This allows any failures from cpu_exec_init() to be
>> handled appropriately.
>>
>> This series tries to do the same work for all the other CPUs.
>>
>> But as the ARM Virtual Machine ("virt") needs the "memory" property of the
>> CPU
>> in the machine init function (the "memory" property is created in
>> cpu_exec_init() we want to move to the realize part), split cpu_exec_init()
>> in
>> two parts: a realize part (cpu_exec_realize(), adding the CPU in the
>> environment) and an init part (cpu_exec_init(), initializing the CPU, like
>> adding the "memory" property).
>>
>> For target-i386, target-s390 and target-ppc, we move back the cpu_exec_init()
>> into the init part, and put the cpu_exec_realize() into the realize part.
>> For all the other CPUs, we add the cpu_exec_realize() function into the
>> realize part.
>>
>> This also allows to remove all the "cannot_destroy_with_object_finalize_yet"
>> properties from the CPU device class.
>
> At some point following this we should remove the Error** argument
> from cpu_exec_init() : init isn't permitted to fail and indeed
> cpu_exec_init() never does, so the argument is unneeded.
I agree.
> If realize fails do we correctly release the reference we take on
> cpu->memory in cpu_exec_init()?
Because of OBJ_PROP_LINK_UNREF_ON_RELEASE, I think the reference is
decreased when the object is released.
Laurent
- [Qemu-devel] [PATCH 14/19] target-sh4: move cpu_exec_realize() to realize function, (continued)
- [Qemu-devel] [PATCH 14/19] target-sh4: move cpu_exec_realize() to realize function, Laurent Vivier, 2016/10/05
- [Qemu-devel] [PATCH 15/19] target-sparc: move cpu_exec_realize() to realize function, Laurent Vivier, 2016/10/05
- [Qemu-devel] [PATCH 16/19] target-tilegx: move cpu_exec_realize() to realize function, Laurent Vivier, 2016/10/05
- [Qemu-devel] [PATCH 17/19] target-tricore: move cpu_exec_realize() to realize function, Laurent Vivier, 2016/10/05
- [Qemu-devel] [PATCH 18/19] target-unicore32: move cpu_exec_realize() to realize function, Laurent Vivier, 2016/10/05
- [Qemu-devel] [PATCH 19/19] target-xtensa: move cpu_exec_realize() to realize function, Laurent Vivier, 2016/10/05
- Re: [Qemu-devel] [PATCH 00/19] Split cpu_exec_init() into an init and a realize part, Peter Maydell, 2016/10/05
- Re: [Qemu-devel] [PATCH 00/19] Split cpu_exec_init() into an init and a realize part,
Laurent Vivier <=
- Re: [Qemu-devel] [PATCH 00/19] Split cpu_exec_init() into an init and a realize part, Eduardo Habkost, 2016/10/05