From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34916) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UlRxh-0001Pm-Tv for qemu-devel@nongnu.org; Sat, 08 Jun 2013 18:50:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UlRxg-0007pN-VP for qemu-devel@nongnu.org; Sat, 08 Jun 2013 18:50:17 -0400 Received: from cantor2.suse.de ([195.135.220.15]:45812 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UlRxg-0007pJ-Ls for qemu-devel@nongnu.org; Sat, 08 Jun 2013 18:50:16 -0400 Message-ID: <51B3B522.5060301@suse.de> Date: Sun, 09 Jun 2013 00:50:10 +0200 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1370626087-840-1-git-send-email-jjherne@us.ibm.com> <1370626087-840-8-git-send-email-jjherne@us.ibm.com> In-Reply-To: <1370626087-840-8-git-send-email-jjherne@us.ibm.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 7/8] [PATCH RFC v2] s390-qemu: cpu hotplug - Infrastructure for Cpu Devices List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Jason J. Herne" Cc: ehabkost@redhat.com, qemu-devel@nongnu.org, agraf@suse.de, borntraeger@de.ibm.com, jfrei@linux.vnet.ibm.com, imammedo@redhat.com Hi, Am 07.06.2013 19:28, schrieb Jason J. Herne: > From: "Jason J. Herne" >=20 > Add infrastructure for treating cpus as devices. This patch allows cpus= to be > specified using a combination of '-smp' and '-device cpu'. This approa= ch > forces a change in the way cpus are counted via smp_cpus. >=20 > Signed-off-by: Jason J. Herne > --- > include/hw/boards.h | 3 ++ > vl.c | 95 +++++++++++++++++++++++++++++++++++++++++++= -------- > 2 files changed, 84 insertions(+), 14 deletions(-) This feels like an ugly hack. And nack to CPUS_ARE_DEVICES(), since all CPUs are devices already. Could you please give a bit more rationale for each change? What's the intended use case here? This is not just an s390 change but a design question, so again please CC me as CPU maintainer. There's a number of questions that your series touches on but doesn't discuss the concept in the cover letter or in the commit messages: 1) Mixing -smp N and -device s390-cpu I would expect to get N+1 CPUs. Do you agree or disagree? -smp 0 is probably not well tested, if at all, so why specify -device s390-cpu on the command line at all? Of course if there's bugs I'll be happy to accept fixes, but I'm seeing device_add as more relevant than -device honestly. 2) QEMUMachine::max_cpus I believe -device s390-cpu should honor the limit, do you agree? If so, then there's no need to iterate over -device options, because that'll miss hot-added devices, but instead move any checks to the CPU's realize function. If a user creates more CPUs than qom/cpu.c:cpu_common_realizefn() should be made to fail. Note that my upcoming CPUState series moves qemu_init_vcpu() there, so we will be able to bail out before creating vCPU threads etc. for that CPU. 3) vCPU initialization hooks We already have a QEMUMachine::hot_add_cpu hook. If you need additional hooks, I'd like to first understand why that cannot go into S390CPU's realize function, and then we can think about a more generic solution like adding a Notifier that anyone can use. Regards, Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg