[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH qom v4 2/7] cpus: Convert cpu_index into a bitma
From: |
Andreas Färber |
Subject: |
Re: [Qemu-devel] [PATCH qom v4 2/7] cpus: Convert cpu_index into a bitmap |
Date: |
Wed, 24 Jun 2015 17:39:05 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 |
s/cpus/cpu/
Am 24.06.2015 um 15:53 schrieb Andreas Färber:
> Am 24.06.2015 um 04:31 schrieb Peter Crosthwaite:
>> From: Bharata B Rao <address@hidden>
>>
>> Currently CPUState.cpu_index is monotonically increasing and a newly
CPUState::cpu_index
>> created CPU always gets the next higher index. The next available
>> index is calculated by counting the existing number of CPUs. This is
>> fine as long as we only add CPUs, but there are architectures which
>> are starting to support CPU removal too. For an architecture like PowerPC
>> which derives its CPU identifier (device tree ID) from cpu_index, the
>> existing logic of generating cpu_index values causes problems.
>>
>> With the currently proposed method of handling vCPU removal by parking
>> the vCPU fd in QEMU
>> (Ref: http://lists.gnu.org/archive/html/qemu-devel/2015-02/msg02604.html),
>> generating cpu_index this way will not work for PowerPC.
>>
>> This patch changes the way cpu_index is handed out by maintaining
>> a bit map of the CPUs that tracks both addition and removal of CPUs.
>>
>> The CPU bitmap allocation logic is part of cpu_exec_init() which is
>> called by instance_init routines of various CPU targets. Newly added
>> cpu_exec_exit() API handles the deallocation part and this routine is
>> called from generic CPU::instance_finalize().
(Here it's in TypeInfo:: actually.)
>>
>> Note: This new CPU enumeration is for !CONFIG_USER_ONLY only.
>> CONFIG_USER_ONLY continues to have the old enumeration logic.
>>
>> Signed-off-by: Bharata B Rao <address@hidden>
>> Reviewed-by: Eduardo Habkost <address@hidden>
>> Reviewed-by: Igor Mammedov <address@hidden>
>> Reviewed-by: David Gibson <address@hidden>
>> Reviewed-by: Peter Crosthwaite <address@hidden>
>> Acked-by: Paolo Bonzini <address@hidden>
>> Signed-off-by: Peter Crosthwaite <address@hidden>
>> ---
>> exec.c | 55
>> ++++++++++++++++++++++++++++++++++++++++++++++++++-----
>> include/qom/cpu.h | 1 +
>> qom/cpu.c | 7 +++++++
>> 3 files changed, 58 insertions(+), 5 deletions(-)
>
> Doesn't apply on my tree, trying manually...
Caused by exec.c -> qom/cpu.c code movements from Eduardo in my queue.
Applied to qom-cpu.
Thanks,
Andreas
--
SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Dilip Upmanyu, Graham Norton; HRB
21284 (AG Nürnberg)
[Qemu-devel] [PATCH qom v4 5/7] gdbserver: _fork: Change fn to accept cpu instead of env, Peter Crosthwaite, 2015/06/23
[Qemu-devel] [PATCH qom v4 6/7] cpus: Change tcg_cpu_exec() arg to cpu, not env, Peter Crosthwaite, 2015/06/23
[Qemu-devel] [PATCH qom v4 7/7] cpus: Change exec_init() arg to cpu, not env, Peter Crosthwaite, 2015/06/23
Re: [Qemu-devel] [PATCH qom v4 0/7] More core code ENV_GET_CPU removals, Andreas Färber, 2015/06/24