From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41802) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V44IA-0002Ro-8s for qemu-devel@nongnu.org; Tue, 30 Jul 2013 03:24:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V44I4-000448-8J for qemu-devel@nongnu.org; Tue, 30 Jul 2013 03:24:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:8966) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V44I3-000441-UW for qemu-devel@nongnu.org; Tue, 30 Jul 2013 03:24:16 -0400 Date: Tue, 30 Jul 2013 09:24:02 +0200 From: Igor Mammedov Message-ID: <20130730092402.3c7d84f7@nial.usersys.redhat.com> In-Reply-To: <51F6C585.4070109@linux.vnet.ibm.com> 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> <51F6C585.4070109@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 8/8] [PATCH RFC v2] s390-qemu: cpu hotplug - Treat S390 cpus as devices List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: jjherne@linux.vnet.ibm.com Cc: ehabkost@redhat.com, qemu-devel@nongnu.org, agraf@suse.de, borntraeger@de.ibm.com, jfrei@linux.vnet.ibm.com, Cornelia Huck , "Jason J. Herne" , Andreas =?ISO-8859-1?B?RuRyYmVy?= On Mon, 29 Jul 2013 15:41:57 -0400 "Jason J. Herne" wrote: > On 06/08/2013 09:11 PM, Andreas F=E4rber wrote: > >> if (tcg_enabled() && !inited) { > >> > inited =3D true; > >> > s390x_translate_init(); > >> > } > >> >+ > >> >+ smp_cpus +=3D 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. > > >=20 > I've redesigned a lot of this to make it simpler and less intrusive.=20 > I'm almost ready to post the next revision but I'm hung up on this one=20 > thing. >=20 > I moved the smp_cpu increment to qom/cpu.c : cpu_common_realizefn.=20 > However this seems to break the user mode target because smp_cpus does=20 > not exist. I tried wrapping the increment in a #ifndef CONFIG_USER_ONLY= =20 > statement but it seems to have no effect. I think the reason for that=20 > is because CONFIG_USER_ONLY is added to config-target.h which is not=20 > actually generated until after we compile qom/cpu.c. >=20 > ... > 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 > ... >=20 > Is there another place I should put the increment? Could you just use current number of cpus instead of smp_cpus increment? =20