From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39159) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YwhM1-0004RT-Ks for qemu-devel@nongnu.org; Sun, 24 May 2015 21:38:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YwhM0-0001bA-E7 for qemu-devel@nongnu.org; Sun, 24 May 2015 21:38:57 -0400 Received: from ozlabs.org ([2401:3900:2:1::2]:59342) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YwhM0-0001aV-31 for qemu-devel@nongnu.org; Sun, 24 May 2015 21:38:56 -0400 Date: Mon, 25 May 2015 11:05:46 +1000 From: David Gibson Message-ID: <20150525010546.GE6255@voom.redhat.com> References: <1432184528-31252-1-git-send-email-bharata@linux.vnet.ibm.com> <1432184528-31252-3-git-send-email-bharata@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="X3gaHHMYHkYqP6yf" Content-Disposition: inline In-Reply-To: <1432184528-31252-3-git-send-email-bharata@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] [PATCH v3 2/3] cpus: Convert cpu_index into a bitmap List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Bharata B Rao Cc: zhugh.fnst@cn.fujitsu.com, ehabkost@redhat.com, agraf@suse.de, qemu-devel@nongnu.org, imammedo@redhat.com, afaerber@suse.de --X3gaHHMYHkYqP6yf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 21, 2015 at 10:32:07AM +0530, Bharata B Rao wrote: > 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 PowerPC > 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.html), > 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: David Gibson --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --X3gaHHMYHkYqP6yf Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJVYnVqAAoJEGw4ysog2bOSm1UP/0Rs7YZqlKGYc6h6uNSdtvhk KBvX0XBulpgkAK6t6g/Bm+aCmsa1gKaqxlbwJTMZSkxJ8+6ImqRPFZ23VGOb31c/ iDXIi68Tci9kTXtAqXotjg4abertikKf02uStrN0efTa1Iaj+UXCcC3UoSq1UKTD TgE/BY1a8xEMCSR8YSctxVwssZJV2AF5FJdkOMCbofB6FxLyv0y0WyLIMpd9oydB dnlXAhrUhRpldH+B84bljPx6Wv8DJBNzauB+SRUMksjLMDN2gQraysosiN5JRInH gTYYysdxWMyir9g+ztZve75SLOtWpTeupk1FhM3SZM6WPseAqxUvudeYRZY7/e8z XIhSPHWhvkKweVqwNCqms+YgTVlMN8kAhwOJ1mICecT7mRD0bGXg/YsUemUt6rMV GdxMxyU68uIoiabhPwh895OIWLsZcP3vnJDWD6XLPqV8BPPaBMObhFq8T8AEQ5Ak XieP49JqnCd5Nk1YA/+2fy+pTAbw164PEQoito/dYHR8UlZG9QnDIf7pBvI31A/V /gJoj1EQtewNCmktAyNRKvyN9DxneLwr/we3AZet5Bx58CIZFIB5h05HaGVGzu8u FwzEQTOmVjixCuGyWUICAhN63egiOZDUBfDS7I+pdKdqlLGTnP8jn4U4SWO3Ywz9 NFZJ9N6i0OkG4wXC7IuV =kYOf -----END PGP SIGNATURE----- --X3gaHHMYHkYqP6yf--