From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33832) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7mla-0006Ay-Fi for qemu-devel@nongnu.org; Wed, 24 Jun 2015 11:39:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z7mlW-0004Pc-Dr for qemu-devel@nongnu.org; Wed, 24 Jun 2015 11:39:10 -0400 Received: from cantor2.suse.de ([195.135.220.15]:41754 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7mlW-0004PU-6z for qemu-devel@nongnu.org; Wed, 24 Jun 2015 11:39:06 -0400 Message-ID: <558ACF19.30805@suse.de> Date: Wed, 24 Jun 2015 17:39:05 +0200 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <703168841e3f440be5ea6f6bc314fbeaaa33aaf1.1435112834.git.crosthwaite.peter@gmail.com> <558AB65F.3010108@suse.de> In-Reply-To: <558AB65F.3010108@suse.de> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH qom v4 2/7] cpus: Convert cpu_index into a bitmap List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Crosthwaite , qemu-devel@nongnu.org Cc: Peter Crosthwaite , Bharata B Rao , ehabkost@redhat.com, aurelien@aurel32.net, rth@twiddle.net s/cpus/cpu/ Am 24.06.2015 um 15:53 schrieb Andreas F=E4rber: > Am 24.06.2015 um 04:31 schrieb Peter Crosthwaite: >> From: Bharata B Rao >> >> 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 Powe= rPC >> 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.ht= ml), >> 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 >> Reviewed-by: Eduardo Habkost >> Reviewed-by: Igor Mammedov >> Reviewed-by: David Gibson >> Reviewed-by: Peter Crosthwaite >> Acked-by: Paolo Bonzini >> Signed-off-by: Peter Crosthwaite >> --- >> exec.c | 55 ++++++++++++++++++++++++++++++++++++++++++++++= ++++----- >> include/qom/cpu.h | 1 + >> qom/cpu.c | 7 +++++++ >> 3 files changed, 58 insertions(+), 5 deletions(-) >=20 > 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 --=20 SUSE Linux GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Felix Imend=F6rffer, Jane Smithard, Dilip Upmanyu, Graham Norton; HRB 21284 (AG N=FCrnberg)