From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46637) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7l7U-0002MV-My for qemu-devel@nongnu.org; Wed, 24 Jun 2015 09:53:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z7l7Q-0007DW-GE for qemu-devel@nongnu.org; Wed, 24 Jun 2015 09:53:40 -0400 Received: from cantor2.suse.de ([195.135.220.15]:35188 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7l7Q-0007DK-A2 for qemu-devel@nongnu.org; Wed, 24 Jun 2015 09:53:36 -0400 Message-ID: <558AB65F.3010108@suse.de> Date: Wed, 24 Jun 2015 15:53:35 +0200 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <703168841e3f440be5ea6f6bc314fbeaaa33aaf1.1435112834.git.crosthwaite.peter@gmail.com> In-Reply-To: <703168841e3f440be5ea6f6bc314fbeaaa33aaf1.1435112834.git.crosthwaite.peter@gmail.com> 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: rth@twiddle.net, Bharata B Rao , ehabkost@redhat.com, aurelien@aurel32.net, Peter Crosthwaite Am 24.06.2015 um 04:31 schrieb Peter Crosthwaite: > From: Bharata B Rao >=20 > Currently CPUState.cpu_index is monotonically increasing and a newly > 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 Power= PC > which derives its CPU identifier (device tree ID) from cpu_index, the > existing logic of generating cpu_index values causes problems. >=20 > 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.htm= l), > generating cpu_index this way will not work for PowerPC. >=20 > 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. >=20 > 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(). >=20 > Note: This new CPU enumeration is for !CONFIG_USER_ONLY only. > CONFIG_USER_ONLY continues to have the old enumeration logic. >=20 > 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(-) Doesn't apply on my tree, trying manually... 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)