From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36907) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YreXN-00026s-1t for qemu-devel@nongnu.org; Sun, 10 May 2015 23:37:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YreXJ-0004eC-SX for qemu-devel@nongnu.org; Sun, 10 May 2015 23:37:48 -0400 Received: from e28smtp08.in.ibm.com ([122.248.162.8]:42725) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YreXJ-0004e4-7J for qemu-devel@nongnu.org; Sun, 10 May 2015 23:37:45 -0400 Received: from /spool/local by e28smtp08.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 11 May 2015 09:07:42 +0530 Received: from d28relay05.in.ibm.com (d28relay05.in.ibm.com [9.184.220.62]) by d28dlp01.in.ibm.com (Postfix) with ESMTP id E1B82E0059 for ; Mon, 11 May 2015 09:10:33 +0530 (IST) Received: from d28av03.in.ibm.com (d28av03.in.ibm.com [9.184.220.65]) by d28relay05.in.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t4B3barp43384938 for ; Mon, 11 May 2015 09:07:37 +0530 Received: from d28av03.in.ibm.com (localhost [127.0.0.1]) by d28av03.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t4B32KC8027415 for ; Mon, 11 May 2015 08:32:21 +0530 Date: Mon, 11 May 2015 09:07:35 +0530 From: Bharata B Rao Message-ID: <20150511033734.GB7715@in.ibm.com> References: <1431078696-29519-1-git-send-email-bharata@linux.vnet.ibm.com> <1431078696-29519-3-git-send-email-bharata@linux.vnet.ibm.com> <20150508145740.GK17796@thinpad.lan.raisama.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150508145740.GK17796@thinpad.lan.raisama.net> Subject: Re: [Qemu-devel] [RFC v1 PATCH 2/3] cpus: Convert cpu_index into a bitmap Reply-To: bharata@linux.vnet.ibm.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost Cc: zhugh.fnst@cn.fujitsu.com, agraf@suse.de, qemu-devel@nongnu.org, imammedo@redhat.com, afaerber@suse.de, david@gibson.dropbear.id.au On Fri, May 08, 2015 at 11:57:40AM -0300, Eduardo Habkost wrote: > On Fri, May 08, 2015 at 03:21:35PM +0530, Bharata B Rao wrote: > [...] > > void cpu_exec_init(CPUArchState *env, Error **errp) > > { > > CPUState *cpu = ENV_GET_CPU(env); > > CPUClass *cc = CPU_GET_CLASS(cpu); > > - CPUState *some_cpu; > > int cpu_index; > > - > > #if defined(CONFIG_USER_ONLY) > > + CPUState *some_cpu; > > + > > cpu_list_lock(); > > -#endif > > cpu_index = 0; > > CPU_FOREACH(some_cpu) { > > cpu_index++; > > } > > cpu->cpu_index = cpu_index; > > Why not use the bitmap on CONFIG_USER too? I was doing like that in v1 and it required me to cook up a max_cpus value for CONFIG_USER case to define the bitmap. Andreas pointed out that it is better not to touch the allocation logic for CONFIG_USER. https://lists.gnu.org/archive/html/qemu-devel/2015-03/msg03571.html Regards, Bharata.