From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33857) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3tKh-0003La-Qa for qemu-devel@nongnu.org; Mon, 29 Jul 2013 15:42:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V3tKY-0000nn-Rb for qemu-devel@nongnu.org; Mon, 29 Jul 2013 15:42:15 -0400 Received: from e8.ny.us.ibm.com ([32.97.182.138]:35820) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3tKY-0000nY-Ma for qemu-devel@nongnu.org; Mon, 29 Jul 2013 15:42:06 -0400 Received: from /spool/local by e8.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 29 Jul 2013 20:42:04 +0100 Received: from d01relay03.pok.ibm.com (d01relay03.pok.ibm.com [9.56.227.235]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id DF68038C8056 for ; Mon, 29 Jul 2013 15:41:59 -0400 (EDT) Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay03.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r6TJg1NB170056 for ; Mon, 29 Jul 2013 15:42:01 -0400 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r6TJg0V3023746 for ; Mon, 29 Jul 2013 16:42:00 -0300 Message-ID: <51F6C585.4070109@linux.vnet.ibm.com> Date: Mon, 29 Jul 2013 15:41:57 -0400 From: "Jason J. Herne" MIME-Version: 1.0 References: <1370626087-840-1-git-send-email-jjherne@us.ibm.com> <1370626087-840-9-git-send-email-jjherne@us.ibm.com> <51B3D647.6090400@suse.de> In-Reply-To: <51B3D647.6090400@suse.de> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH 8/8] [PATCH RFC v2] s390-qemu: cpu hotplug - Treat S390 cpus as devices Reply-To: jjherne@linux.vnet.ibm.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?ISO-8859-15?Q?Andreas_F=E4rber?= Cc: ehabkost@redhat.com, qemu-devel@nongnu.org, agraf@suse.de, borntraeger@de.ibm.com, jfrei@linux.vnet.ibm.com, Cornelia Huck , imammedo@redhat.com, "Jason J. Herne" On 06/08/2013 09:11 PM, Andreas Färber wrote: >> if (tcg_enabled() && !inited) { >> > inited = true; >> > s390x_translate_init(); >> > } >> >+ >> >+ smp_cpus += 1; > Won't we need some form of locking? > > If we fiddle with a global CPU counter, we should do so in qom/cpu.c, > not just in s390x code. > I've redesigned a lot of this to make it simpler and less intrusive. I'm almost ready to post the next revision but I'm hung up on this one thing. I moved the smp_cpu increment to qom/cpu.c : cpu_common_realizefn. However this seems to break the user mode target because smp_cpus does not exist. I tried wrapping the increment in a #ifndef CONFIG_USER_ONLY statement but it seems to have no effect. I think the reason for that is because CONFIG_USER_ONLY is added to config-target.h which is not actually generated until after we compile qom/cpu.c. ... CC qom/object.o CC qom/container.o CC qom/qom-qobject.o CC qom/cpu.o CC hw/core/qdev.o CC hw/core/qdev-properties.o CC hw/core/irq.o GEN s390x-linux-user/config-target.h CC s390x-linux-user/exec.o ... Is there another place I should put the increment? -- -- Jason J. Herne (jjherne@linux.vnet.ibm.com)