Skip to contentSkip to conversation

target/ppc/cpu-models: set POWER9_v1.0 as POWER9 DD1

RFC Superseded Laurent Vivier 2 participants 3 messages Jul 3, 2017

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v2 cover target/ppc/cpu-models: set POWER9_v1.0 as POWER9 DD1

This patch allows to use "-cpu POWER9" with a POWER9 DD1 host and KVM HV. With TCG, "-cpu POWER9" selects POWER9_v2.0 (POWER9 DD2).

I post this patch as a RFC because kernel boots well with "-cpu host", but hangs with "-cpu POWER9" whereas I can see it selects correctly the POWER9_v1.0 CPU in both cases.

Laurent Vivier (1):
target/ppc/cpu-models: set POWER9_v1.0 as POWER9 DD1

 hw/ppc/spapr_cpu_core.c | 5 ++++-
 target/ppc/cpu-models.c | 6 ++++--
 target/ppc/cpu-models.h | 1 +
 3 files changed, 9 insertions(+), 3 deletions(-)
Signature · 1 line
2.9.4
#1 lore raw

RFC v2 1/1 target/ppc/cpu-models: set POWER9_v1.0 as POWER9 DD1

CPU_POWERPC_POWER9_DD1 is 0x004E0100, so this is the POWER9 v1.0.

When we run qemu on a POWER9 DD1 host, we must use either "-cpu host" or "-cpu POWER9", but in the latter case it fails with

Unable to find sPAPR CPU Core definition

because POWER9 DD1 doesn't appear in the list of known CPUs.

This patch fixes this by defining POWER9_v1.0 with POWER9 DD1 PVR instead of CPU_POWERPC_POWER9_BASE. It also adds POWER_v2.0 with POWER9 DD2 PVR to avoid to trigger kernel POWER9 DD1 workaround in TCG mode.

---
 hw/ppc/spapr_cpu_core.c | 5 ++++-
 target/ppc/cpu-models.c | 6 ++++--
 target/ppc/cpu-models.h | 1 +
 3 files changed, 9 insertions(+), 3 deletions(-)
hw/ppc/spapr_cpu_core.c +4 -1
index 9fb896b..00918a5 100644
@@ -249,8 +249,11 @@ static const char *spapr_core_models[] = {
     /* POWER8NVL */
     "POWER8NVL_v1.0",
 
-    /* POWER9 */
+    /* POWER9 DD1 */
     "POWER9_v1.0",
+
+    /* POWER9 DD2 */
+    "POWER9_v2.0",
 };
 
 static Property spapr_cpu_core_properties[] = {
target/ppc/cpu-models.c +4 -2
index 4d3e635..ac7e299 100644
@@ -1144,8 +1144,10 @@
     POWERPC_DEF("970_v2.2",      CPU_POWERPC_970_v22,                970,
                 "PowerPC 970 v2.2")
 
-    POWERPC_DEF("POWER9_v1.0",   CPU_POWERPC_POWER9_BASE,            POWER9,
+    POWERPC_DEF("POWER9_v1.0",   CPU_POWERPC_POWER9_DD1,             POWER9,
                 "POWER9 v1.0")
+    POWERPC_DEF("POWER9_v2.0",   CPU_POWERPC_POWER9_DD2,             POWER9,
+                "POWER9 v2.0")
 
     POWERPC_DEF("970fx_v1.0",    CPU_POWERPC_970FX_v10,              970,
                 "PowerPC 970FX v1.0 (G5)")
@@ -1391,7 +1393,7 @@ PowerPCCPUAlias ppc_cpu_aliases[] = {
     { "POWER8E", "POWER8E_v2.1" },
     { "POWER8", "POWER8_v2.0" },
     { "POWER8NVL", "POWER8NVL_v1.0" },
-    { "POWER9", "POWER9_v1.0" },
+    { "POWER9", "POWER9_v2.0" },
     { "970", "970_v2.2" },
     { "970fx", "970fx_v3.1" },
     { "970mp", "970mp_v1.1" },
target/ppc/cpu-models.h +1 -0
index b563c45..25045bd 100644
@@ -562,6 +562,7 @@ enum {
     CPU_POWERPC_POWER8NVL_v10      = 0x004C0100,
     CPU_POWERPC_POWER9_BASE        = 0x004E0000,
     CPU_POWERPC_POWER9_DD1         = 0x004E0100,
+    CPU_POWERPC_POWER9_DD2         = 0x004E1200,
     CPU_POWERPC_970_v22            = 0x00390202,
     CPU_POWERPC_970FX_v10          = 0x00391100,
     CPU_POWERPC_970FX_v20          = 0x003C0200,
Signature · 1 line
2.9.4
#2 lore raw
Quoted 26 lines · Laurent Vivier

CPU_POWERPC_POWER9_DD1 is 0x004E0100, so this is the POWER9 v1.0.

When we run qemu on a POWER9 DD1 host, we must use either "-cpu host" or "-cpu POWER9", but in the latter case it fails with

Unable to find sPAPR CPU Core definition

because POWER9 DD1 doesn't appear in the list of known CPUs.

This patch fixes this by defining POWER9_v1.0 with POWER9 DD1 PVR instead of CPU_POWERPC_POWER9_BASE. It also adds POWER_v2.0 with POWER9 DD2 PVR to avoid to trigger kernel POWER9 DD1 workaround in TCG mode.

---
 hw/ppc/spapr_cpu_core.c | 5 ++++-
 target/ppc/cpu-models.c | 6 ++++--
 target/ppc/cpu-models.h | 1 +
 3 files changed, 9 insertions(+), 3 deletions(-)
hw/ppc/spapr_cpu_core.c +0 -0
index 9fb896b..00918a5 100644

hw/ppc/spapr_cpu_core.c static const char *spapr_core_models[] = { · line 257

Quoted 10 lines
hw/ppc/spapr_cpu_core.c +4 -1
@@ -249,8 +249,11 @@ static const char *spapr_core_models[] = {
     /* POWER8NVL */
     "POWER8NVL_v1.0",
 
-    /* POWER9 */
+    /* POWER9 DD1 */
     "POWER9_v1.0",
+
+    /* POWER9 DD2 */
+    "POWER9_v2.0",
 };

Cosmetical nit: Do we really need two comments for this? I'd maybe list both entries below a "/* POWER9 */" comment instead (similar to the "/* 970MP variants */" section in that file).

Apart from that, the patch looks good to me.

Thomas