From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51591) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ulxzg-0000PI-Fj for qemu-devel@nongnu.org; Mon, 10 Jun 2013 05:02:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ulxza-0002fn-VP for qemu-devel@nongnu.org; Mon, 10 Jun 2013 05:02:28 -0400 Received: from e06smtp12.uk.ibm.com ([195.75.94.108]:49126) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ulxza-0002fL-Ml for qemu-devel@nongnu.org; Mon, 10 Jun 2013 05:02:22 -0400 Received: from /spool/local by e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 10 Jun 2013 09:57:47 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 3E8FC1B08023 for ; Mon, 10 Jun 2013 10:02:18 +0100 (BST) Received: from d06av04.portsmouth.uk.ibm.com (d06av04.portsmouth.uk.ibm.com [9.149.37.216]) by b06cxnps4074.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r5A927p954132822 for ; Mon, 10 Jun 2013 09:02:07 GMT Received: from d06av04.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av04.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id r5A92H2a002060 for ; Mon, 10 Jun 2013 03:02:17 -0600 Date: Mon, 10 Jun 2013 11:02:15 +0200 From: Cornelia Huck Message-ID: <20130610110215.3c2cee88@gondolin> In-Reply-To: <51B3D647.6090400@suse.de> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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: Andreas =?UTF-8?B?RsOkcmJlcg==?= Cc: agraf@suse.de, ehabkost@redhat.com, qemu-devel@nongnu.org, "Jason J. Herne" , borntraeger@de.ibm.com, jfrei@linux.vnet.ibm.com, imammedo@redhat.com On Sun, 09 Jun 2013 03:11:35 +0200 Andreas F=C3=A4rber wrote: > Am 07.06.2013 19:28, schrieb Jason J. Herne: > > From: "Jason J. Herne" > >=20 > > Modify cpu initialization and QOM routines associated with s390-cpu suc= h that > > all cpus on S390 are now created via the QOM device creation code path. > >=20 > > Signed-off-by: Jason J. Herne > > --- > > hw/s390x/s390-virtio-ccw.c | 15 ++++++++++----- > > hw/s390x/s390-virtio.c | 25 +++++-------------------- > > hw/s390x/s390-virtio.h | 2 +- > > include/qapi/qmp/qerror.h | 3 +++ > > qdev-monitor.c | 17 +++++++++++++++++ > > target-s390x/cpu.c | 24 ++++++++++++++++++++++-- > > 6 files changed, 58 insertions(+), 28 deletions(-) > >=20 > > diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c > > index 70bd858..141adce 100644 > > --- a/hw/s390x/s390-virtio-ccw.c > > +++ b/hw/s390x/s390-virtio-ccw.c > > @@ -95,12 +95,8 @@ static void ccw_init(QEMUMachineInitArgs *args) > > /* allocate storage keys */ > > s390_set_storage_keys_p(g_malloc0(my_ram_size / TARGET_PAGE_SIZE)); > > =20 > > - /* init CPUs */ > > - s390_init_cpus(args->cpu_model); > > + s390_init_ipi_states(); > > =20 > > - if (kvm_enabled()) { > > - kvm_s390_enable_css_support(s390_cpu_addr2state(0)); > > - } > > /* > > * Create virtual css and set it as default so that non mcss-e > > * enabled guests only see virtio devices. > > @@ -112,11 +108,20 @@ static void ccw_init(QEMUMachineInitArgs *args) > > s390_create_virtio_net(BUS(css_bus), "virtio-net-ccw"); > > } > > =20 > > +static void ccw_post_cpu_init(void) > > +{ > > + if (kvm_enabled()) { > > + kvm_s390_enable_css_support(s390_cpu_addr2state(0)); > > + } > > +} >=20 > Am I understanding correctly that all this is about differentiating one > call between the ccw and legacy machines? >=20 > Isn't there a machine-init-done Notifier that the ccw machine init could > register for? I wasn't aware of that, but it looks worth a try. >=20 > What if CPU 0 were hot-unplugged? Would the capability need to be > re-enabled or will this remain a one-time task? KVM_ENABLE_CAP is a vcpu ioctl, but we use it to enable a machine-wide capability (which will stay enabled during the lifetime of the machine). (It probably should be "any cpu" instead of "cpu 0", but that's probably not the only place doing that.)