Power11 support for QEMU
v4 cover Power11 support for QEMU
Overview
============
Add support for Power11 pseries and powernv machine types, to emulate VMs running on Power11.
As Power11 core is same as Power10, hence much of the code has been reused from Power10.
Power11 was added in Linux in:
commit c2ed087ed35c ("powerpc: Add Power11 architected and raw mode")
Git Tree for Testing
====================
QEMU: https://github.com/adi-g15-ibm/qemu/tree/p11-v3
Has been tested with following cases:
* '-M pseries' / '-M pseries -cpu Power11'
* '-M powernv' / '-M powernv10' / '-M powernv11'
* '-smp' option tested
* with compat mode: 'max-cpu-compat=power10' and 'max-cpu-compat=power9'
* with/without device 'virtio-scsi-pci'
* with/without -kernel and -drive with qcow_file
skiboot with Power11 support: https://github.com/maheshsal/skiboot/tree/upstream_power11
Linux with Power11 support: https://github.com/torvalds/linux, since v6.9-rc1
Note: This patch series does not add tests as of now, and will be done as soon as skiboot support for Power11 gets merged, and op-build adds a release for Power11
Changelog
=========
v4:
+ patch #5: fix memory leak in pnv_chip_power10_quad_realize
- no change in other patches
v3:
+ patch #1: version power11 as power11_v2.0
+ patch #2: split target hw/pseries code into patch #2
+ patch #3,#4: fix regression due to Power10 and Power11 having same PCR
+ patch #5: create pnv_chip_power11_dt_populate and split pnv_chip_power10_common_realize as per review
+ patch #6-#11: no change
- remove commit to make Power11 as default
v2:
+ split powernv patch into homer,lpc,occ,psi,sbe
+ reduce code duplication by reusing power10 code
+ make power11 as default
+ rebase on qemu upstream/master
+ add more information in commit descriptions
+ update docs
+ update skiboot.lid
Aditya Gupta (11):
ppc: Add Power11 DD2.0 processor
ppc/pseries: Add Power11 cpu type
target/ppc: Introduce 'PowerPCCPUClass::logical_pvr' target/ppc: Fix regression due to Power10 and Power11 having same PCR ppc/pnv: Add a Power11 Pnv11Chip, and a Power11 Machine ppc/pnv: Add HOMER for POWER11
ppc/pnv: Add a LPC controller for POWER11
ppc/pnv: Add OCC for Power11
ppc/pnv: Add a PSI bridge model for Power11
ppc/pnv: Add SBE model for Power11
ppc/pnv: Update skiboot.lid to support Power11
docs/system/ppc/powernv.rst | 9 +-- docs/system/ppc/pseries.rst | 6 +- hw/ppc/pnv.c | 120 ++++++++++++++++++++++++++++++++++-- hw/ppc/pnv_core.c | 11 ++++ hw/ppc/pnv_homer.c | 8 +++ hw/ppc/pnv_lpc.c | 14 +++++ hw/ppc/pnv_occ.c | 14 +++++ hw/ppc/pnv_psi.c | 24 ++++++++ hw/ppc/pnv_sbe.c | 15 +++++ hw/ppc/spapr_cpu_core.c | 1 + include/hw/ppc/pnv.h | 5 ++ include/hw/ppc/pnv_chip.h | 7 +++ include/hw/ppc/pnv_core.h | 1 + include/hw/ppc/pnv_homer.h | 3 + include/hw/ppc/pnv_lpc.h | 4 ++ include/hw/ppc/pnv_occ.h | 2 + include/hw/ppc/pnv_psi.h | 2 + include/hw/ppc/pnv_sbe.h | 2 + pc-bios/skiboot.lid | Bin 2527328 -> 2527328 bytes target/ppc/compat.c | 11 ++++ target/ppc/cpu-models.c | 3 + target/ppc/cpu-models.h | 3 + target/ppc/cpu.h | 1 + target/ppc/cpu_init.c | 107 ++++++++++++++++++++++++++++++++ 24 files changed, 362 insertions(+), 11 deletions(-)
Signature · 1 line
2.45.1
PATCH v4 1/11 ppc: Add Power11 DD2.0 processor
Add CPU target code to add support for new Power11 Processor.
Power11 core is same as Power10, hence reuse functions defined for Power10.
--- target/ppc/compat.c | 7 +++ target/ppc/cpu-models.c | 3 ++ target/ppc/cpu-models.h | 3 ++ target/ppc/cpu_init.c | 102 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 115 insertions(+)
target/ppc/compat.c +7 -0
@@ -100,6 +100,13 @@ static const CompatInfo compat_table[] = { .pcr_level = PCR_COMPAT_3_10, .max_vthreads = 8, }, + {/* POWER11, ISA3.10 */ + .name = "power11", + .pvr = CPU_POWERPC_LOGICAL_3_10_PLUS, + .pcr = PCR_COMPAT_3_10, + .pcr_level = PCR_COMPAT_3_10, + .max_vthreads = 8, + }, };static const CompatInfo *compat_by_pvr (uint32_t pvr)
target/ppc/cpu-models.c +3 -0
@@ -734,6 +734,8 @@ "POWER9 v2.2") POWERPC_DEF("power10_v2.0", CPU_POWERPC_POWER10_DD20, POWER10, "POWER10 v2.0") + POWERPC_DEF("power11_v2.0", CPU_POWERPC_POWER11_DD20, POWER11, + "POWER11_v2.0")#endif /* defined (TARGET_PPC64) */ /***************************************************************************/
@@ -909,6 +911,7 @@ PowerPCCPUAlias ppc_cpu_aliases[] = { { "power8nvl", "power8nvl_v1.0" }, { "power9", "power9_v2.2" }, { "power10", "power10_v2.0" }, + { "power11", "power11_v2.0" }, #endif /* Generic PowerPCs */
target/ppc/cpu-models.h +3 -0
@@ -354,6 +354,8 @@ enum {CPU_POWERPC_POWER10_BASE =0x00800000 ,CPU_POWERPC_POWER10_DD1 =0x00801100 ,CPU_POWERPC_POWER10_DD20 =0x00801200 , +CPU_POWERPC_POWER11_BASE =0x00820000 , +CPU_POWERPC_POWER11_DD20 =0x00821200 , CPU_POWERPC_970_v22 =0x00390202 , CPU_POWERPC_970FX_v10 =0x00391100 , CPU_POWERPC_970FX_v20 = 0x003C0200,
@@ -391,6 +393,7 @@ enum {CPU_POWERPC_LOGICAL_2_07 =0x0F000004 ,CPU_POWERPC_LOGICAL_3_00 =0x0F000005 ,CPU_POWERPC_LOGICAL_3_10 =0x0F000006 , + CPU_POWERPC_LOGICAL_3_10_PLUS = 0x0F000007, };/* System version register (used on MPC 8xxx) */
target/ppc/cpu_init.c +102 -0
108 lines not on this page · raw message
Signature · 1 line
2.45.1
Re: [PATCH v4 01/11] ppc: Add Power11 DD2.0 processor
Hi Aditya,
Quoted 160 lines · Aditya Gupta
Add CPU target code to add support for new Power11 Processor.
Power11 core is same as Power10, hence reuse functions defined for Power10.
Cc Cédric Le Goater <[email protected]>Cc Daniel Henrique Barboza <[email protected]>Cc Frédéric Barrat <[email protected]>Cc Mahesh J Salgaonkar <[email protected]>Cc Madhavan Srinivasan <[email protected]>Cc Nicholas Piggin <[email protected]>Signed-off-by Aditya Gupta <[email protected]>--- target/ppc/compat.c | 7 +++ target/ppc/cpu-models.c | 3 ++ target/ppc/cpu-models.h | 3 ++ target/ppc/cpu_init.c | 102 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 115 insertions(+)target/ppc/compat.c +7
-0@@ -100,6 +100,13 @@ static const CompatInfo compat_table[] = { .pcr_level = PCR_COMPAT_3_10, .max_vthreads = 8, }, + {/* POWER11, ISA3.10 */ + .name = "power11", + .pvr = CPU_POWERPC_LOGICAL_3_10_PLUS, + .pcr = PCR_COMPAT_3_10, + .pcr_level = PCR_COMPAT_3_10, + .max_vthreads = 8, + }, };static const CompatInfo *compat_by_pvr (uint32_t pvr)target/ppc/cpu-models.c +3
-0@@ -734,6 +734,8 @@ "POWER9 v2.2") POWERPC_DEF("power10_v2.0", CPU_POWERPC_POWER10_DD20, POWER10, "POWER10 v2.0") + POWERPC_DEF("power11_v2.0", CPU_POWERPC_POWER11_DD20, POWER11, + "POWER11_v2.0")#endif /* defined (TARGET_PPC64) */ /***************************************************************************/ @@ -909,6 +911,7 @@ PowerPCCPUAlias ppc_cpu_aliases[] = { { "power8nvl", "power8nvl_v1.0" }, { "power9", "power9_v2.2" }, { "power10", "power10_v2.0" }, + { "power11", "power11_v2.0" }, #endif /* Generic PowerPCs */target/ppc/cpu-models.h +3
-0@@ -354,6 +354,8 @@ enum {CPU_POWERPC_POWER10_BASE =0x00800000 ,CPU_POWERPC_POWER10_DD1 =0x00801100 ,CPU_POWERPC_POWER10_DD20 =0x00801200 , +CPU_POWERPC_POWER11_BASE =0x00820000 , +CPU_POWERPC_POWER11_DD20 =0x00821200 , CPU_POWERPC_970_v22 =0x00390202 , CPU_POWERPC_970FX_v10 =0x00391100 , CPU_POWERPC_970FX_v20 = 0x003C0200,@@ -391,6 +393,7 @@ enum {CPU_POWERPC_LOGICAL_2_07 =0x0F000004 ,CPU_POWERPC_LOGICAL_3_00 =0x0F000005 ,CPU_POWERPC_LOGICAL_3_10 =0x0F000006 , + CPU_POWERPC_LOGICAL_3_10_PLUS = 0x0F000007, };/* System version register (used on MPC 8xxx) */ target/ppc/cpu_init.c +73
-0@@ -6763,6 +6763,108 @@ POWERPC_FAMILY(POWER10)(ObjectClass *oc, void *data) pcc->l1_icache_size =0x8000 ; } +static bool ppc_pvr_match_power11 (PowerPCCPUClass *pcc,uint32_t pvr,bool best) +{ +uint32_t base = pvr &CPU_POWERPC_POWER_SERVER_MASK ; +uint32_t pcc_base = pcc->pvr &CPU_POWERPC_POWER_SERVER_MASK ; + +if (!best && (base ==CPU_POWERPC_POWER11_BASE )) { +return true; + } + +if (base != pcc_base) { +return false; + } + +if ((pvr &0x0f00 ) == (pcc->pvr &0x0f00 )) { +return true; + } + +return false; +} + +POWERPC_FAMILY (POWER11 )(ObjectClass *oc,void *data) +{ +DeviceClass *dc =DEVICE_CLASS (oc); +PowerPCCPUClass *pcc =POWERPC_CPU_CLASS (oc); + + dc->fw_name ="PowerPC,POWER11" ; + dc->desc ="POWER11" ; + pcc->pvr_match = ppc_pvr_match_power11; + pcc->pcr_mask =PCR_COMPAT_2_05 |PCR_COMPAT_2_06 |PCR_COMPAT_2_07 | +PCR_COMPAT_3_00 ; + pcc->pcr_supported =PCR_COMPAT_3_10 |PCR_COMPAT_3_00 |PCR_COMPAT_2_07 | +PCR_COMPAT_2_06 |PCR_COMPAT_2_05 ; + pcc->init_proc = init_proc_POWER10; + pcc->check_pow = check_pow_nocheck; + pcc->insns_flags =PPC_INSNS_BASE |PPC_ISEL |PPC_STRING |PPC_MFTB | +PPC_FLOAT |PPC_FLOAT_FSEL |PPC_FLOAT_FRES | +PPC_FLOAT_FSQRT |PPC_FLOAT_FRSQRTE | +PPC_FLOAT_FRSQRTES | +PPC_FLOAT_STFIWX | +PPC_FLOAT_EXT | +PPC_CACHE |PPC_CACHE_ICBI |PPC_CACHE_DCBZ | +PPC_MEM_SYNC |PPC_MEM_EIEIO | +PPC_MEM_TLBIE |PPC_MEM_TLBSYNC | +PPC_64B |PPC_64H |PPC_64BX |PPC_ALTIVEC | +PPC_SEGMENT_64B |PPC_SLBI | +PPC_POPCNTB |PPC_POPCNTWD | +PPC_CILDST ; + pcc->insns_flags2 =PPC2_VSX |PPC2_VSX207 |PPC2_DFP |PPC2_DBRX | +PPC2_PERM_ISA206 |PPC2_DIVE_ISA206 | +PPC2_ATOMIC_ISA206 |PPC2_FP_CVT_ISA206 | +PPC2_FP_TST_ISA206 |PPC2_BCTAR_ISA207 | +PPC2_LSQ_ISA207 |PPC2_ALTIVEC_207 | +PPC2_ISA205 |PPC2_ISA207S |PPC2_FP_CVT_S64 | +PPC2_TM |PPC2_ISA300 |PPC2_PRCNTL |PPC2_ISA310 | +PPC2_MEM_LWSYNC |PPC2_BCDA_ISA206 ; + pcc->msr_mask = (1ull <<MSR_SF ) | + (1ull <<MSR_HV ) | + (1ull <<MSR_TM ) | + (1ull <<MSR_VR ) | + (1ull <<MSR_VSX ) | + (1ull <<MSR_EE ) | + (1ull <<MSR_PR ) | + (1ull <<MSR_FP ) | + (1ull <<MSR_ME ) | + (1ull <<MSR_FE0 ) | + (1ull <<MSR_SE ) | + (1ull <<MSR_DE ) | + (1ull <<MSR_FE1 ) | + (1ull <<MSR_IR ) | + (1ull <<MSR_DR ) | + (1ull <<MSR_PMM ) | + (1ull <<MSR_RI ) | + (1ull <<MSR_LE );
target/ppc/cpu_init.c POWERPC_FAMILY(POWER10)(ObjectClass *oc, void *data) · line 6848
Quoted 10 lines
target/ppc/cpu_init.c +10
-0+ pcc->lpcr_mask =LPCR_VPM1 |LPCR_ISL |LPCR_KBV |LPCR_DPFD | + (LPCR_PECE_U_MASK &LPCR_HVEE ) |LPCR_ILE |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 )) + |LPCR_MER |LPCR_GTSE |LPCR_TC | +LPCR_HEIC |LPCR_LPES0 |LPCR_HVICE |LPCR_HDICE ; +/* DD2 adds an extra HAIL bit */ + pcc->lpcr_mask |=LPCR_HAIL ; +
I had posted a patch to get rid of this growing code duplication here:
https://lore.kernel.org/qemu-devel/[email protected]/
Would you mind considering the relevant patches to rebase your changes?
regards,
Harsh
Quoted 22 lines
target/ppc/cpu_init.c +19
-0+ pcc->lpcr_pm =LPCR_PDEE |LPCR_HDEE |LPCR_EEE |LPCR_DEE |LPCR_OEE ; + pcc->mmu_model =POWERPC_MMU_3_00 ; +#if !defined(CONFIG_USER_ONLY ) +/* segment page size remain the same */ + pcc->hash64_opts = &ppc_hash64_opts_POWER7; + pcc->radix_page_info = &POWER10_radix_page_info; + pcc->lrg_decr_bits =56 ; +#endif + pcc->excp_model =POWERPC_EXCP_POWER10 ; + pcc->bus_model =PPC_FLAGS_INPUT_POWER9 ; + pcc->bfd_mach = bfd_mach_ppc64; + pcc->flags =POWERPC_FLAG_VRE |POWERPC_FLAG_SE | +POWERPC_FLAG_BE |POWERPC_FLAG_PMM | +POWERPC_FLAG_BUS_CLK |POWERPC_FLAG_CFAR | +POWERPC_FLAG_VSX |POWERPC_FLAG_TM |POWERPC_FLAG_SCV ; + pcc->l1_dcache_size =0x8000 ; + pcc->l1_icache_size =0x8000 ; +} +#if !defined(CONFIG_USER_ONLY )void cpu_ppc_set_vhyp (PowerPCCPU *cpu,PPCVirtualHypervisor *vhyp) {
Re: [PATCH v4 01/11] ppc: Add Power11 DD2.0 processor
Hello Harsh,
Quoted 172 lines · Harsh Prateek Bora
Hi Aditya,
Quoted 155 lines · Aditya Gupta
Add CPU target code to add support for new Power11 Processor.
Power11 core is same as Power10, hence reuse functions defined for Power10.
Cc Cédric Le Goater <[email protected]>Cc Daniel Henrique Barboza <[email protected]>Cc Frédéric Barrat <[email protected]>Cc Mahesh J Salgaonkar <[email protected]>Cc Madhavan Srinivasan <[email protected]>Cc Nicholas Piggin <[email protected]>Signed-off-by Aditya Gupta <[email protected]>--- target/ppc/compat.c | 7 +++ target/ppc/cpu-models.c | 3 ++ target/ppc/cpu-models.h | 3 ++ target/ppc/cpu_init.c | 102 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 115 insertions(+)target/ppc/compat.c +7
-0@@ -100,6 +100,13 @@ static const CompatInfo compat_table[] = { .pcr_level = PCR_COMPAT_3_10, .max_vthreads = 8, }, + {/* POWER11, ISA3.10 */ + .name = "power11", + .pvr = CPU_POWERPC_LOGICAL_3_10_PLUS, + .pcr = PCR_COMPAT_3_10, + .pcr_level = PCR_COMPAT_3_10, + .max_vthreads = 8, + }, };static const CompatInfo *compat_by_pvr (uint32_t pvr)target/ppc/cpu-models.c +3
-0@@ -734,6 +734,8 @@ "POWER9 v2.2") POWERPC_DEF("power10_v2.0", CPU_POWERPC_POWER10_DD20, POWER10, "POWER10 v2.0") + POWERPC_DEF("power11_v2.0", CPU_POWERPC_POWER11_DD20, POWER11, + "POWER11_v2.0")#endif /* defined (TARGET_PPC64) */ /***************************************************************************/ @@ -909,6 +911,7 @@ PowerPCCPUAlias ppc_cpu_aliases[] = { { "power8nvl", "power8nvl_v1.0" }, { "power9", "power9_v2.2" }, { "power10", "power10_v2.0" }, + { "power11", "power11_v2.0" }, #endif /* Generic PowerPCs */target/ppc/cpu-models.h +3
-0@@ -354,6 +354,8 @@ enum {CPU_POWERPC_POWER10_BASE =0x00800000 ,CPU_POWERPC_POWER10_DD1 =0x00801100 ,CPU_POWERPC_POWER10_DD20 =0x00801200 , +CPU_POWERPC_POWER11_BASE =0x00820000 , +CPU_POWERPC_POWER11_DD20 =0x00821200 , CPU_POWERPC_970_v22 =0x00390202 , CPU_POWERPC_970FX_v10 =0x00391100 , CPU_POWERPC_970FX_v20 = 0x003C0200,@@ -391,6 +393,7 @@ enum {CPU_POWERPC_LOGICAL_2_07 =0x0F000004 ,CPU_POWERPC_LOGICAL_3_00 =0x0F000005 ,CPU_POWERPC_LOGICAL_3_10 =0x0F000006 , + CPU_POWERPC_LOGICAL_3_10_PLUS = 0x0F000007, };/* System version register (used on MPC 8xxx) */ target/ppc/cpu_init.c +73
-0@@ -6763,6 +6763,108 @@ POWERPC_FAMILY(POWER10)(ObjectClass *oc, void *data) pcc->l1_icache_size =0x8000 ; } +static bool ppc_pvr_match_power11 (PowerPCCPUClass *pcc,uint32_t pvr,bool best) +{ +uint32_t base = pvr &CPU_POWERPC_POWER_SERVER_MASK ; +uint32_t pcc_base = pcc->pvr &CPU_POWERPC_POWER_SERVER_MASK ; + +if (!best && (base ==CPU_POWERPC_POWER11_BASE )) { +return true; + } + +if (base != pcc_base) { +return false; + } + +if ((pvr &0x0f00 ) == (pcc->pvr &0x0f00 )) { +return true; + } + +return false; +} + +POWERPC_FAMILY (POWER11 )(ObjectClass *oc,void *data) +{ +DeviceClass *dc =DEVICE_CLASS (oc); +PowerPCCPUClass *pcc =POWERPC_CPU_CLASS (oc); + + dc->fw_name ="PowerPC,POWER11" ; + dc->desc ="POWER11" ; + pcc->pvr_match = ppc_pvr_match_power11; + pcc->pcr_mask =PCR_COMPAT_2_05 |PCR_COMPAT_2_06 |PCR_COMPAT_2_07 | +PCR_COMPAT_3_00 ; + pcc->pcr_supported =PCR_COMPAT_3_10 |PCR_COMPAT_3_00 |PCR_COMPAT_2_07 | +PCR_COMPAT_2_06 |PCR_COMPAT_2_05 ; + pcc->init_proc = init_proc_POWER10; + pcc->check_pow = check_pow_nocheck; + pcc->insns_flags =PPC_INSNS_BASE |PPC_ISEL |PPC_STRING |PPC_MFTB | +PPC_FLOAT |PPC_FLOAT_FSEL |PPC_FLOAT_FRES | +PPC_FLOAT_FSQRT |PPC_FLOAT_FRSQRTE | +PPC_FLOAT_FRSQRTES | +PPC_FLOAT_STFIWX | +PPC_FLOAT_EXT | +PPC_CACHE |PPC_CACHE_ICBI |PPC_CACHE_DCBZ | +PPC_MEM_SYNC |PPC_MEM_EIEIO | +PPC_MEM_TLBIE |PPC_MEM_TLBSYNC | +PPC_64B |PPC_64H |PPC_64BX |PPC_ALTIVEC | +PPC_SEGMENT_64B |PPC_SLBI | +PPC_POPCNTB |PPC_POPCNTWD | +PPC_CILDST ; + pcc->insns_flags2 =PPC2_VSX |PPC2_VSX207 |PPC2_DFP |PPC2_DBRX | +PPC2_PERM_ISA206 |PPC2_DIVE_ISA206 | +PPC2_ATOMIC_ISA206 |PPC2_FP_CVT_ISA206 | +PPC2_FP_TST_ISA206 |PPC2_BCTAR_ISA207 | +PPC2_LSQ_ISA207 |PPC2_ALTIVEC_207 | +PPC2_ISA205 |PPC2_ISA207S |PPC2_FP_CVT_S64 | +PPC2_TM |PPC2_ISA300 |PPC2_PRCNTL |PPC2_ISA310 | +PPC2_MEM_LWSYNC |PPC2_BCDA_ISA206 ; + pcc->msr_mask = (1ull <<MSR_SF ) | + (1ull <<MSR_HV ) | + (1ull <<MSR_TM ) | + (1ull <<MSR_VR ) | + (1ull <<MSR_VSX ) | + (1ull <<MSR_EE ) | + (1ull <<MSR_PR ) | + (1ull <<MSR_FP ) | + (1ull <<MSR_ME ) | + (1ull <<MSR_FE0 ) | + (1ull <<MSR_SE ) | + (1ull <<MSR_DE ) | + (1ull <<MSR_FE1 ) | + (1ull <<MSR_IR ) | + (1ull <<MSR_DR ) | + (1ull <<MSR_PMM ) | + (1ull <<MSR_RI ) | + (1ull <<MSR_LE );target/ppc/cpu_init.c POWERPC_FAMILY(POWER10)(ObjectClass *oc, void *data) · line 6847
Quoted 10 lines
target/ppc/cpu_init.c +10
-0+ pcc->lpcr_mask =LPCR_VPM1 |LPCR_ISL |LPCR_KBV |LPCR_DPFD | + (LPCR_PECE_U_MASK &LPCR_HVEE ) |LPCR_ILE |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 )) + |LPCR_MER |LPCR_GTSE |LPCR_TC | +LPCR_HEIC |LPCR_LPES0 |LPCR_HVICE |LPCR_HDICE ; +/* DD2 adds an extra HAIL bit */ + pcc->lpcr_mask |=LPCR_HAIL ; +I had posted a patch to get rid of this growing code duplication here:
https://lore.kernel.org/qemu-devel/[email protected]/
Quoted 1 line
Would you mind considering the relevant patches to rebase your changes?
I will check it out. Thanks Harsh.
- Aditya Gupta
Quoted 26 lines
regards,
HarshQuoted 22 lines
target/ppc/cpu_init.c +19
-0+ pcc->lpcr_pm =LPCR_PDEE |LPCR_HDEE |LPCR_EEE |LPCR_DEE |LPCR_OEE ; + pcc->mmu_model =POWERPC_MMU_3_00 ; +#if !defined(CONFIG_USER_ONLY ) +/* segment page size remain the same */ + pcc->hash64_opts = &ppc_hash64_opts_POWER7; + pcc->radix_page_info = &POWER10_radix_page_info; + pcc->lrg_decr_bits =56 ; +#endif + pcc->excp_model =POWERPC_EXCP_POWER10 ; + pcc->bus_model =PPC_FLAGS_INPUT_POWER9 ; + pcc->bfd_mach = bfd_mach_ppc64; + pcc->flags =POWERPC_FLAG_VRE |POWERPC_FLAG_SE | +POWERPC_FLAG_BE |POWERPC_FLAG_PMM | +POWERPC_FLAG_BUS_CLK |POWERPC_FLAG_CFAR | +POWERPC_FLAG_VSX |POWERPC_FLAG_TM |POWERPC_FLAG_SCV ; + pcc->l1_dcache_size =0x8000 ; + pcc->l1_icache_size =0x8000 ; +} +#if !defined(CONFIG_USER_ONLY )void cpu_ppc_set_vhyp (PowerPCCPU *cpu,PPCVirtualHypervisor *vhyp) {
Re: [PATCH v4 01/11] ppc: Add Power11 DD2.0 processor
Quoted 86 lines · Aditya Gupta
Hello Harsh,
Quoted 83 lines · Harsh Prateek Bora
Hi Aditya,
Quoted 80 lines · Aditya Gupta
Add CPU target code to add support for new Power11 Processor.
Power11 core is same as Power10, hence reuse functions defined for Power10.
Cc Cédric Le Goater <[email protected]>Cc Daniel Henrique Barboza <[email protected]>Cc Frédéric Barrat <[email protected]>Cc Mahesh J Salgaonkar <[email protected]>Cc Madhavan Srinivasan <[email protected]>Cc Nicholas Piggin <[email protected]>Signed-off-by Aditya Gupta <[email protected]>--- target/ppc/compat.c | 7 +++ target/ppc/cpu-models.c | 3 ++ target/ppc/cpu-models.h | 3 ++ target/ppc/cpu_init.c | 102 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 115 insertions(+)target/ppc/compat.c +7
-0@@ -100,6 +100,13 @@ static const CompatInfo compat_table[] = { .pcr_level = PCR_COMPAT_3_10, .max_vthreads = 8, }, + {/* POWER11, ISA3.10 */ + .name = "power11", + .pvr = CPU_POWERPC_LOGICAL_3_10_PLUS, + .pcr = PCR_COMPAT_3_10, + .pcr_level = PCR_COMPAT_3_10, + .max_vthreads = 8, + }, };static const CompatInfo *compat_by_pvr (uint32_t pvr)target/ppc/cpu-models.c +3
-0@@ -734,6 +734,8 @@ "POWER9 v2.2") POWERPC_DEF("power10_v2.0", CPU_POWERPC_POWER10_DD20, POWER10, "POWER10 v2.0") + POWERPC_DEF("power11_v2.0", CPU_POWERPC_POWER11_DD20, POWER11, + "POWER11_v2.0")#endif /* defined (TARGET_PPC64) */ /***************************************************************************/ @@ -909,6 +911,7 @@ PowerPCCPUAlias ppc_cpu_aliases[] = { { "power8nvl", "power8nvl_v1.0" }, { "power9", "power9_v2.2" }, { "power10", "power10_v2.0" }, + { "power11", "power11_v2.0" }, #endif /* Generic PowerPCs */target/ppc/cpu-models.h +3
-0@@ -354,6 +354,8 @@ enum {CPU_POWERPC_POWER10_BASE =0x00800000 ,CPU_POWERPC_POWER10_DD1 =0x00801100 ,CPU_POWERPC_POWER10_DD20 =0x00801200 , +CPU_POWERPC_POWER11_BASE =0x00820000 , +CPU_POWERPC_POWER11_DD20 =0x00821200 , CPU_POWERPC_970_v22 =0x00390202 , CPU_POWERPC_970FX_v10 =0x00391100 , CPU_POWERPC_970FX_v20 = 0x003C0200,@@ -391,6 +393,7 @@ enum {CPU_POWERPC_LOGICAL_2_07 =0x0F000004 ,CPU_POWERPC_LOGICAL_3_00 =0x0F000005 ,CPU_POWERPC_LOGICAL_3_10 =0x0F000006 , + CPU_POWERPC_LOGICAL_3_10_PLUS = 0x0F000007, };/* System version register (used on MPC 8xxx) */ target/ppc/cpu_init.c +0
-0@@ -6763,6 +6763,108 @@ POWERPC_FAMILY(POWER10)(ObjectClass *oc, void *data)
Quoted 8 lines
Quoted 8 lines
target/ppc/cpu_init.c POWERPC_FAMILY(POWER10)(ObjectClass *oc, void *data) · line 6771
Quoted 8 lines
target/ppc/cpu_init.c +6
-0pcc->l1_icache_size =0x8000 ; } +static bool ppc_pvr_match_power11 (PowerPCCPUClass *pcc,uint32_t pvr,bool best) +{ +uint32_t base = pvr &CPU_POWERPC_POWER_SERVER_MASK ; +uint32_t pcc_base = pcc->pvr &CPU_POWERPC_POWER_SERVER_MASK ; + +if (!best && (base ==CPU_POWERPC_POWER11_BASE )) {
Also, this helper is almost same as that of power10 except for the base check against respective value. This entire logic can be shared by passing respective base value to the another low level routine which takes this base value as arg. Let's try to avoid code duplication by resharing as much as possible.
Thanks
Harsh
Quoted 113 lines
Quoted 81 lines
Quoted 67 lines
target/ppc/cpu_init.c +67
-0+return true; + } + +if (base != pcc_base) { +return false; + } + +if ((pvr &0x0f00 ) == (pcc->pvr &0x0f00 )) { +return true; + } + +return false; +} + +POWERPC_FAMILY (POWER11 )(ObjectClass *oc,void *data) +{ +DeviceClass *dc =DEVICE_CLASS (oc); +PowerPCCPUClass *pcc =POWERPC_CPU_CLASS (oc); + + dc->fw_name ="PowerPC,POWER11" ; + dc->desc ="POWER11" ; + pcc->pvr_match = ppc_pvr_match_power11; + pcc->pcr_mask =PCR_COMPAT_2_05 |PCR_COMPAT_2_06 |PCR_COMPAT_2_07 | +PCR_COMPAT_3_00 ; + pcc->pcr_supported =PCR_COMPAT_3_10 |PCR_COMPAT_3_00 |PCR_COMPAT_2_07 | +PCR_COMPAT_2_06 |PCR_COMPAT_2_05 ; + pcc->init_proc = init_proc_POWER10; + pcc->check_pow = check_pow_nocheck; + pcc->insns_flags =PPC_INSNS_BASE |PPC_ISEL |PPC_STRING |PPC_MFTB | +PPC_FLOAT |PPC_FLOAT_FSEL |PPC_FLOAT_FRES | +PPC_FLOAT_FSQRT |PPC_FLOAT_FRSQRTE | +PPC_FLOAT_FRSQRTES | +PPC_FLOAT_STFIWX | +PPC_FLOAT_EXT | +PPC_CACHE |PPC_CACHE_ICBI |PPC_CACHE_DCBZ | +PPC_MEM_SYNC |PPC_MEM_EIEIO | +PPC_MEM_TLBIE |PPC_MEM_TLBSYNC | +PPC_64B |PPC_64H |PPC_64BX |PPC_ALTIVEC | +PPC_SEGMENT_64B |PPC_SLBI | +PPC_POPCNTB |PPC_POPCNTWD | +PPC_CILDST ; + pcc->insns_flags2 =PPC2_VSX |PPC2_VSX207 |PPC2_DFP |PPC2_DBRX | +PPC2_PERM_ISA206 |PPC2_DIVE_ISA206 | +PPC2_ATOMIC_ISA206 |PPC2_FP_CVT_ISA206 | +PPC2_FP_TST_ISA206 |PPC2_BCTAR_ISA207 | +PPC2_LSQ_ISA207 |PPC2_ALTIVEC_207 | +PPC2_ISA205 |PPC2_ISA207S |PPC2_FP_CVT_S64 | +PPC2_TM |PPC2_ISA300 |PPC2_PRCNTL |PPC2_ISA310 | +PPC2_MEM_LWSYNC |PPC2_BCDA_ISA206 ; + pcc->msr_mask = (1ull <<MSR_SF ) | + (1ull <<MSR_HV ) | + (1ull <<MSR_TM ) | + (1ull <<MSR_VR ) | + (1ull <<MSR_VSX ) | + (1ull <<MSR_EE ) | + (1ull <<MSR_PR ) | + (1ull <<MSR_FP ) | + (1ull <<MSR_ME ) | + (1ull <<MSR_FE0 ) | + (1ull <<MSR_SE ) | + (1ull <<MSR_DE ) | + (1ull <<MSR_FE1 ) | + (1ull <<MSR_IR ) | + (1ull <<MSR_DR ) | + (1ull <<MSR_PMM ) | + (1ull <<MSR_RI ) | + (1ull <<MSR_LE );target/ppc/cpu_init.c POWERPC_FAMILY(POWER10)(ObjectClass *oc, void *data) · line 6848
Quoted 10 lines
target/ppc/cpu_init.c +10
-0+ pcc->lpcr_mask =LPCR_VPM1 |LPCR_ISL |LPCR_KBV |LPCR_DPFD | + (LPCR_PECE_U_MASK &LPCR_HVEE ) |LPCR_ILE |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 )) + |LPCR_MER |LPCR_GTSE |LPCR_TC | +LPCR_HEIC |LPCR_LPES0 |LPCR_HVICE |LPCR_HDICE ; +/* DD2 adds an extra HAIL bit */ + pcc->lpcr_mask |=LPCR_HAIL ; +I had posted a patch to get rid of this growing code duplication here:
https://lore.kernel.org/qemu-devel/[email protected]/Quoted 1 line
Would you mind considering the relevant patches to rebase your changes?
I will check it out. Thanks Harsh.
- Aditya Gupta
Quoted 26 lines
regards,
HarshQuoted 22 lines
target/ppc/cpu_init.c +19
-0+ pcc->lpcr_pm =LPCR_PDEE |LPCR_HDEE |LPCR_EEE |LPCR_DEE |LPCR_OEE ; + pcc->mmu_model =POWERPC_MMU_3_00 ; +#if !defined(CONFIG_USER_ONLY ) +/* segment page size remain the same */ + pcc->hash64_opts = &ppc_hash64_opts_POWER7; + pcc->radix_page_info = &POWER10_radix_page_info; + pcc->lrg_decr_bits =56 ; +#endif + pcc->excp_model =POWERPC_EXCP_POWER10 ; + pcc->bus_model =PPC_FLAGS_INPUT_POWER9 ; + pcc->bfd_mach = bfd_mach_ppc64; + pcc->flags =POWERPC_FLAG_VRE |POWERPC_FLAG_SE | +POWERPC_FLAG_BE |POWERPC_FLAG_PMM | +POWERPC_FLAG_BUS_CLK |POWERPC_FLAG_CFAR | +POWERPC_FLAG_VSX |POWERPC_FLAG_TM |POWERPC_FLAG_SCV ; + pcc->l1_dcache_size =0x8000 ; + pcc->l1_icache_size =0x8000 ; +} +#if !defined(CONFIG_USER_ONLY )void cpu_ppc_set_vhyp (PowerPCCPU *cpu,PPCVirtualHypervisor *vhyp) {
PATCH v4 2/11 ppc/pseries: Add Power11 cpu type
In reply to Aditya GuptaAdd sPAPR CPU Core definition for Power11
--- docs/system/ppc/pseries.rst | 6 +++--- hw/ppc/spapr_cpu_core.c | 1 + 2 files changed, 4 insertions(+), 3 deletions(-)
docs/system/ppc/pseries.rst +3 -3
@@ -15,9 +15,9 @@ Supported devices ================= * Multi processor support for many Power processors generations: POWER7, - POWER7+, POWER8, POWER8NVL, POWER9, and Power10. Support for POWER5+ exists, - but its state is unknown. - * Interrupt Controller, XICS (POWER8) and XIVE (POWER9 and Power10) + POWER7+, POWER8, POWER8NVL, POWER9, Power10 and Power11. Support for POWER5+ + exists, but its state is unknown. + * Interrupt Controller, XICS (POWER8) and XIVE (POWER9, Power10, Power11) * vPHB PCIe Host bridge. * vscsi and vnet devices, compatible with the same devices available on a PowerVM hypervisor with VIOS managing LPARs.
hw/ppc/spapr_cpu_core.c +1 -0
@@ -401,6 +401,7 @@ static const TypeInfo spapr_cpu_core_type_infos[] = {DEFINE_SPAPR_CPU_CORE_TYPE ("power9_v2.0" ),DEFINE_SPAPR_CPU_CORE_TYPE ("power9_v2.2" ),DEFINE_SPAPR_CPU_CORE_TYPE ("power10_v2.0" ), +DEFINE_SPAPR_CPU_CORE_TYPE ("power11_v2.0" ), #ifdef CONFIG_KVM DEFINE_SPAPR_CPU_CORE_TYPE("host"), #endif
Signature · 1 line
2.45.1
Re: [PATCH v4 02/11] ppc/pseries: Add Power11 cpu type
Quoted 21 lines · Aditya Gupta
Add sPAPR CPU Core definition for Power11
Cc David Gibson <[email protected]> (reviewer:sPAPR (pseries))Cc Harsh Prateek Bora <[email protected]> (reviewer:sPAPR (pseries))Cc Cédric Le Goater <[email protected]>Cc Daniel Henrique Barboza <[email protected]>Cc Frédéric Barrat <[email protected]>Cc Mahesh J Salgaonkar <[email protected]>Cc Madhavan Srinivasan <[email protected]>Cc Nicholas Piggin <[email protected]>Signed-off-by Aditya Gupta <[email protected]>--- docs/system/ppc/pseries.rst | 6 +++--- hw/ppc/spapr_cpu_core.c | 1 + 2 files changed, 4 insertions(+), 3 deletions(-)docs/system/ppc/pseries.rst +0
-0
docs/system/ppc/pseries.rst Supported devices · line 20
Quoted 9 lines
docs/system/ppc/pseries.rst +3
-3@@ -15,9 +15,9 @@ Supported devices ================= * Multi processor support for many Power processors generations: POWER7, - POWER7+, POWER8, POWER8NVL, POWER9, and Power10. Support for POWER5+ exists, - but its state is unknown. - * Interrupt Controller, XICS (POWER8) and XIVE (POWER9 and Power10) + POWER7+, POWER8, POWER8NVL, POWER9, Power10 and Power11. Support for POWER5+ + exists, but its state is unknown. + * Interrupt Controller, XICS (POWER8) and XIVE (POWER9, Power10, Power11)
I think it would look more cleaner to rephrase as below:
* Multi processor support for many Power processors generations:
- POWER7, POWER7+
- POWER8, POWER8NVL
- POWER9
- Power10
- Power11.
- Support for POWER5+ exists, but its state is unknown.
* Interrupt Controller
- XICS (POWER8)
- XIVE (Supported by below:)
- POWER9
- Power10
- Power11
So, that every next platform just need to add one line for itself.
With that,
Thanks
Harsh
Quoted 15 lines
docs/system/ppc/pseries.rst +0
-0* vPHB PCIe Host bridge. * vscsi and vnet devices, compatible with the same devices available on a PowerVM hypervisor with VIOS managing LPARs.hw/ppc/spapr_cpu_core.c +1
-0@@ -401,6 +401,7 @@ static const TypeInfo spapr_cpu_core_type_infos[] = {DEFINE_SPAPR_CPU_CORE_TYPE ("power9_v2.0" ),DEFINE_SPAPR_CPU_CORE_TYPE ("power9_v2.2" ),DEFINE_SPAPR_CPU_CORE_TYPE ("power10_v2.0" ), +DEFINE_SPAPR_CPU_CORE_TYPE ("power11_v2.0" ), #ifdef CONFIG_KVM DEFINE_SPAPR_CPU_CORE_TYPE("host"), #endif
Re: [PATCH v4 02/11] ppc/pseries: Add Power11 cpu type
Quoted 35 lines · Harsh Prateek Bora
Quoted 21 lines · Aditya Gupta
Add sPAPR CPU Core definition for Power11
Cc David Gibson <[email protected]> (reviewer:sPAPR (pseries))Cc Harsh Prateek Bora <[email protected]> (reviewer:sPAPR (pseries))Cc Cédric Le Goater <[email protected]>Cc Daniel Henrique Barboza <[email protected]>Cc Frédéric Barrat <[email protected]>Cc Mahesh J Salgaonkar <[email protected]>Cc Madhavan Srinivasan <[email protected]>Cc Nicholas Piggin <[email protected]>Signed-off-by Aditya Gupta <[email protected]>---
docs/system/ppc/pseries.rst| 6 +++---
hw/ppc/spapr_cpu_core.c | 1 +2 files changed, 4 insertions(+), 3 deletions(-)docs/system/ppc/pseries.rst +0
-0@@ -15,9 +15,9 @@ Supported devicesQuoted 8 lines
=================
* Multi processor support for many Power processors generations: POWER7, - POWER7+, POWER8, POWER8NVL, POWER9, and Power10. Support for POWER5+ exists, - but its state is unknown.
- * Interrupt Controller, XICS (POWER8) and XIVE (POWER9 and Power10) + POWER7+, POWER8, POWER8NVL, POWER9, Power10 and Power11. Support for POWER5+ + exists, but its state is unknown.
+ * Interrupt Controller, XICS (POWER8) and XIVE (POWER9, Power10, Power11)I think it would look more cleaner to rephrase as below:
Quoted 7 lines
* Multi processor support for many Power processors generations:
- POWER7, POWER7+
- POWER8, POWER8NVL
- POWER9
- Power10
- Power11.
- Support for POWER5+ exists, but its state is unknown.
$ /usr/bin/qemu-system-ppc64 -version QEMU emulator version 8.1.3 (qemu-8.1.3-5.fc39) Copyright (c) 2003-2023 Fabrice Bellard and the QEMU Project developers
With the correct kernel/userspace, it runs :
# uname -a Linux buildroot 6.6.3 #1 SMP Fri Jan 5 00:00:45 CET 2024 ppc64 GNU/Linux # cat /proc/cpuinfo processor : 0 cpu : POWER5+ (gs) clock : 1000.000000MHz revision : 2.1 (pvr 003b 0201)
timebase : 512000000
platform : pSeries
model : IBM pSeries (emulated by qemu)
machine : CHRP IBM pSeries (emulated by qemu)
MMU : Hash
Thanks,
C.
Quoted 29 lines
* Interrupt Controller
- XICS (POWER8)
- XIVE (Supported by below:)
- POWER9
- Power10
- Power11So, that every next platform just need to add one line for itself.
With that,
Reviewed-by Harsh Prateek Bora <[email protected]>Thanks
HarshQuoted 15 lines
* vPHB PCIe Host bridge.
* vscsi and vnet devices, compatible with the same devices available on a PowerVM hypervisor with VIOS managing LPARs.hw/ppc/spapr_cpu_core.c +1
-0@@ -401,6 +401,7 @@ static const TypeInfo spapr_cpu_core_type_infos[] = { DEFINE_SPAPR_CPU_CORE_TYPE("power9_v2.0"), DEFINE_SPAPR_CPU_CORE_TYPE("power9_v2.2"), DEFINE_SPAPR_CPU_CORE_TYPE("power10_v2.0"), + DEFINE_SPAPR_CPU_CORE_TYPE("power11_v2.0"), #ifdef CONFIG_KVM DEFINE_SPAPR_CPU_CORE_TYPE("host"), #endif
PATCH v4 3/11 target/ppc: Introduce 'PowerPCCPUClass::logical_pvr'
In reply to Aditya GuptaIntroduce 'PnvChipClass::logical_pvr' to know corresponding logical PVR of a PowerPC CPU.
This helps to have a one-to-one mapping between PVR and logical PVR for a CPU, and used in a later commit to handle cases where PCR of two generations of Power chip is same, which causes regressions with compat-mode.
--- target/ppc/cpu.h | 1 + target/ppc/cpu_init.c | 5 +++++ 2 files changed, 6 insertions(+)
target/ppc/cpu.h +1 -0
@@ -1504,6 +1504,7 @@ struct PowerPCCPUClass {void (*parent_parse_features)(const char *type,char *str,Error **errp);uint32_t pvr; +uint32_t logical_pvr;/* * If @best is false, match if pcc is in the family of pvr * Else match only if pcc is the best match for pvr in this family.
target/ppc/cpu_init.c +5 -0
@@ -6151,6 +6151,7 @@ POWERPC_FAMILY(POWER7)(ObjectClass *oc, void *data) dc->fw_name ="PowerPC,POWER7" ; dc->desc ="POWER7" ; + pcc->logical_pvr =CPU_POWERPC_LOGICAL_2_06_PLUS ; pcc->pvr_match = ppc_pvr_match_power7; pcc->pcr_mask =PCR_VEC_DIS |PCR_VSX_DIS |PCR_COMPAT_2_05 ; pcc->pcr_supported =PCR_COMPAT_2_06 |PCR_COMPAT_2_05 ;
@@ -6314,6 +6315,7 @@ POWERPC_FAMILY(POWER8)(ObjectClass *oc, void *data) dc->fw_name ="PowerPC,POWER8" ; dc->desc ="POWER8" ; + pcc->logical_pvr =CPU_POWERPC_LOGICAL_2_07 ; pcc->pvr_match = ppc_pvr_match_power8; pcc->pcr_mask =PCR_TM_DIS |PCR_COMPAT_2_06 |PCR_COMPAT_2_05 ; pcc->pcr_supported =PCR_COMPAT_2_07 |PCR_COMPAT_2_06 |PCR_COMPAT_2_05 ;
@@ -6507,6 +6509,7 @@ POWERPC_FAMILY(POWER9)(ObjectClass *oc, void *data) dc->fw_name ="PowerPC,POWER9" ; dc->desc ="POWER9" ; + pcc->logical_pvr =CPU_POWERPC_LOGICAL_3_00 ; pcc->pvr_match = ppc_pvr_match_power9; pcc->pcr_mask =PCR_COMPAT_2_05 |PCR_COMPAT_2_06 |PCR_COMPAT_2_07 ; pcc->pcr_supported = PCR_COMPAT_3_00 | PCR_COMPAT_2_07 | PCR_COMPAT_2_06 |
@@ -6687,6 +6690,7 @@ POWERPC_FAMILY(POWER10)(ObjectClass *oc, void *data) dc->fw_name ="PowerPC,POWER10" ; dc->desc ="POWER10" ; + pcc->logical_pvr =CPU_POWERPC_LOGICAL_3_10 ; pcc->pvr_match = ppc_pvr_match_power10; pcc->pcr_mask =PCR_COMPAT_2_05 |PCR_COMPAT_2_06 |PCR_COMPAT_2_07 |PCR_COMPAT_3_00 ;
@@ -6790,6 +6794,7 @@ POWERPC_FAMILY(POWER11)(ObjectClass *oc, void *data) dc->fw_name ="PowerPC,POWER11" ; dc->desc ="POWER11" ; + pcc->logical_pvr =CPU_POWERPC_LOGICAL_3_10_PLUS ; pcc->pvr_match = ppc_pvr_match_power11; pcc->pcr_mask =PCR_COMPAT_2_05 |PCR_COMPAT_2_06 |PCR_COMPAT_2_07 |PCR_COMPAT_3_00 ;
Signature · 1 line
2.45.1
PATCH v4 4/11 target/ppc: Fix regression due to Power10 and Power11 having same PCR
In reply to Aditya GuptaPower11 has the same PCR (Processor Compatibility Register) value, as Power10.
Due to this, QEMU considers Power11 as a valid compat-mode for Power10,
ie. earlier it was possible to run QEMU with '-M pseries,max-compat-mode=power11 --cpu power10'
Same PCR also introduced a regression where -M pseries --cpu power10 boots as Power11 (ie. logical PVR is of Power11, even though PVR is Power10). The regression was due to 'do_client_architecture_support' checking for valid compat modes and finding Power11 to be a valid compat mode for Power10 (it happens even without passing 'max-compat-mode' explicitly).
Fix compat-mode issue and regression, by ensuring a future Power processor (with a higher logical_pvr value, eg. P11) cannot be valid compat-mode for an older Power processor (eg. P10)
---
Multiple alternative approaches were tried to fix this:
1. New PCR for Power11: No
2. 'Hacky fix': chose (n-1) entry in compat table in case of Power10.
Commit: https://github.com/adi-g15-ibm/qemu/commit/c79bd667791883d4fb5e643979ae9c86a97bdf66
Pros: Doesn't require adding a new field
Cons: Hacky fix, will need change if Power12 comes with same PCR as
Power10 (unlikely)
3. Setting current Processor's .logical_pvr as the max_compat to be checked during CAS (Client Architecture Support).
Commit: https://github.com/adi-g15-ibm/qemu/commit/30e430be71c6f3296017177298e54532570c2c87
This causes CAS to not consider Power11 if cpu is Power10
---
--- target/ppc/compat.c | 4 ++++ 1 file changed, 4 insertions(+)
target/ppc/compat.c +4 -0
@@ -139,6 +139,10 @@ static bool pcc_compat(PowerPCCPUClass *pcc, uint32_t compat_pvr,/* Outside specified range */ return false; } +if (compat->pvr > pcc->logical_pvr) { +/* Older CPU cannot support a newer processor's compat mode */ +return false; + }if (!(pcc->pcr_supported & compat->pcr_level)) {/* Not supported by this CPU */ return false;
Signature · 1 line
2.45.1
PATCH v4 5/11 ppc/pnv: Add a Power11 Pnv11Chip, and a Power11 Machine
In reply to Aditya GuptaPower11 core is same as Power10, use the existing functionalities to introduce a Power11 chip and machine, with Power10 chip as parent of Power11 chip, thus going through similar class_init paths
--- docs/system/ppc/powernv.rst | 9 +-- hw/ppc/pnv.c | 120 ++++++++++++++++++++++++++++++++++-- hw/ppc/pnv_core.c | 11 ++++ include/hw/ppc/pnv.h | 5 ++ include/hw/ppc/pnv_chip.h | 7 +++ include/hw/ppc/pnv_core.h | 1 + 6 files changed, 145 insertions(+), 8 deletions(-)
docs/system/ppc/powernv.rst +5 -4
@@ -1,5 +1,5 @@ -PowerNV family boards (``powernv8``, ``powernv9``, ``powernv10``) -================================================================== +PowerNV family boards (``powernv8``, ``powernv9``, ``powernv10``, ``powernv11``) +================================================================================ PowerNV (as Non-Virtualized) is the "bare metal" platform using the OPAL firmware. It runs Linux on IBM and OpenPOWER systems and it can
@@ -15,11 +15,12 @@ beyond the scope of what QEMU addresses today. Supported devices ----------------- - * Multi processor support for POWER8, POWER8NVL and POWER9. + * Multi processor support for POWER8, POWER8NVL, POWER9, Power10 and Power11. * XSCOM, serial communication sideband bus to configure chiplets. * Simple LPC Controller. * Processor Service Interface (PSI) Controller. - * Interrupt Controller, XICS (POWER8) and XIVE (POWER9) and XIVE2 (Power10). + * Interrupt Controller, XICS (POWER8) and XIVE (POWER9) and XIVE2 (Power10 & + Power11). * POWER8 PHB3 PCIe Host bridge and POWER9 PHB4 PCIe Host bridge. * Simple OCC is an on-chip micro-controller used for power management tasks. * iBT device to handle BMC communication, with the internal BMC simulator
hw/ppc/pnv.c +116 -4
189 lines not on this page · raw message
hw/ppc/pnv_core.c +11 -0
@@ -372,6 +372,11 @@ static void pnv_core_power10_class_init(ObjectClass *oc, void *data) pcc->xscom_size =PNV10_XSCOM_EC_SIZE ; } +static void pnv_core_power11_class_init (ObjectClass *oc,void *data) +{ +pnv_core_power10_class_init (oc, data); +} +static void pnv_core_class_init (ObjectClass *oc,void *data) {DeviceClass *dc =DEVICE_CLASS (oc);
@@ -403,6 +408,7 @@ static const TypeInfo pnv_core_infos[] = {DEFINE_PNV_CORE_TYPE (power8,"power8nvl_v1.0" ),DEFINE_PNV_CORE_TYPE (power9,"power9_v2.2" ),DEFINE_PNV_CORE_TYPE (power10,"power10_v2.0" ), +DEFINE_PNV_CORE_TYPE (power11,"power11_v2.0" ), };DEFINE_TYPES (pnv_core_infos)
@@ -634,6 +640,11 @@ static const TypeInfo pnv_quad_infos[] = { .name = PNV_QUAD_TYPE_NAME("power10"), .class_init = pnv_quad_power10_class_init, }, + { + .parent = PNV_QUAD_TYPE_NAME("power10"), + .name = PNV_QUAD_TYPE_NAME("power11"), + .class_init = pnv_quad_power10_class_init, + }, };DEFINE_TYPES (pnv_quad_infos);
include/hw/ppc/pnv.h +5 -0
@@ -33,6 +33,7 @@ typedef struct PnvChip PnvChip;typedef struct Pnv8Chip Pnv8Chip ;typedef struct Pnv9Chip Pnv9Chip ;typedef struct Pnv10Chip Pnv10Chip ; +typedef struct Pnv10Chip Pnv11Chip ;#define PNV_CHIP_TYPE_SUFFIX "-" TYPE_PNV_CHIP#define PNV_CHIP_TYPE_NAME (cpu_model) cpu_model PNV_CHIP_TYPE_SUFFIX
@@ -57,6 +58,10 @@ DECLARE_INSTANCE_CHECKER(PnvChip, PNV_CHIP_POWER9,DECLARE_INSTANCE_CHECKER (PnvChip,PNV_CHIP_POWER10 , TYPE_PNV_CHIP_POWER10) +#define TYPE_PNV_CHIP_POWER11 PNV_CHIP_TYPE_NAME("power11_v2.0") +DECLARE_INSTANCE_CHECKER (PnvChip,PNV_CHIP_POWER11 , + TYPE_PNV_CHIP_POWER11) +PnvCore *pnv_chip_find_core (PnvChip *chip,uint32_t core_id);PowerPCCPU *pnv_chip_find_cpu (PnvChip *chip,uint32_t pir);
include/hw/ppc/pnv_chip.h +7 -0
@@ -132,6 +132,13 @@ struct Pnv10Chip {#define PNV10_PIR2FUSEDCORE (pir) (((pir) >> 3) & 0xf)#define PNV10_PIR2CHIP (pir) (((pir) >> 8) & 0x7f) +#define TYPE_PNV11_CHIP "pnv11-chip" +DECLARE_INSTANCE_CHECKER (Pnv11Chip,PNV11_CHIP , +TYPE_PNV11_CHIP ) + +/* Power11 core is same as Power10 */ +typedef struct Pnv10Chip Pnv11Chip ; +struct PnvChipClass {/*< private >*/ SysBusDeviceClass parent_class;
include/hw/ppc/pnv_core.h +1 -0
@@ -76,6 +76,7 @@ struct PnvQuadClass {#define PNV_QUAD_TYPE_SUFFIX "-" TYPE_PNV_QUAD#define PNV_QUAD_TYPE_NAME (cpu_model) cpu_model PNV_QUAD_TYPE_SUFFIX +#define PNV_QUAD_TYPE_NAME_DYN (cpu) g_strconcat(cpu, PNV_QUAD_TYPE_SUFFIX, NULL)OBJECT_DECLARE_TYPE (PnvQuad, PnvQuadClass,PNV_QUAD )
Signature · 1 line
2.45.1
Re: [PATCH v4 05/11] ppc/pnv: Add a Power11 Pnv11Chip, and a Power11 Machine
Hello Aditya
Quoted 3 lines · Aditya Gupta
Power11 core is same as Power10, use the existing functionalities to introduce a Power11 chip and machine, with Power10 chip as parent of Power11 chip, thus going through similar
class_initpaths
This patch should come last, after all the POWER11 processor sub-unit models (HOMER, OCC, LPC) are implemented. Also the POWER11 chip model lacks an instance_init() handler initializing the chip children to the correct POWER11 types.
AFAICT, power11-pnv-chip is still using power10 types.
More below,
Quoted 49 lines
Cc Cédric Le Goater <[email protected]>Cc Frédéric Barrat <[email protected]>Cc Mahesh J Salgaonkar <[email protected]>Cc Madhavan Srinivasan <[email protected]>Cc Nicholas Piggin <[email protected]>Signed-off-by Aditya Gupta <[email protected]>--- docs/system/ppc/powernv.rst | 9 +-- hw/ppc/pnv.c | 120 ++++++++++++++++++++++++++++++++++-- hw/ppc/pnv_core.c | 11 ++++ include/hw/ppc/pnv.h | 5 ++ include/hw/ppc/pnv_chip.h | 7 +++ include/hw/ppc/pnv_core.h | 1 + 6 files changed, 145 insertions(+), 8 deletions(-)docs/system/ppc/powernv.rst +5
-4@@ -1,5 +1,5 @@ -PowerNV family boards (``powernv8``, ``powernv9``, ``powernv10``) -================================================================== +PowerNV family boards (``powernv8``, ``powernv9``, ``powernv10``, ``powernv11``) +================================================================================ PowerNV (as Non-Virtualized) is the "bare metal" platform using the OPAL firmware. It runs Linux on IBM and OpenPOWER systems and it can@@ -15,11 +15,12 @@ beyond the scope of what QEMU addresses today. Supported devices ----------------- - * Multi processor support for POWER8, POWER8NVL and POWER9. + * Multi processor support for POWER8, POWER8NVL, POWER9, Power10 and Power11. * XSCOM, serial communication sideband bus to configure chiplets. * Simple LPC Controller. * Processor Service Interface (PSI) Controller. - * Interrupt Controller, XICS (POWER8) and XIVE (POWER9) and XIVE2 (Power10). + * Interrupt Controller, XICS (POWER8) and XIVE (POWER9) and XIVE2 (Power10 & + Power11). * POWER8 PHB3 PCIe Host bridge and POWER9 PHB4 PCIe Host bridge. * Simple OCC is an on-chip micro-controller used for power management tasks. * iBT device to handle BMC communication, with the internal BMC simulatorhw/ppc/pnv.c +0
-0@@ -456,6 +456,33 @@ static void pnv_chip_power10_dt_populate(PnvChip *chip, void *fdt)pnv_dt_lpc (chip, fdt,0 ,PNV10_LPCM_BASE (chip),PNV10_LPCM_SIZE );
hw/ppc/pnv.c static void pnv_chip_power10_dt_populate(PnvChip *chip, void *fdt) · line 466
Quoted 10 lines
hw/ppc/pnv.c +8
-0} +static void pnv_chip_power11_dt_populate (PnvChip *chip,void *fdt) +{ +static const char compat[] ="ibm,power11-xscom\0ibm,xscom" ; +int i; + + pnv_dt_xscom(chip, fdt, 0, + cpu_to_be64(PNV10_XSCOM_BASE(chip)), + cpu_to_be64(PNV10_XSCOM_SIZE),
I wonder if we should not duplicate the PNV10 macros in PNV11. It's minor.
Quoted 7 lines
hw/ppc/pnv.c +7
-0+ compat, sizeof(compat)); + +for (i =0 ; i < chip->nr_cores; i++) { +PnvCore *pnv_core = chip->cores[i]; +int offset; + + offset =pnv_dt_core (chip, pnv_core, fdt);
hw/ppc/pnv.c static void pnv_chip_power10_dt_populate(PnvChip *chip, void *fdt) · line 483
Quoted 10 lines
hw/ppc/pnv.c +10
-0+ +_FDT ((fdt_setprop (fdt, offset,"ibm,pa-features" , + pa_features_31,sizeof (pa_features_31)))); + } + +if (chip->ram_size) { +pnv_dt_memory (fdt, chip->chip_id, chip->ram_start, chip->ram_size); + } + +pnv_dt_lpc (chip, fdt,0 ,PNV10_LPCM_BASE (chip),PNV10_LPCM_SIZE );
ditto
Quoted 15 lines
hw/ppc/pnv.c +4
-0+} +static void pnv_dt_rtc (ISADevice *d,void *fdt,int lpc_off) {uint32_t io_base = d->ioport_id;@@ -1288,6 +1315,8 @@ static void pnv_chip_power10_intc_print_info(PnvChip *chip, PowerPCCPU *cpu,#define POWER10_CORE_MASK (0xffffffffffffffull) +#define POWER11_CORE_MASK (0xffffffffffffffull) +static void pnv_chip_power8_instance_init (Object *obj) {Pnv8Chip *chip8 =PNV8_CHIP (obj);
hw/ppc/pnv.c static void pnv_chip_power10_instance_init(Object *obj) · line 1863
Quoted 5 lines
hw/ppc/pnv.c +1
-1@@ -1831,7 +1860,8 @@ static void pnv_chip_power10_instance_init(Object *obj) } } -static void pnv_chip_power10_quad_realize (Pnv10Chip *chip10,Error **errp) +static void pnv_chip_power10_quad_realize(Pnv10Chip *chip10, Error **errp,
Rename in pnv_chip_power1x_quad_realize may be ? same below.
hw/ppc/pnv.c static void pnv_chip_power10_quad_realize(Pnv10Chip *chip10, Error **errp) · line 1874
Quoted 9 lines
hw/ppc/pnv.c +2
-0+ const char *cpu_model) {PnvChip *chip =PNV_CHIP (chip10);int i;@@ -1841,9 +1871,10 @@ static void pnv_chip_power10_quad_realize(Pnv10Chip *chip10, Error **errp)for (i =0 ; i < chip10->nr_quads; i++) {PnvQuad *eq = &chip10->quads[i]; + g_autofree char *type_name = PNV_QUAD_TYPE_NAME_DYN(cpu_model);
and PNV_QUAD_TYPE_NAME_DYN becomes quite useless now.
Thanks,
C.
Quoted 231 lines
hw/ppc/pnv.c +84
-3pnv_chip_quad_realize_one (chip, eq, chip->cores[i *4 ], -PNV_QUAD_TYPE_NAME ("power10" )); + type_name);pnv_xscom_add_subregion (chip,PNV10_XSCOM_EQ_BASE (eq->quad_id), &eq->xscom_regs);@@ -1881,7 +1912,8 @@ static void pnv_chip_power10_phb_realize(PnvChip *chip, Error **errp) } } -static void pnv_chip_power10_realize (DeviceState *dev,Error **errp) +static void pnv_chip_power10_common_realize (DeviceState *dev,Error **errp, +const char *cpu_model) {PnvChipClass *pcc =PNV_CHIP_GET_CLASS (dev);PnvChip *chip =PNV_CHIP (dev);@@ -1898,7 +1930,7 @@ static void pnv_chip_power10_realize(DeviceState *dev, Error **errp)return ; } -pnv_chip_power10_quad_realize (chip10, &local_err); +pnv_chip_power10_quad_realize (chip10, &local_err, cpu_model);if (local_err) {error_propagate (errp, local_err);return ;@@ -2046,6 +2078,16 @@ static void pnv_chip_power10_realize(DeviceState *dev, Error **errp) } +static void pnv_chip_power10_realize (DeviceState *dev,Error **errp) +{ +pnv_chip_power10_common_realize (dev, errp,"power10" ); +} + +static void pnv_chip_power11_realize (DeviceState *dev,Error **errp) +{ +pnv_chip_power10_common_realize (dev, errp,"power11" ); +} +static void pnv_rainier_i2c_init (PnvMachineState *pnv) {int i;@@ -2111,6 +2153,34 @@ static void pnv_chip_power10_class_init(ObjectClass *klass, void *data) &k->parent_realize); } +static void pnv_chip_power11_class_init (ObjectClass *klass,void *data) +{ +DeviceClass *dc =DEVICE_CLASS (klass); +PnvChipClass *k =PNV_CHIP_CLASS (klass); + +static const int i2c_ports_per_engine[PNV10_CHIP_MAX_I2C ] = {14 ,14 ,2 ,16 }; + + k->chip_cfam_id =0x220da04980000000ull ;/* P11 DD2.0 (with NX) */ + k->cores_mask =POWER11_CORE_MASK ; + k->chip_pir = pnv_chip_pir_p10; + k->intc_create = pnv_chip_power10_intc_create; + k->intc_reset = pnv_chip_power10_intc_reset; + k->intc_destroy = pnv_chip_power10_intc_destroy; + k->intc_print_info = pnv_chip_power10_intc_print_info; + k->isa_create = pnv_chip_power10_isa_create; + k->dt_populate = pnv_chip_power11_dt_populate; + k->pic_print_info = pnv_chip_power10_pic_print_info; + k->xscom_core_base = pnv_chip_power10_xscom_core_base; + k->xscom_pcba = pnv_chip_power10_xscom_pcba; + dc->desc ="PowerNV Chip POWER11" ; + k->num_pecs =PNV10_CHIP_MAX_PEC ; + k->i2c_num_engines =PNV10_CHIP_MAX_I2C ; + k->i2c_ports_per_engine = i2c_ports_per_engine; + +device_class_set_parent_realize (dc, pnv_chip_power11_realize, + &k->parent_realize); +} +static void pnv_chip_core_sanitize (PnvChip *chip,Error **errp) {PnvChipClass *pcc =PNV_CHIP_GET_CLASS (chip);@@ -2505,6 +2575,22 @@ static void pnv_machine_p10_rainier_class_init(ObjectClass *oc, void *data) pmc->i2c_init = pnv_rainier_i2c_init; } +static void pnv_machine_power11_class_init (ObjectClass *oc,void *data) +{ +MachineClass *mc =MACHINE_CLASS (oc); +PnvMachineClass *pmc =PNV_MACHINE_CLASS (oc); +static const char compat[] ="qemu,powernv11\0ibm,powernv" ; + +/* do power10_class_init as p11 core is same as p10 */ +pnv_machine_p10_common_class_init (oc, data); + + mc->desc ="IBM PowerNV (Non-Virtualized) POWER11" ; + mc->default_cpu_type =POWERPC_CPU_TYPE_NAME ("power11_v2.0" ); + + pmc->compat = compat; + pmc->compat_size =sizeof (compat); +} +static bool pnv_machine_get_hb (Object *obj,Error **errp) {PnvMachineState *pnv =PNV_MACHINE (obj);@@ -2608,7 +2694,23 @@ static void pnv_machine_class_init(ObjectClass *oc, void *data) .parent = TYPE_PNV10_CHIP, \ } +#define DEFINE_PNV11_CHIP_TYPE (type, class_initfn) \ + { \ + .name = type, \ + .class_init = class_initfn, \ + .parent = TYPE_PNV11_CHIP, \ + } +static const TypeInfo types[] = { + { + .name =MACHINE_TYPE_NAME ("powernv11" ), + .parent =TYPE_PNV_MACHINE , + .class_init = pnv_machine_power11_class_init, + .interfaces = (InterfaceInfo []) { + {TYPE_XIVE_FABRIC }, + { }, + }, + }, { .name =MACHINE_TYPE_NAME ("powernv10-rainier" ), .parent =MACHINE_TYPE_NAME ("powernv10" ),@@ -2663,6 +2765,16 @@ static const TypeInfo types[] = { .abstract = true, }, +/* +* P11 chip and variants +*/ + { + .name = TYPE_PNV11_CHIP, + .parent = TYPE_PNV10_CHIP, + .instance_size =sizeof (Pnv11Chip), + }, + DEFINE_PNV11_CHIP_TYPE(TYPE_PNV_CHIP_POWER11, pnv_chip_power11_class_init), +/* * P10 chip and variants */ hw/ppc/pnv_core.c +11
-0@@ -372,6 +372,11 @@ static void pnv_core_power10_class_init(ObjectClass *oc, void *data) pcc->xscom_size =PNV10_XSCOM_EC_SIZE ; } +static void pnv_core_power11_class_init (ObjectClass *oc,void *data) +{ +pnv_core_power10_class_init (oc, data); +} +static void pnv_core_class_init (ObjectClass *oc,void *data) {DeviceClass *dc =DEVICE_CLASS (oc);@@ -403,6 +408,7 @@ static const TypeInfo pnv_core_infos[] = {DEFINE_PNV_CORE_TYPE (power8,"power8nvl_v1.0" ),DEFINE_PNV_CORE_TYPE (power9,"power9_v2.2" ),DEFINE_PNV_CORE_TYPE (power10,"power10_v2.0" ), +DEFINE_PNV_CORE_TYPE (power11,"power11_v2.0" ), };DEFINE_TYPES (pnv_core_infos)@@ -634,6 +640,11 @@ static const TypeInfo pnv_quad_infos[] = { .name = PNV_QUAD_TYPE_NAME("power10"), .class_init = pnv_quad_power10_class_init, }, + { + .parent = PNV_QUAD_TYPE_NAME("power10"), + .name = PNV_QUAD_TYPE_NAME("power11"), + .class_init = pnv_quad_power10_class_init, + }, };DEFINE_TYPES (pnv_quad_infos);include/hw/ppc/pnv.h +5
-0@@ -33,6 +33,7 @@ typedef struct PnvChip PnvChip;typedef struct Pnv8Chip Pnv8Chip ;typedef struct Pnv9Chip Pnv9Chip ;typedef struct Pnv10Chip Pnv10Chip ; +typedef struct Pnv10Chip Pnv11Chip ;#define PNV_CHIP_TYPE_SUFFIX "-" TYPE_PNV_CHIP#define PNV_CHIP_TYPE_NAME (cpu_model) cpu_model PNV_CHIP_TYPE_SUFFIX@@ -57,6 +58,10 @@ DECLARE_INSTANCE_CHECKER(PnvChip, PNV_CHIP_POWER9,DECLARE_INSTANCE_CHECKER (PnvChip,PNV_CHIP_POWER10 , TYPE_PNV_CHIP_POWER10) +#define TYPE_PNV_CHIP_POWER11 PNV_CHIP_TYPE_NAME("power11_v2.0") +DECLARE_INSTANCE_CHECKER (PnvChip,PNV_CHIP_POWER11 , + TYPE_PNV_CHIP_POWER11) +PnvCore *pnv_chip_find_core (PnvChip *chip,uint32_t core_id);PowerPCCPU *pnv_chip_find_cpu (PnvChip *chip,uint32_t pir);include/hw/ppc/pnv_chip.h +7
-0@@ -132,6 +132,13 @@ struct Pnv10Chip {#define PNV10_PIR2FUSEDCORE (pir) (((pir) >> 3) & 0xf)#define PNV10_PIR2CHIP (pir) (((pir) >> 8) & 0x7f) +#define TYPE_PNV11_CHIP "pnv11-chip" +DECLARE_INSTANCE_CHECKER (Pnv11Chip,PNV11_CHIP , +TYPE_PNV11_CHIP ) + +/* Power11 core is same as Power10 */ +typedef struct Pnv10Chip Pnv11Chip ; +struct PnvChipClass {/*< private >*/ SysBusDeviceClass parent_class;include/hw/ppc/pnv_core.h +1
-0@@ -76,6 +76,7 @@ struct PnvQuadClass {#define PNV_QUAD_TYPE_SUFFIX "-" TYPE_PNV_QUAD#define PNV_QUAD_TYPE_NAME (cpu_model) cpu_model PNV_QUAD_TYPE_SUFFIX +#define PNV_QUAD_TYPE_NAME_DYN (cpu) g_strconcat(cpu, PNV_QUAD_TYPE_SUFFIX, NULL)OBJECT_DECLARE_TYPE (PnvQuad, PnvQuadClass,PNV_QUAD )
Re: [PATCH v4 05/11] ppc/pnv: Add a Power11 Pnv11Chip, and a Power11 Machine
Hello Cedric,
Thanks for your reviews.
Quoted 7 lines · Cédric Le Goater
Hello Aditya
Quoted 3 lines · Aditya Gupta
Power11 core is same as Power10, use the existing functionalities to introduce a Power11 chip and machine, with Power10 chip as parent of Power11 chip, thus going through similar
class_initpaths
Quoted 6 lines
This patch should come last, after all the POWER11 processor sub-unit models (HOMER, OCC, LPC) are implemented. Also the POWER11 chip model lacks an
instance_init()handler initializing the chip children to the correct POWER11 types.AFAICT, power11-pnv-chip is still using power10 types.
Sure, I will move this patch to after all subunit patches. Thanks for the 'instance_init' advice, yes, seems the homer and everything else will be the power10 ones.
Quoted 53 lines
More below,
Quoted 50 lines
Cc Cédric Le Goater <[email protected]>Cc Frédéric Barrat <[email protected]>Cc Mahesh J Salgaonkar <[email protected]>Cc Madhavan Srinivasan <[email protected]>Cc Nicholas Piggin <[email protected]>Signed-off-by Aditya Gupta <[email protected]>--- docs/system/ppc/powernv.rst | 9 +-- hw/ppc/pnv.c | 120 ++++++++++++++++++++++++++++++++++-- hw/ppc/pnv_core.c | 11 ++++ include/hw/ppc/pnv.h | 5 ++ include/hw/ppc/pnv_chip.h | 7 +++ include/hw/ppc/pnv_core.h | 1 + 6 files changed, 145 insertions(+), 8 deletions(-)docs/system/ppc/powernv.rst +5
-4@@ -1,5 +1,5 @@ -PowerNV family boards (``powernv8``, ``powernv9``, ``powernv10``) -================================================================== +PowerNV family boards (``powernv8``, ``powernv9``, ``powernv10``, ``powernv11``) +================================================================================ PowerNV (as Non-Virtualized) is the "bare metal" platform using the OPAL firmware. It runs Linux on IBM and OpenPOWER systems and it can@@ -15,11 +15,12 @@ beyond the scope of what QEMU addresses today. Supported devices ----------------- - * Multi processor support for POWER8, POWER8NVL and POWER9. + * Multi processor support for POWER8, POWER8NVL, POWER9, Power10 and Power11. * XSCOM, serial communication sideband bus to configure chiplets. * Simple LPC Controller. * Processor Service Interface (PSI) Controller. - * Interrupt Controller, XICS (POWER8) and XIVE (POWER9) and XIVE2 (Power10). + * Interrupt Controller, XICS (POWER8) and XIVE (POWER9) and XIVE2 (Power10 & + Power11). * POWER8 PHB3 PCIe Host bridge and POWER9 PHB4 PCIe Host bridge. * Simple OCC is an on-chip micro-controller used for power management tasks. * iBT device to handle BMC communication, with the internal BMC simulatorhw/ppc/pnv.c +2
-0@@ -456,6 +456,33 @@ static void pnv_chip_power10_dt_populate(PnvChip *chip, void *fdt)pnv_dt_lpc (chip, fdt,0 ,PNV10_LPCM_BASE (chip),PNV10_LPCM_SIZE ); } +static void pnv_chip_power11_dt_populate (PnvChip *chip,void *fdt) +{
Quoted 8 lines
hw/ppc/pnv.c static void pnv_chip_power10_dt_populate(PnvChip *chip, void *fdt) · line 466
Quoted 6 lines
hw/ppc/pnv.c +6
-0+static const char compat[] ="ibm,power11-xscom\0ibm,xscom" ; +int i; + + pnv_dt_xscom(chip, fdt, 0, + cpu_to_be64(PNV10_XSCOM_BASE(chip)), + cpu_to_be64(PNV10_XSCOM_SIZE),I wonder if we should not duplicate the PNV10 macros in PNV11. It's minor.
I can. Will do.
Quoted 12 lines
Quoted 12 lines
hw/ppc/pnv.c +11
-0+ compat, sizeof(compat)); + +for (i =0 ; i < chip->nr_cores; i++) { +PnvCore *pnv_core = chip->cores[i]; +int offset; + + offset =pnv_dt_core (chip, pnv_core, fdt); + +_FDT ((fdt_setprop (fdt, offset,"ibm,pa-features" , + pa_features_31,sizeof (pa_features_31)))); + }
Quoted 8 lines
hw/ppc/pnv.c static void pnv_chip_power10_dt_populate(PnvChip *chip, void *fdt) · line 483
Quoted 6 lines
hw/ppc/pnv.c +6
-0+ +if (chip->ram_size) { +pnv_dt_memory (fdt, chip->chip_id, chip->ram_start, chip->ram_size); + } + +pnv_dt_lpc (chip, fdt,0 ,PNV10_LPCM_BASE (chip),PNV10_LPCM_SIZE );ditto
Will create new defines for these.
Quoted 12 lines
Quoted 12 lines
hw/ppc/pnv.c +4
-0+} +static void pnv_dt_rtc (ISADevice *d,void *fdt,int lpc_off) {uint32_t io_base = d->ioport_id;@@ -1288,6 +1315,8 @@ static void pnv_chip_power10_intc_print_info(PnvChip *chip, PowerPCCPU *cpu,#define POWER10_CORE_MASK (0xffffffffffffffull) +#define POWER11_CORE_MASK (0xffffffffffffffull) +static void pnv_chip_power8_instance_init (Object *obj) {
Quoted 8 lines
hw/ppc/pnv.c static void pnv_chip_power10_instance_init(Object *obj) · line 1862
Quoted 6 lines
hw/ppc/pnv.c +1
-1Pnv8Chip *chip8 =PNV8_CHIP (obj);@@ -1831,7 +1860,8 @@ static void pnv_chip_power10_instance_init(Object *obj) } } -static void pnv_chip_power10_quad_realize (Pnv10Chip *chip10,Error **errp) +static void pnv_chip_power10_quad_realize(Pnv10Chip *chip10, Error **errp,Rename in
pnv_chip_power1x_quad_realizemay be ? same below.
Will rename it.
Quoted 11 lines
hw/ppc/pnv.c static void pnv_chip_power10_quad_realize(Pnv10Chip *chip10, Error **errp) · line 1873
Quoted 9 lines
hw/ppc/pnv.c +2
-0+ const char *cpu_model) {PnvChip *chip =PNV_CHIP (chip10);int i;@@ -1841,9 +1871,10 @@ static void pnv_chip_power10_quad_realize(Pnv10Chip *chip10, Error **errp)for (i =0 ; i < chip10->nr_quads; i++) {PnvQuad *eq = &chip10->quads[i]; + g_autofree char *type_name = PNV_QUAD_TYPE_NAME_DYN(cpu_model);and
PNV_QUAD_TYPE_NAME_DYNbecomes quite useless now.
Agreed, will expand the macro here itself.
Thanks,
- Aditya Gupta
Quoted 220 lines
Thanks,
C.
Quoted 211 lines
hw/ppc/pnv.c +84
-3pnv_chip_quad_realize_one (chip, eq, chip->cores[i *4 ], -PNV_QUAD_TYPE_NAME ("power10" )); + type_name);pnv_xscom_add_subregion (chip,PNV10_XSCOM_EQ_BASE (eq->quad_id), &eq->xscom_regs);@@ -1881,7 +1912,8 @@ static void pnv_chip_power10_phb_realize(PnvChip *chip, Error **errp) } } -static void pnv_chip_power10_realize (DeviceState *dev,Error **errp) +static void pnv_chip_power10_common_realize (DeviceState *dev,Error **errp, +const char *cpu_model) {PnvChipClass *pcc =PNV_CHIP_GET_CLASS (dev);PnvChip *chip =PNV_CHIP (dev);@@ -1898,7 +1930,7 @@ static void pnv_chip_power10_realize(DeviceState *dev, Error **errp)return ; } -pnv_chip_power10_quad_realize (chip10, &local_err); +pnv_chip_power10_quad_realize (chip10, &local_err, cpu_model);if (local_err) {error_propagate (errp, local_err);return ;@@ -2046,6 +2078,16 @@ static void pnv_chip_power10_realize(DeviceState *dev, Error **errp) } +static void pnv_chip_power10_realize (DeviceState *dev,Error **errp) +{ +pnv_chip_power10_common_realize (dev, errp,"power10" ); +} + +static void pnv_chip_power11_realize (DeviceState *dev,Error **errp) +{ +pnv_chip_power10_common_realize (dev, errp,"power11" ); +} +static void pnv_rainier_i2c_init (PnvMachineState *pnv) {int i;@@ -2111,6 +2153,34 @@ static void pnv_chip_power10_class_init(ObjectClass *klass, void *data) &k->parent_realize); } +static void pnv_chip_power11_class_init (ObjectClass *klass,void *data) +{ +DeviceClass *dc =DEVICE_CLASS (klass); +PnvChipClass *k =PNV_CHIP_CLASS (klass); + +static const int i2c_ports_per_engine[PNV10_CHIP_MAX_I2C ] = {14 ,14 ,2 ,16 }; + + k->chip_cfam_id =0x220da04980000000ull ;/* P11 DD2.0 (with NX) */ + k->cores_mask =POWER11_CORE_MASK ; + k->chip_pir = pnv_chip_pir_p10; + k->intc_create = pnv_chip_power10_intc_create; + k->intc_reset = pnv_chip_power10_intc_reset; + k->intc_destroy = pnv_chip_power10_intc_destroy; + k->intc_print_info = pnv_chip_power10_intc_print_info; + k->isa_create = pnv_chip_power10_isa_create; + k->dt_populate = pnv_chip_power11_dt_populate; + k->pic_print_info = pnv_chip_power10_pic_print_info; + k->xscom_core_base = pnv_chip_power10_xscom_core_base; + k->xscom_pcba = pnv_chip_power10_xscom_pcba; + dc->desc ="PowerNV Chip POWER11" ; + k->num_pecs =PNV10_CHIP_MAX_PEC ; + k->i2c_num_engines =PNV10_CHIP_MAX_I2C ; + k->i2c_ports_per_engine = i2c_ports_per_engine; + +device_class_set_parent_realize (dc, pnv_chip_power11_realize, + &k->parent_realize); +} +static void pnv_chip_core_sanitize (PnvChip *chip,Error **errp) {PnvChipClass *pcc =PNV_CHIP_GET_CLASS (chip);@@ -2505,6 +2575,22 @@ static void pnv_machine_p10_rainier_class_init(ObjectClass *oc, void *data) pmc->i2c_init = pnv_rainier_i2c_init; } +static void pnv_machine_power11_class_init (ObjectClass *oc,void *data) +{ +MachineClass *mc =MACHINE_CLASS (oc); +PnvMachineClass *pmc =PNV_MACHINE_CLASS (oc); +static const char compat[] ="qemu,powernv11\0ibm,powernv" ; + +/* do power10_class_init as p11 core is same as p10 */ +pnv_machine_p10_common_class_init (oc, data); + + mc->desc ="IBM PowerNV (Non-Virtualized) POWER11" ; + mc->default_cpu_type =POWERPC_CPU_TYPE_NAME ("power11_v2.0" ); + + pmc->compat = compat; + pmc->compat_size =sizeof (compat); +} +static bool pnv_machine_get_hb (Object *obj,Error **errp) {PnvMachineState *pnv =PNV_MACHINE (obj);@@ -2608,7 +2694,23 @@ static void pnv_machine_class_init(ObjectClass *oc, void *data) .parent = TYPE_PNV10_CHIP, \ } +#define DEFINE_PNV11_CHIP_TYPE (type, class_initfn) \ + { \ + .name = type, \ + .class_init = class_initfn, \ + .parent = TYPE_PNV11_CHIP, \ + } +static const TypeInfo types[] = { + { + .name =MACHINE_TYPE_NAME ("powernv11" ), + .parent =TYPE_PNV_MACHINE , + .class_init = pnv_machine_power11_class_init, + .interfaces = (InterfaceInfo []) { + {TYPE_XIVE_FABRIC }, + { }, + }, + }, { .name =MACHINE_TYPE_NAME ("powernv10-rainier" ), .parent =MACHINE_TYPE_NAME ("powernv10" ),@@ -2663,6 +2765,16 @@ static const TypeInfo types[] = { .abstract = true, }, +/* +* P11 chip and variants +*/ + { + .name = TYPE_PNV11_CHIP, + .parent = TYPE_PNV10_CHIP, + .instance_size =sizeof (Pnv11Chip), + }, + DEFINE_PNV11_CHIP_TYPE(TYPE_PNV_CHIP_POWER11, pnv_chip_power11_class_init), +/* * P10 chip and variants */ hw/ppc/pnv_core.c +11
-0@@ -372,6 +372,11 @@ static void pnv_core_power10_class_init(ObjectClass *oc, void *data) pcc->xscom_size =PNV10_XSCOM_EC_SIZE ; } +static void pnv_core_power11_class_init (ObjectClass *oc,void *data) +{ +pnv_core_power10_class_init (oc, data); +} +static void pnv_core_class_init (ObjectClass *oc,void *data) {DeviceClass *dc =DEVICE_CLASS (oc);@@ -403,6 +408,7 @@ static const TypeInfo pnv_core_infos[] = {DEFINE_PNV_CORE_TYPE (power8,"power8nvl_v1.0" ),DEFINE_PNV_CORE_TYPE (power9,"power9_v2.2" ),DEFINE_PNV_CORE_TYPE (power10,"power10_v2.0" ), +DEFINE_PNV_CORE_TYPE (power11,"power11_v2.0" ), };DEFINE_TYPES (pnv_core_infos)@@ -634,6 +640,11 @@ static const TypeInfo pnv_quad_infos[] = { .name = PNV_QUAD_TYPE_NAME("power10"), .class_init = pnv_quad_power10_class_init, }, + { + .parent = PNV_QUAD_TYPE_NAME("power10"), + .name = PNV_QUAD_TYPE_NAME("power11"), + .class_init = pnv_quad_power10_class_init, + }, };DEFINE_TYPES (pnv_quad_infos);include/hw/ppc/pnv.h +5
-0@@ -33,6 +33,7 @@ typedef struct PnvChip PnvChip;typedef struct Pnv8Chip Pnv8Chip ;typedef struct Pnv9Chip Pnv9Chip ;typedef struct Pnv10Chip Pnv10Chip ; +typedef struct Pnv10Chip Pnv11Chip ;#define PNV_CHIP_TYPE_SUFFIX "-" TYPE_PNV_CHIP#define PNV_CHIP_TYPE_NAME (cpu_model) cpu_model PNV_CHIP_TYPE_SUFFIX@@ -57,6 +58,10 @@ DECLARE_INSTANCE_CHECKER(PnvChip, PNV_CHIP_POWER9,DECLARE_INSTANCE_CHECKER (PnvChip,PNV_CHIP_POWER10 , TYPE_PNV_CHIP_POWER10) +#define TYPE_PNV_CHIP_POWER11 PNV_CHIP_TYPE_NAME("power11_v2.0") +DECLARE_INSTANCE_CHECKER (PnvChip,PNV_CHIP_POWER11 , + TYPE_PNV_CHIP_POWER11) +PnvCore *pnv_chip_find_core (PnvChip *chip,uint32_t core_id);PowerPCCPU *pnv_chip_find_cpu (PnvChip *chip,uint32_t pir);include/hw/ppc/pnv_chip.h +7
-0@@ -132,6 +132,13 @@ struct Pnv10Chip {#define PNV10_PIR2FUSEDCORE (pir) (((pir) >> 3) & 0xf)#define PNV10_PIR2CHIP (pir) (((pir) >> 8) & 0x7f) +#define TYPE_PNV11_CHIP "pnv11-chip" +DECLARE_INSTANCE_CHECKER (Pnv11Chip,PNV11_CHIP , +TYPE_PNV11_CHIP ) + +/* Power11 core is same as Power10 */ +typedef struct Pnv10Chip Pnv11Chip ; +struct PnvChipClass {/*< private >*/ SysBusDeviceClass parent_class;include/hw/ppc/pnv_core.h +1
-0@@ -76,6 +76,7 @@ struct PnvQuadClass {#define PNV_QUAD_TYPE_SUFFIX "-" TYPE_PNV_QUAD#define PNV_QUAD_TYPE_NAME (cpu_model) cpu_model PNV_QUAD_TYPE_SUFFIX +#define PNV_QUAD_TYPE_NAME_DYN (cpu) g_strconcat(cpu, PNV_QUAD_TYPE_SUFFIX, NULL)OBJECT_DECLARE_TYPE (PnvQuad, PnvQuadClass,PNV_QUAD )
PATCH v4 6/11 ppc/pnv: Add HOMER for POWER11
In reply to Aditya GuptaPower11 core is same as Power10, declare PNV11_HOMER as a child class of PNV10_HOMER, so it goes through same class init
--- hw/ppc/pnv_homer.c | 8 ++++++++ include/hw/ppc/pnv_homer.h | 3 +++ 2 files changed, 11 insertions(+)
hw/ppc/pnv_homer.c +8 -0
@@ -394,6 +394,13 @@ static const TypeInfo pnv_homer_power10_type_info = { .parent = TYPE_PNV_HOMER, .instance_size = sizeof(PnvHomer), .class_init = pnv_homer_power10_class_init, + .class_base_init = pnv_homer_power10_class_init, +}; + +static const TypeInfo pnv_homer_power11_type_info = { + .name =TYPE_PNV11_HOMER , + .parent =TYPE_PNV10_HOMER , + .instance_size =sizeof (PnvHomer), };static void pnv_homer_realize (DeviceState *dev,Error **errp)
@@ -442,6 +449,7 @@ static void pnv_homer_register_types(void)type_register_static (&pnv_homer_power8_type_info);type_register_static (&pnv_homer_power9_type_info);type_register_static (&pnv_homer_power10_type_info); +type_register_static (&pnv_homer_power11_type_info); }type_init (pnv_homer_register_types);
include/hw/ppc/pnv_homer.h +3 -0
@@ -35,6 +35,9 @@ DECLARE_INSTANCE_CHECKER(PnvHomer, PNV9_HOMER,#define TYPE_PNV10_HOMER TYPE_PNV_HOMER "-POWER10"DECLARE_INSTANCE_CHECKER (PnvHomer,PNV10_HOMER , TYPE_PNV10_HOMER) +#define TYPE_PNV11_HOMER TYPE_PNV_HOMER "-POWER11" +DECLARE_INSTANCE_CHECKER (PnvHomer,PNV11_HOMER , + TYPE_PNV11_HOMER)struct PnvHomer {DeviceState parent;
Signature · 1 line
2.45.1
PATCH v4 7/11 ppc/pnv: Add a LPC controller for POWER11
In reply to Aditya GuptaPower11 core is same as Power10 core, declare PNV11_LPC as a child class of PNV10_LPC, so it goes through same class init
--- hw/ppc/pnv_lpc.c | 14 ++++++++++++++ include/hw/ppc/pnv_lpc.h | 4 ++++ 2 files changed, 18 insertions(+)
hw/ppc/pnv_lpc.c +14 -0
@@ -698,6 +698,19 @@ static const TypeInfo pnv_lpc_power10_info = { .class_init = pnv_lpc_power10_class_init, }; +static void pnv_lpc_power11_class_init (ObjectClass *klass,void *data) +{ +DeviceClass *dc =DEVICE_CLASS (klass); + + dc->desc ="PowerNV LPC Controller POWER11" ; +} + +static const TypeInfo pnv_lpc_power11_info = { + .name =TYPE_PNV11_LPC , + .parent =TYPE_PNV10_LPC , + .class_init = pnv_lpc_power11_class_init, +}; +static void pnv_lpc_realize (DeviceState *dev,Error **errp) {PnvLpcController *lpc =PNV_LPC (dev);
@@ -771,6 +784,7 @@ static void pnv_lpc_register_types(void)type_register_static (&pnv_lpc_power8_info);type_register_static (&pnv_lpc_power9_info);type_register_static (&pnv_lpc_power10_info); +type_register_static (&pnv_lpc_power11_info); }type_init (pnv_lpc_register_types)
include/hw/ppc/pnv_lpc.h +4 -0
@@ -41,6 +41,10 @@ DECLARE_INSTANCE_CHECKER(PnvLpcController, PNV9_LPC,DECLARE_INSTANCE_CHECKER (PnvLpcController,PNV10_LPC , TYPE_PNV10_LPC) +#define TYPE_PNV11_LPC TYPE_PNV_LPC "-POWER11" +DECLARE_INSTANCE_CHECKER (PnvLpcController,PNV11_LPC , + TYPE_PNV11_LPC) +struct PnvLpcController {DeviceState parent;
Signature · 1 line
2.45.1
PATCH v4 8/11 ppc/pnv: Add OCC for Power11
In reply to Aditya GuptaPower11 core is same as Power10, reuse PNV10_OCC initialisation, by declaring PNV11_OCC as child class of PNV10_OCC
--- hw/ppc/pnv_occ.c | 14 ++++++++++++++ include/hw/ppc/pnv_occ.h | 2 ++ 2 files changed, 16 insertions(+)
hw/ppc/pnv_occ.c +14 -0
@@ -262,6 +262,19 @@ static const TypeInfo pnv_occ_power10_type_info = { .class_init = pnv_occ_power10_class_init, }; +static void pnv_occ_power11_class_init (ObjectClass *klass,void *data) +{ +DeviceClass *dc =DEVICE_CLASS (klass); + + dc->desc ="PowerNV OCC Controller (POWER11)" ; +} + +static const TypeInfo pnv_occ_power11_type_info = { + .name =TYPE_PNV11_OCC , + .parent =TYPE_PNV10_OCC , + .class_init = pnv_occ_power11_class_init, +}; +static void pnv_occ_realize (DeviceState *dev,Error **errp) {PnvOCC *occ =PNV_OCC (dev);
@@ -305,6 +318,7 @@ static void pnv_occ_register_types(void)type_register_static (&pnv_occ_power8_type_info);type_register_static (&pnv_occ_power9_type_info);type_register_static (&pnv_occ_power10_type_info); +type_register_static (&pnv_occ_power11_type_info); }type_init (pnv_occ_register_types);
include/hw/ppc/pnv_occ.h +2 -0
@@ -34,6 +34,8 @@ DECLARE_INSTANCE_CHECKER(PnvOCC, PNV9_OCC, TYPE_PNV9_OCC) #define TYPE_PNV10_OCC TYPE_PNV_OCC "-POWER10" DECLARE_INSTANCE_CHECKER(PnvOCC, PNV10_OCC, TYPE_PNV10_OCC) +#define TYPE_PNV11_OCC TYPE_PNV_OCC "-POWER11" +DECLARE_INSTANCE_CHECKER(PnvOCC, PNV11_OCC, TYPE_PNV11_OCC)#define PNV_OCC_SENSOR_DATA_BLOCK_OFFSET 0x00580000#define PNV_OCC_SENSOR_DATA_BLOCK_SIZE 0x00025800
Signature · 1 line
2.45.1
PATCH v4 9/11 ppc/pnv: Add a PSI bridge model for Power11
In reply to Aditya GuptaPower11 core is same as Power10, reuse PNV10_PSI initialisation, by declaring 'PNV11_PSI' as child class of 'PNV10_PSI'
--- hw/ppc/pnv_psi.c | 24 ++++++++++++++++++++++++ include/hw/ppc/pnv_psi.h | 2 ++ 2 files changed, 26 insertions(+)
hw/ppc/pnv_psi.c +24 -0
@@ -939,6 +939,29 @@ static const TypeInfo pnv_psi_power10_info = { .name = TYPE_PNV10_PSI, .parent = TYPE_PNV9_PSI, .class_init = pnv_psi_power10_class_init, + .class_base_init = pnv_psi_power10_class_init, +}; + +static void pnv_psi_power11_class_init (ObjectClass *klass,void *data) +{ +DeviceClass *dc =DEVICE_CLASS (klass); +PnvPsiClass *ppc =PNV_PSI_CLASS (klass); +static const char compat[] ="ibm,power11-psihb-x\0ibm,psihb-x" ; + + dc->desc ="PowerNV PSI Controller POWER11" ; + +/* +* ppc->xscom_pbca and ppc->xscom_size will be set up by +* pnv_psi_power10_class_init +*/ + ppc->compat = compat; + ppc->compat_size =sizeof (compat); +} + +static const TypeInfo pnv_psi_power11_info = { + .name =TYPE_PNV11_PSI , + .parent =TYPE_PNV10_PSI , + .class_init = pnv_psi_power11_class_init, };static void pnv_psi_class_init (ObjectClass *klass,void *data)
@@ -973,6 +996,7 @@ static void pnv_psi_register_types(void)type_register_static (&pnv_psi_power8_info);type_register_static (&pnv_psi_power9_info);type_register_static (&pnv_psi_power10_info); +type_register_static (&pnv_psi_power11_info); }type_init (pnv_psi_register_types);
include/hw/ppc/pnv_psi.h +2 -0
@@ -70,6 +70,8 @@ struct Pnv9Psi {#define TYPE_PNV10_PSI TYPE_PNV_PSI "-POWER10" +#define TYPE_PNV11_PSI TYPE_PNV_PSI "-POWER11" +struct PnvPsiClass {SysBusDeviceClass parent_class;
Signature · 1 line
2.45.1
PATCH v4 10/11 ppc/pnv: Add SBE model for Power11
In reply to Aditya GuptaPower11 core is same as Power10, reuse PNV10_SBER initialisation, by declaring PNV11_PSI as child class of PNV10_PSI
--- hw/ppc/pnv_sbe.c | 15 +++++++++++++++ include/hw/ppc/pnv_sbe.h | 2 ++ 2 files changed, 17 insertions(+)
hw/ppc/pnv_sbe.c +15 -0
@@ -366,6 +366,20 @@ static const TypeInfo pnv_sbe_power10_type_info = { .name = TYPE_PNV10_SBE, .parent = TYPE_PNV9_SBE, .class_init = pnv_sbe_power10_class_init, + .class_base_init = pnv_sbe_power10_class_init, +}; + +static void pnv_sbe_power11_class_init (ObjectClass *klass,void *data) +{ +DeviceClass *dc =DEVICE_CLASS (klass); + + dc->desc ="PowerNV SBE Controller (POWER11)" ; +} + +static const TypeInfo pnv_sbe_power11_type_info = { + .name =TYPE_PNV11_SBE , + .parent =TYPE_PNV10_SBE , + .class_init = pnv_sbe_power11_class_init, };static void pnv_sbe_realize (DeviceState *dev,Error **errp)
@@ -409,6 +423,7 @@ static void pnv_sbe_register_types(void)type_register_static (&pnv_sbe_type_info);type_register_static (&pnv_sbe_power9_type_info);type_register_static (&pnv_sbe_power10_type_info); +type_register_static (&pnv_sbe_power11_type_info); }type_init (pnv_sbe_register_types);
include/hw/ppc/pnv_sbe.h +2 -0
@@ -29,6 +29,8 @@ OBJECT_DECLARE_TYPE(PnvSBE, PnvSBEClass, PNV_SBE) DECLARE_INSTANCE_CHECKER(PnvSBE, PNV9_SBE, TYPE_PNV9_SBE)#define TYPE_PNV10_SBE TYPE_PNV_SBE "-POWER10" DECLARE_INSTANCE_CHECKER(PnvSBE, PNV10_SBE, TYPE_PNV10_SBE) +#define TYPE_PNV11_SBE TYPE_PNV_SBE "-POWER11" +DECLARE_INSTANCE_CHECKER(PnvSBE, PNV11_SBE, TYPE_PNV11_SBE)struct PnvSBE {DeviceState xd;
Signature · 1 line
2.45.1
PATCH v4 11/11 ppc/pnv: Update skiboot.lid to support Power11
In reply to Aditya GuptaSkiboot/OPAL patches are in discussion upstream [1], with corresponding commits in github repository [2].
Update skiboot.lid, with binary built from 'upstream_power11' branch of skiboot repository with Power11 enablement patches [2].
---
This patch can be skipped for now, if need to wait for patches to be merged in open-power/skiboot. Have updated the skiboot.lid to aid in testing this patch series.
---
[1]: https://lists.ozlabs.org/pipermail/skiboot/2024-April/018963.html
[2]: https://github.com/maheshsal/skiboot.
--- pc-bios/skiboot.lid | Bin 2527328 -> 2527328 bytes 1 file changed, 0 insertions(+), 0 deletions(-)
pc-bios/skiboot.lid binary +0 -0
Signature · 1 line
2.45.1
Re: [PATCH v4 11/11] ppc/pnv: Update skiboot.lid to support Power11
Quoted 10 lines · Aditya Gupta
Skiboot/OPAL patches are in discussion upstream [1], with corresponding commits in github repository [2].
Update skiboot.lid, with binary built from '
upstream_power11' branch of skiboot repository with Power11 enablement patches [2].---
This patch can be skipped for now, if need to wait for patches to be merged in open-power/skiboot. Have updated the skiboot.lid to aid in testing this patch series.
When is the merge in skiboot planned ? QEMU 9.1 freeze is in ~2 months.
Quoted 11 lines
[1]:https://lists.ozlabs.org/pipermail/skiboot/2024-April/018963.html [2]:https://github.com/maheshsal/skiboot.
Cc Cédric Le Goater<[email protected]>Cc Joel Stanley<[email protected]>Cc Mahesh J Salgaonkar<[email protected]>Cc Madhavan Srinivasan<[email protected]>Cc Nicholas Piggin<[email protected]>Signed-off-by Aditya Gupta<[email protected]>--- pc-bios/skiboot.lid | Bin 2527328 -> 2527328 bytes
Please don't resend. This is big !
Thanks,
C.
Nicholas Piggin
reviewerRe: [PATCH v4 11/11] ppc/pnv: Update skiboot.lid to support Power11
Quoted 7 lines · Cédric Le Goater
Quoted 6 lines · Aditya Gupta
Skiboot/OPAL patches are in discussion upstream [1], with corresponding commits in github repository [2].
Update skiboot.lid, with binary built from '
upstream_power11' branch of skiboot repository with Power11 enablement patches [2].
Quoted 6 lines
Quoted 4 lines
---
This patch can be skipped for now, if need to wait for patches to be merged in open-power/skiboot. Have updated the skiboot.lid to aid in testing this patch series.When is the merge in skiboot planned ? QEMU 9.1 freeze is in ~2 months.
I think I will try to get spapr bits in for 9.1, but may just skip pnv for this round since there's a bunch of other stuff including some pnv churn I'd like to get in 9.1.
Thanks,
Nick
Re: [PATCH v4 11/11] ppc/pnv: Update skiboot.lid to support Power11
Hello Nick,
Quoted 13 lines · Nicholas Piggin
Quoted 12 lines · Cédric Le Goater
Quoted 10 lines · Aditya Gupta
Skiboot/OPAL patches are in discussion upstream [1], with corresponding commits in github repository [2].
Update skiboot.lid, with binary built from '
upstream_power11' branch of skiboot repository with Power11 enablement patches [2].---
This patch can be skipped for now, if need to wait for patches to be merged in open-power/skiboot. Have updated the skiboot.lid to aid in testing this patch series.
Quoted 5 lines
Quoted 1 line
When is the merge in skiboot planned ? QEMU 9.1 freeze is in ~2 months.
I think I will try to get spapr bits in for 9.1, but may just skip pnv for this round since there's a bunch of other stuff including some pnv churn I'd like to get in 9.1.
Thanks for the information Nick.
Before you take the pseries changes, is it okay if I apply this patch from Harsh ?
https://lore.kernel.org/qemu-devel/[email protected]/
This would reduce the duplication.
Thanks,
Aditya Gupta
Quoted 3 lines
Thanks,
Nick
Re: [PATCH v4 11/11] ppc/pnv: Update skiboot.lid to support Power11
In reply to Cédric Le GoaterHello Cedric,
Quoted 7 lines · Cédric Le Goater
Quoted 6 lines · Aditya Gupta
Skiboot/OPAL patches are in discussion upstream [1], with corresponding commits in github repository [2].
Update skiboot.lid, with binary built from '
upstream_power11' branch of skiboot repository with Power11 enablement patches [2].
Quoted 6 lines
Quoted 4 lines
---
This patch can be skipped for now, if need to wait for patches to be merged in open-power/skiboot. Have updated the skiboot.lid to aid in testing this patch series.When is the merge in skiboot planned ? QEMU 9.1 freeze is in ~2 months.
I have asked, will let you know when I get the expected time.
Quoted 12 lines
Quoted 11 lines
[1]:https://lists.ozlabs.org/pipermail/skiboot/2024-April/018963.html [2]:https://github.com/maheshsal/skiboot.
Cc Cédric Le Goater<[email protected]>Cc Joel Stanley<[email protected]>Cc Mahesh J Salgaonkar<[email protected]>Cc Madhavan Srinivasan<[email protected]>Cc Nicholas Piggin<[email protected]>Signed-off-by Aditya Gupta<[email protected]>--- pc-bios/skiboot.lid | Bin 2527328 -> 2527328 bytes
Quoted 1 line
Please don't resend. This is big !
Oh okay. Sure.
Thanks,
Aditya Gupta
Quoted 8 lines
Thanks,
C.
Re: [PATCH v4 11/11] ppc/pnv: Update skiboot.lid to support Power11
Quoted 10 lines · Aditya Gupta
Hello Cedric,
Quoted 7 lines · Cédric Le Goater
Quoted 6 lines · Aditya Gupta
Skiboot/OPAL patches are in discussion upstream [1], with corresponding commits in github repository [2].
Update skiboot.lid, with binary built from '
upstream_power11' branch of skiboot repository with Power11 enablement patches [2].
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
---
This patch can be skipped for now, if need to wait for patches to be merged in open-power/skiboot. Have updated the skiboot.lid to aid in testing this patch series.When is the merge in skiboot planned ? QEMU 9.1 freeze is in ~2 months.
I have asked, will let you know when I get the expected time.
The typical flow would to be merge a new skiboot.lid with Power11 first, than this series.
Thanks,
C.
Quoted 28 lines
Quoted 13 lines
Quoted 4 lines
[1]:https://lists.ozlabs.org/pipermail/skiboot/2024-April/018963.html [2]:https://github.com/maheshsal/skiboot.
Quoted 8 lines
Cc Cédric Le Goater<[email protected]>Cc Joel Stanley<[email protected]>Cc Mahesh J Salgaonkar<[email protected]>Cc Madhavan Srinivasan<[email protected]>Cc Nicholas Piggin<[email protected]>Signed-off-by Aditya Gupta<[email protected]>--- pc-bios/skiboot.lid | Bin 2527328 -> 2527328 bytesQuoted 1 line
Please don't resend. This is big !
Oh okay. Sure.
Thanks,
Aditya GuptaQuoted 8 lines
Thanks,
C.