From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49267) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Um42i-00008H-7V for qemu-devel@nongnu.org; Mon, 10 Jun 2013 11:30:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Um42g-0004mo-1e for qemu-devel@nongnu.org; Mon, 10 Jun 2013 11:30:00 -0400 Received: from e7.ny.us.ibm.com ([32.97.182.137]:34941) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Um42f-0004mM-U5 for qemu-devel@nongnu.org; Mon, 10 Jun 2013 11:29:57 -0400 Received: from /spool/local by e7.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 10 Jun 2013 11:29:54 -0400 Received: from d01relay05.pok.ibm.com (d01relay05.pok.ibm.com [9.56.227.237]) by d01dlp02.pok.ibm.com (Postfix) with ESMTP id C41AF6E8048 for ; Mon, 10 Jun 2013 11:29:48 -0400 (EDT) Received: from d03av06.boulder.ibm.com (d03av06.boulder.ibm.com [9.17.195.245]) by d01relay05.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r5AFTo9I337314 for ; Mon, 10 Jun 2013 11:29:50 -0400 Received: from d03av06.boulder.ibm.com (loopback [127.0.0.1]) by d03av06.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r5AFW56U007210 for ; Mon, 10 Jun 2013 09:32:06 -0600 Message-ID: <51B5F0A7.8090908@linux.vnet.ibm.com> Date: Mon, 10 Jun 2013 11:28:39 -0400 From: "Jason J. Herne" MIME-Version: 1.0 References: <1370626087-840-1-git-send-email-jjherne@us.ibm.com> <1370626087-840-6-git-send-email-jjherne@us.ibm.com> <51B3ABEA.6000503@suse.de> In-Reply-To: <51B3ABEA.6000503@suse.de> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH 5/8] [PATCH RFC v2] s390-qemu: cpu hotplug - Introduce post-cpu-init function 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 06:10 PM, Andreas Färber wrote: > Am 07.06.2013 19:28, schrieb Jason J. Herne: >> From: "Jason J. Herne" >> >> In preparation for treating cpus as devices > > CPUs *are* devices since multiple releases now, so this is badly put. > >> we need to separate machine >> initialization into two stages: >> 1. Initialization that needs to be done before cpu devices can be created. >> 2. Initialization that requires cpu devices to already be created. >> >> This is accomplished by creating an optional post-cpu initialization function >> for QEMUMachine. > > Whatever you are using it for, this sounds wrong to me. > The QEMUMachine->init() function (at least for S390) currently handles several tasks. One of those tasks is the creation of cpus. If we are switching to a new paradigm where QOM cpu devices are parsed and created in main() then QEMUMachine->init() will happen either before or after cpus are created. This change is meant to split QEMUMachine->init() into two parts 1. Stuff that does not depend on cpu creation. Specifically, stuff that might be a dependency of cpu create, like allocating ipi_states. 2. Stuff that does depend on cpu creation. Like vm_s390_enable_css_support() which requires CPU 0 to exist. > Machine init is supposed to use less code and more QOM infrastructure, > with a future goal of replacing most code with a config file > instantiating and wiring up devices. > Duly noted. I can have another look at the code. Perhaps there is an easy place I can move the ipi_state initialization. Also, perhaps there is a way to remove the cpu-0 dependency from vm_s390_enable_css_support(). Both of these changes would remove the need for the post_cpu_init function. > And please don't forget to CC me on the next CPU series. > Sorry. I had meant to CC you originally. -- -- Jason J. Herne (jjherne@linux.vnet.ibm.com)