From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40652) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V7KgB-0003nO-LR for qemu-devel@nongnu.org; Thu, 08 Aug 2013 03:30:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V7Kg3-0001Rg-HA for qemu-devel@nongnu.org; Thu, 08 Aug 2013 03:30:39 -0400 Received: from e28smtp04.in.ibm.com ([122.248.162.4]:42030) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V7Kg2-0001RA-NX for qemu-devel@nongnu.org; Thu, 08 Aug 2013 03:30:31 -0400 Received: from /spool/local by e28smtp04.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 8 Aug 2013 12:52:51 +0530 Date: Thu, 8 Aug 2013 12:54:55 +0530 From: Prerna Saxena Message-ID: <20130808125455.2ba5a8b4@zephyr> In-Reply-To: <20130808125106.6b29a78c@zephyr> References: <20130808125106.6b29a78c@zephyr> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH 1/2] [v3] target-ppc: Get CPU name to correct reflect its model in the SLOF device tree. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Prerna Saxena Cc: Alexey Kardashevisky , Alexander Graf , QEMU , sPAPR , Anthony Liguori , Andreas =?UTF-8?B?RsOkcmJlcg==?= From: Andreas Farber Date: Wed, 7 Aug 2013 14:50:41 +0530 Subject: [PATCH 1/2] By default on KVM or when user asks for it via -cpu host, cpu_model will be "host" and sPAPR merely upper-cases it for the SLOF device tree. Change it so that we get the underlying CPU type, e.g., "POWER7_V2.3@0". Tested-by: Prerna Saxena Signed-off-by: Andreas F=C3=A4rber --- hw/ppc/spapr.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 16bfab9..59e2fea 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -1072,7 +1072,7 @@ static void ppc_spapr_init(QEMUMachineInitArgs *args) const char *kernel_cmdline =3D args->kernel_cmdline; const char *initrd_filename =3D args->initrd_filename; const char *boot_device =3D args->boot_device; - PowerPCCPU *cpu; + PowerPCCPU *cpu =3D NULL; CPUPPCState *env; PCIHostState *phb; int i; @@ -1307,6 +1307,16 @@ static void ppc_spapr_init(QEMUMachineInitArgs *args) register_savevm_live(NULL, "spapr/htab", -1, 1, &savevm_htab_handlers, spapr); =20 + if (kvm_enabled() && strcmp(cpu_model, "host") =3D=3D 0) { + ObjectClass *cpu_class =3D object_get_class(OBJECT(cpu)); + ObjectClass *parent_cpu_class =3D object_class_get_parent(cpu_clas= s); + + const char *parent_name =3D object_class_get_name(parent_cpu_class= ); + + cpu_model =3D g_strndup(parent_name, + strlen(parent_name) - strlen("-" TYPE_POWERPC_CPU)); + } + /* Prepare the device tree */ spapr->fdt_skel =3D spapr_create_fdt_skel(cpu_model, initrd_base, initrd_size, --=20 1.7.11.4 --=20 Prerna Saxena Linux Technology Centre, IBM Systems and Technology Lab, Bangalore, India