ppc/pnv: Add support for the POWER10 DD2 CPU
cover ppc/pnv: Add support for the POWER10 DD2 CPU
Hello,
The POWER10 DD2 CPU adds an extra LPCR[HAIL] bit which is a requirement to support the scv instruction on PowerNV POWER10 platforms (glibc-2.33).
These changes add a POWER10 DD2 CPU and switch the default chip model of the powernv10 machine to use this CPU. This to make sure that the machine can boot the latest distros.
Thanks,
C.
Cédric Le Goater (2):
ppc: Add a POWER10 DD2 CPU
ppc/pnv: Add support for the POWER10 DD2 CPU
include/hw/ppc/pnv.h | 2 +- target/ppc/cpu-models.h | 1 + hw/ppc/pnv.c | 2 +- hw/ppc/pnv_core.c | 2 +- target/ppc/cpu-models.c | 4 +++- target/ppc/translate_init.c.inc | 2 +- 6 files changed, 8 insertions(+), 5 deletions(-)
Signature · 1 line
2.26.3
PATCH 1/2 ppc: Add a POWER10 DD2 CPU
The POWER10 DD2 CPU adds an extra LPCR[HAIL] bit. The required change of the LPCR mask impacts all the POWER10 family. It is incorrect for DD1 but it does not break the modeling.
Setting the HAIL bit is a requirement to support the scv instruction on PowerNV POWER10 platforms since glibc-2.33.
--- target/ppc/cpu-models.h | 1 + target/ppc/cpu-models.c | 4 +++- target/ppc/translate_init.c.inc | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-)
target/ppc/cpu-models.h +1 -0
@@ -375,6 +375,7 @@ enum {CPU_POWERPC_POWER9_DD20 =0x004E1200 ,CPU_POWERPC_POWER10_BASE =0x00800000 ,CPU_POWERPC_POWER10_DD1 =0x00800100 , +CPU_POWERPC_POWER10_DD20 =0x00800200 , CPU_POWERPC_970_v22 =0x00390202 , CPU_POWERPC_970FX_v10 =0x00391100 , CPU_POWERPC_970FX_v20 = 0x003C0200,
target/ppc/cpu-models.c +3 -1
@@ -776,6 +776,8 @@ "POWER9 v2.0") POWERPC_DEF("power10_v1.0", CPU_POWERPC_POWER10_DD1, POWER10, "POWER10 v1.0") + POWERPC_DEF("power10_v2.0", CPU_POWERPC_POWER10_DD20, POWER10, + "POWER10 v2.0")#endif /* defined (TARGET_PPC64) */ /***************************************************************************/
@@ -952,7 +954,7 @@ PowerPCCPUAlias ppc_cpu_aliases[] = { { "power8", "power8_v2.0" }, { "power8nvl", "power8nvl_v1.0" }, { "power9", "power9_v2.0" }, - { "power10", "power10_v1.0" }, + { "power10", "power10_v2.0" }, #endif /* Generic PowerPCs */
target/ppc/translate_init.c.inc +1 -1
@@ -9302,7 +9302,7 @@ POWERPC_FAMILY(POWER10)(ObjectClass *oc, void *data) (1ull << MSR_RI) | (1ull << MSR_LE); pcc->lpcr_mask = LPCR_VPM1 | LPCR_ISL | LPCR_KBV | LPCR_DPFD | - (LPCR_PECE_U_MASK & LPCR_HVEE) | LPCR_ILE | LPCR_AIL | + (LPCR_PECE_U_MASK & LPCR_HVEE) | LPCR_ILE | LPCR_HAIL | LPCR_AIL | LPCR_UPRT | LPCR_EVIRT | LPCR_ONL | LPCR_HR | LPCR_LD | (LPCR_PECE_L_MASK & (LPCR_PDEE | LPCR_HDEE | LPCR_EEE | LPCR_DEE | LPCR_OEE))
Signature · 1 line
2.26.3
PATCH 2/2 ppc/pnv: Add support for the POWER10 DD2 CPU
In reply to Cédric Le GoaterThe chip model of the powernv10 machine now uses the latest POWER10 DD2 CPU. The DD1 chip model is undefined and considered invalid.
--- include/hw/ppc/pnv.h | 2 +- hw/ppc/pnv.c | 2 +- hw/ppc/pnv_core.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
include/hw/ppc/pnv.h +1 -1
@@ -170,7 +170,7 @@ DECLARE_INSTANCE_CHECKER(PnvChip, PNV_CHIP_POWER8NVL,DECLARE_INSTANCE_CHECKER (PnvChip,PNV_CHIP_POWER9 , TYPE_PNV_CHIP_POWER9) -#define TYPE_PNV_CHIP_POWER10 PNV_CHIP_TYPE_NAME("power10_v1.0") +#define TYPE_PNV_CHIP_POWER10 PNV_CHIP_TYPE_NAME("power10_v2.0")DECLARE_INSTANCE_CHECKER (PnvChip,PNV_CHIP_POWER10 ,TYPE_PNV_CHIP_POWER10 )
hw/ppc/pnv.c +1 -1
@@ -1919,7 +1919,7 @@ static void pnv_machine_power10_class_init(ObjectClass *oc, void *data)static const char compat[] ="qemu,powernv10\0ibm,powernv" ; mc->desc ="IBM PowerNV (Non-Virtualized) POWER10" ; - mc->default_cpu_type =POWERPC_CPU_TYPE_NAME ("power10_v1.0" ); + mc->default_cpu_type =POWERPC_CPU_TYPE_NAME ("power10_v2.0" ); pmc->compat = compat; pmc->compat_size =sizeof (compat);
hw/ppc/pnv_core.c +1 -1
@@ -346,7 +346,7 @@ static const TypeInfo pnv_core_infos[] = {DEFINE_PNV_CORE_TYPE (power8,"power8_v2.0" ),DEFINE_PNV_CORE_TYPE (power8,"power8nvl_v1.0" ),DEFINE_PNV_CORE_TYPE (power9,"power9_v2.0" ), -DEFINE_PNV_CORE_TYPE (power10,"power10_v1.0" ), +DEFINE_PNV_CORE_TYPE (power10,"power10_v2.0" ), };DEFINE_TYPES (pnv_core_infos)
Signature · 1 line
2.26.3
Quoted 8 lines · Cédric Le Goater
Hello,
The POWER10 DD2 CPU adds an extra LPCR[HAIL] bit which is a requirement to support the scv instruction on PowerNV POWER10 platforms (glibc-2.33).
These changes add a POWER10 DD2 CPU and switch the default chip model of the powernv10 machine to use this CPU. This to make sure that the machine can boot the latest distros.
LGTM as far as it goes. Couple of points
* I'd prefer to combine the two patches together, basically atomically replacing DD1 with DD2
* I'd like to sort out the DAWR1 support first, or at the same time. I think it's reasonable to treat anything about POWER10 emulation as experimental and unstable until we put an actually publically available chip in there. If we sort out DAWR1 support now, it means we can avoid having another spapr capability flag to handle the case of qemu versions that support DD2, but not DAWR1.
Signature · 4 lines
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