From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33305) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aXlCv-0008BT-0A for qemu-devel@nongnu.org; Mon, 22 Feb 2016 02:47:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aXlCt-0004OO-RE for qemu-devel@nongnu.org; Mon, 22 Feb 2016 02:47:00 -0500 Received: from ozlabs.org ([2401:3900:2:1::2]:50407) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aXlCs-0004O3-QY for qemu-devel@nongnu.org; Mon, 22 Feb 2016 02:46:59 -0500 Date: Mon, 22 Feb 2016 18:47:58 +1100 From: David Gibson Message-ID: <20160222074758.GJ2808@voom.fritz.box> References: <1456117285-22273-1-git-send-email-bharata@linux.vnet.ibm.com> <1456117285-22273-5-git-send-email-bharata@linux.vnet.ibm.com> <56CAAE58.3060705@suse.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="HSQ3hISbU3Um6hch" Content-Disposition: inline In-Reply-To: <56CAAE58.3060705@suse.de> Subject: Re: [Qemu-devel] [RFC PATCH v0 4/8] spapr: Introduce CPU core device List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andreas =?iso-8859-1?Q?F=E4rber?= Cc: ehabkost@redhat.com, aik@ozlabs.ru, armbru@redhat.com, Bharata B Rao , agraf@suse.de, qemu-devel@nongnu.org, pbonzini@redhat.com, imammedo@redhat.com --HSQ3hISbU3Um6hch Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 22, 2016 at 07:44:40AM +0100, Andreas F=E4rber wrote: > Am 22.02.2016 um 06:01 schrieb Bharata B Rao: > > sPAPR CPU core device is a container of CPU thread devices. CPU hotplug= is > > performed in the granularity of CPU core device by setting the "realize= d" > > property of this device to "true". When hotplugged, CPU core creates CPU > > thread devices. > >=20 > > TODO: Right now allows for only homogeneous configurations as we depend > > on global smp_threads and machine->cpu_model. > >=20 > > Signed-off-by: Bharata B Rao > > --- > > hw/ppc/Makefile.objs | 1 + > > hw/ppc/spapr_cpu_package.c | 50 ++++++++++++++++++++++++++++++= ++++++++ > > include/hw/ppc/spapr_cpu_package.h | 26 ++++++++++++++++++++ > > 3 files changed, 77 insertions(+) > > create mode 100644 hw/ppc/spapr_cpu_package.c > > create mode 100644 include/hw/ppc/spapr_cpu_package.h > >=20 > > diff --git a/hw/ppc/Makefile.objs b/hw/ppc/Makefile.objs > > index c1ffc77..3000982 100644 > > --- a/hw/ppc/Makefile.objs > > +++ b/hw/ppc/Makefile.objs > > @@ -4,6 +4,7 @@ obj-y +=3D ppc.o ppc_booke.o > > obj-$(CONFIG_PSERIES) +=3D spapr.o spapr_vio.o spapr_events.o > > obj-$(CONFIG_PSERIES) +=3D spapr_hcall.o spapr_iommu.o spapr_rtas.o > > obj-$(CONFIG_PSERIES) +=3D spapr_pci.o spapr_rtc.o spapr_drc.o spapr_r= ng.o > > +obj-$(CONFIG_PSERIES) +=3D spapr_cpu_package.o > > ifeq ($(CONFIG_PCI)$(CONFIG_PSERIES)$(CONFIG_LINUX), yyy) > > obj-y +=3D spapr_pci_vfio.o > > endif > > diff --git a/hw/ppc/spapr_cpu_package.c b/hw/ppc/spapr_cpu_package.c > > new file mode 100644 > > index 0000000..3120a16 > > --- /dev/null > > +++ b/hw/ppc/spapr_cpu_package.c > > @@ -0,0 +1,50 @@ > > +/* > > + * sPAPR CPU package device, acts as container of CPU thread devices. > > + * > > + * Copyright (C) 2016 Bharata B Rao > > + * > > + * This work is licensed under the terms of the GNU GPL, version 2 or = later. > > + * See the COPYING file in the top-level directory. > > + */ > > +#include "hw/cpu/package.h" > > +#include "hw/ppc/spapr_cpu_package.h" > > +#include "hw/boards.h" > > +#include > > +#include "qemu/error-report.h" > > + > > +static void spapr_cpu_package_instance_init(Object *obj) > > +{ > > + int i; > > + CPUState *cpu; > > + MachineState *machine =3D MACHINE(qdev_get_machine()); > > + sPAPRCPUPackage *package =3D SPAPR_CPU_PACKAGE(obj); > > + > > + /* Create as many CPU threads as specified in the topology */ > > + for (i =3D 0; i < smp_threads; i++) { > > + cpu =3D cpu_generic_init(machine->cpu_type, machine->cpu_model= ); >=20 > No, no, no. This is horribly violating QOM design. Ok.. why? There does not, to me, seem to be any remotely easily discoverable means of finding out what QOM design principles are. It also would have been nice if you weighed in on my RFC this code is based on. > Please compare the x86 RFC. Where do I find this? =46rom all I could tell there just seemed to be a lot of spinning of wheels on the cpu hotplug stuff, which is why I made the cpu-packages proposal to try and move things forward. There's been a lot of "don't do it like that" but precious little "here's how you _should_ do it" that actually addresses the needs of the various platforms. --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --HSQ3hISbU3Um6hch Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJWyr0uAAoJEGw4ysog2bOS5ysQAJAQ9lyr48pRRHysyJuXMlg0 zJG8NSCJmF+XndZa6IxXpEtJ0/ced/QJfD8NjZxwf9tQVw2txDJaX+I7aKARiIFA 6xeTVbFab8ml25uyI9ApEm5zliZPISw+sr4nHK2pm/U9+Fowupumvy8ncE/pjWZR tfChFVg6Dmj2HaWoqdBZvC4PJ+oDngkexhIMNbs0OnyiBaTVn+zblQ00MmBaKyks gCIp4lhyxUxJb13LCt0nrG/FFkVlu708sW5tznyEzoPJdtjy+HWlyiJY8+MdmG22 0LdYihWK+MCodmU2PI5+diGVb7XfnaHzIbP1JXqQROhR4khk9dMjx8KDoL1RoVGu LCEKie6sYGv3Vml25iT5GBR/78YoVy3sA4gOeGw+nTxnG0hl+/vMdhEeZjeX6kdG zHQAUS0I1JW79tTzg8cNAgKVvCtRd7ypsbqYrppHfvcBXlurHq4NBMKpxEfOF2q1 zjxJ6TPxdhigMMzSh+Lobs4KK15yWmeMuMHZHLvwnJ9245uZ76kHuaFUDV6S+YXg 98gUz+hVLRZ5Eh6qjAW274oXmyJzYvV2DkSOQnv1VqZt+xeKWS7LUJJfUe91ErP4 Ey8dlEJWBf7Cn7ShWyjBP60nDcJTXgxhHWSUAVSOd+JyWsoGXRUgOhI8PvFs2NtT k4eQXlzasz1wH1qdJ6WF =1eXk -----END PGP SIGNATURE----- --HSQ3hISbU3Um6hch--