[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH 1/2] [v3] target-ppc: Get CPU name to correct reflect
From: |
Prerna Saxena |
Subject: |
[Qemu-ppc] [PATCH 1/2] [v3] target-ppc: Get CPU name to correct reflect its model in the SLOF device tree. |
Date: |
Thu, 8 Aug 2013 12:54:55 +0530 |
From: Andreas Farber <address@hidden>
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., "address@hidden".
Tested-by: Prerna Saxena <address@hidden>
Signed-off-by: Andreas Färber <address@hidden>
---
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 = args->kernel_cmdline;
const char *initrd_filename = args->initrd_filename;
const char *boot_device = args->boot_device;
- PowerPCCPU *cpu;
+ PowerPCCPU *cpu = 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);
+ if (kvm_enabled() && strcmp(cpu_model, "host") == 0) {
+ ObjectClass *cpu_class = object_get_class(OBJECT(cpu));
+ ObjectClass *parent_cpu_class = object_class_get_parent(cpu_class);
+
+ const char *parent_name = object_class_get_name(parent_cpu_class);
+
+ cpu_model = g_strndup(parent_name,
+ strlen(parent_name) - strlen("-" TYPE_POWERPC_CPU));
+ }
+
/* Prepare the device tree */
spapr->fdt_skel = spapr_create_fdt_skel(cpu_model,
initrd_base, initrd_size,
--
1.7.11.4
--
Prerna Saxena
Linux Technology Centre,
IBM Systems and Technology Lab,
Bangalore, India
- [Qemu-ppc] [PATCH 0/2] [v3] target-ppc: Enhance CPU nodes of SPAPR-generated device tree, Prerna Saxena, 2013/08/08
- [Qemu-ppc] [PATCH 1/2] [v3] target-ppc: Get CPU name to correct reflect its model in the SLOF device tree.,
Prerna Saxena <=
- [Qemu-ppc] [PATCH 2/2] [v3] target-ppc: Enhance CPU nodes of device tree to be PAPR compliant., Prerna Saxena, 2013/08/08
- Re: [Qemu-ppc] [PATCH 2/2] [v3] target-ppc: Enhance CPU nodes of device tree to be PAPR compliant., Andreas Färber, 2013/08/08
- Re: [Qemu-ppc] [PATCH 2/2] [v3] target-ppc: Enhance CPU nodes of device tree to be PAPR compliant., Prerna Saxena, 2013/08/12
- Re: [Qemu-ppc] [PATCH 2/2] [v3] target-ppc: Enhance CPU nodes of device tree to be PAPR compliant., Benjamin Herrenschmidt, 2013/08/12
- Re: [Qemu-ppc] [Qemu-devel] [PATCH 2/2] [v3] target-ppc: Enhance CPU nodes of device tree to be PAPR compliant., Thomas Huth, 2013/08/12
- Re: [Qemu-ppc] [Qemu-devel] [PATCH 2/2] [v3] target-ppc: Enhance CPU nodes of device tree to be PAPR compliant., Benjamin Herrenschmidt, 2013/08/12
- Re: [Qemu-ppc] [Qemu-devel] [PATCH 2/2] [v3] target-ppc: Enhance CPU nodes of device tree to be PAPR compliant., Alexander Graf, 2013/08/14
- Re: [Qemu-ppc] [Qemu-devel] [PATCH 2/2] [v3] target-ppc: Enhance CPU nodes of device tree to be PAPR compliant., Andreas Färber, 2013/08/14
- Re: [Qemu-ppc] [Qemu-devel] [PATCH 2/2] [v3] target-ppc: Enhance CPU nodes of device tree to be PAPR compliant., Andreas Färber, 2013/08/14