From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55803) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V8lEI-0006eh-8o for qemu-devel@nongnu.org; Mon, 12 Aug 2013 02:03:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V8lEC-0004FE-8o for qemu-devel@nongnu.org; Mon, 12 Aug 2013 02:03:46 -0400 Message-ID: <1376287404.32100.153.camel@pasglop> From: Benjamin Herrenschmidt Date: Mon, 12 Aug 2013 16:03:24 +1000 In-Reply-To: <5208669A.7010000@linux.vnet.ibm.com> References: <20130808125106.6b29a78c@zephyr> <20130808125629.4e5f435d@zephyr> <5203743D.6060009@suse.de> <5208669A.7010000@linux.vnet.ibm.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH 2/2] [v3] target-ppc: Enhance CPU nodes of device tree to be PAPR compliant. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Prerna Saxena Cc: Alexey Kardashevisky , qemu-ppc , Andreas =?ISO-8859-1?Q?F=E4rber?= , Anthony Liguori , QEMU On Mon, 2013-08-12 at 10:07 +0530, Prerna Saxena wrote: .../... > I dont know what context lead to this observation. > However, PAPR mentions the following nomenclature guideline: >=20 > "The value of this property shall be of the form: =E2=80=9CPowerPC,=E2=80=9D, > where is the name of the processor chip which may be displayed t= o > the user. shall not contain underscores." This actually comes from the original Open Firmware binding for PowerPC processors, which PAPR inherits largely from. Thus this naming scheme should apply to all PowerPC processors when a device-tree is involved. > I think this name guideline will hold good for all PAPR compliant > processors. Also PAPR is not a processor architecture, it's a platform and firmware architecture, so "PAPR-compliant CPU" has little meaning :-) Cheers, Ben. > >=20 > >> @@ -1315,6 +1325,14 @@ static void ppc_spapr_init(QEMUMachineInitArg= s *args) > >> =20 > >> cpu_model =3D g_strndup(parent_name, > >> strlen(parent_name) - strlen("-" TYPE_POWERPC_CPU)); > >> + > >> + for (i =3D 0; ppc_cpu_aliases[i].model !=3D NULL; i++) { > >> + if (strcmp(ppc_cpu_aliases[i].model, cpu_model) =3D=3D = 0) { > >> + g_free(cpu_model); > >> + cpu_model =3D g_strndup(ppc_cpu_aliases[i].alias, > >> + strlen(ppc_cpu_aliases[i].alias)); > >> + } > >> + } > >> } > >> =20 > >> /* Prepare the device tree */ > >=20 > > This is still fixing up the name in the wrong place: -cpu POWER7_v2.3 > > will not get fixed, only -cpu host or KVM's default. > >=20 > > The solution I had discussed with Alex is the following: When devices > > need to expose their name to firmware in a special way, we have the > > DeviceClass::fw_name field. All we have to do is assign it and use it > > instead of cpu_model if non-NULL, just like we assign DeviceClass::de= sc. > > The way to do it would be to extend the family of POWERPC_DEF* macros= to > > specify the additional field on the relevant CPU models. > >=20 >=20 > Would this be the same use-case as reflected by: ppc_cpu_aliases.alias = ? > If so, do we really need a separate field to convey the same informatio= n ? >=20 > > Therefore my above question: Would it be sufficient to explicitly nam= e > > POWER7_v2.3 PowerPC,POWER7 etc. and to drop the upper-casing? > > Or would we also need to name a CPU such as MPC8572E (random Freescal= e > > CPU where I don't know the expected fw_name and that is unlikely to > > occur/work in sPAPR) "PowerPC,MPC8572E" if someone specified it with > > -cpu MPC8572E? > >=20 >=20 > If this is not a PAPR-compliant CPU, I dont think the PAPR naming > convention is of any good. > I havent worked with non-PAPR cpus. Is the device tree for such CPUs > generated by routines in hw/ppc/spapr.c ? Or do they have custom > routines to generate appropriate device tree nodes ? >=20 > Regards,