Power11 support for QEMU [PSeries]
v6 cover Power11 support for QEMU [PSeries]
Overview
============
Split "Power11 support for QEMU" into 2 patch series: pseries & powernv.
This patch series is for pseries support for 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-v6-pseries
Has been tested with following cases:
* '-M pseries' / '-M pseries -cpu Power11'
* '-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
Linux with Power11 support: https://github.com/torvalds/linux, since v6.9-rc1
Changelog
=========
v6:
+ reorganised patches such that Power11 introduction is at end, and cleanups and fixes is done before
+ patch #1: renamed macros from POWER_* to PCC_*
+ patch #2: rename 'logical_pvr' to 'spapr_logical_pvr' to better convey the context
v5:
+ split patch series into pseries+powernv
+ patch #1: apply harsh's patch to reduce duplication
+ patch #2: simplified, by removing duplication
+ patch #3: update docs, according to harsh's suggestion
+ patch #4: no functional change, #define used for P9 & P10 pcr_supported
+ patch #5: no change
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 (4):
target/ppc: Introduce 'PowerPCCPUClass::spapr_logical_pvr' target/ppc: Fix regression due to Power10 and Power11 having same PCR target/ppc: Add Power11 DD2.0 processor
ppc/pseries: Add Power11 cpu type
Harsh Prateek Bora (1):
target/ppc: Reduce code duplication across Power9/10 init code
docs/system/ppc/pseries.rst | 17 +++- hw/ppc/spapr_cpu_core.c | 1 + target/ppc/compat.c | 11 +++ target/ppc/cpu-models.c | 3 + target/ppc/cpu-models.h | 3 + target/ppc/cpu.h | 3 + target/ppc/cpu_init.c | 188 +++++++++++++++--------------------- target/ppc/cpu_init.h | 92 ++++++++++++++++++ 8 files changed, 205 insertions(+), 113 deletions(-) create mode 100644 target/ppc/cpu_init.h
Signature · 1 line
2.45.2
PATCH v6 1/5 target/ppc: Reduce code duplication across Power9/10 init code
From: Harsh Prateek Bora <[email protected]>
Power9/10 initialization code consists of a lot of logical OR of various flag bits as supported by respective Power platform during its initialization, most of which is duplicated and only selected bits are added or removed as needed with each new platform support being added. Remove the duplicate code and share using common macros.
--- target/ppc/cpu_init.c | 124 +++++------------------------------------- target/ppc/cpu_init.h | 84 ++++++++++++++++++++++++++++ 2 files changed, 99 insertions(+), 109 deletions(-) create mode 100644 target/ppc/cpu_init.h
target/ppc/cpu_init.c +15 -109
@@ -52,6 +52,7 @@#include "kvm_ppc.h" #endif +#include "cpu_init.h" /* #define PPC_DEBUG_SPR */ /* #define USE_APPLE_GDB */
@@ -6510,58 +6511,15 @@ POWERPC_FAMILY(POWER9)(ObjectClass *oc, void *data) dc->fw_name ="PowerPC,POWER9" ; dc->desc ="POWER9" ; 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 | -PCR_COMPAT_2_05 ; + pcc->pcr_mask =PPC_PCR_MASK_POWER9 ; + pcc->pcr_supported =PPC_PCR_SUPPORTED_POWER9 ; pcc->init_proc = init_proc_POWER9; pcc->check_pow = check_pow_nocheck; pcc->check_attn = check_attn_hid0_power9; - 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_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 ); - 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 ; + pcc->insns_flags =PPC_INSNS_FLAGS_POWER9 ; + pcc->insns_flags2 =PPC_INSNS_FLAGS2_POWER9 ; + pcc->msr_mask =PPC_MSR_MASK_POWER9 ; + pcc->lpcr_mask =PPC_LPCR_MASK_POWER9 ; 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 )
@@ -6574,10 +6532,7 @@ POWERPC_FAMILY(POWER9)(ObjectClass *oc, void *data) pcc->excp_model =POWERPC_EXCP_POWER9 ; 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->flags =POWERPC_FLAGS_POWER9 ; pcc->l1_dcache_size =0x8000 ; pcc->l1_icache_size =0x8000 ; }
@@ -6690,60 +6645,15 @@ POWERPC_FAMILY(POWER10)(ObjectClass *oc, void *data) dc->fw_name ="PowerPC,POWER10" ; dc->desc ="POWER10" ; 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 ; - pcc->pcr_supported =PCR_COMPAT_3_10 |PCR_COMPAT_3_00 |PCR_COMPAT_2_07 | -PCR_COMPAT_2_06 |PCR_COMPAT_2_05 ; + pcc->pcr_mask =PPC_PCR_MASK_POWER10 ; + pcc->pcr_supported =PPC_PCR_SUPPORTED_POWER10 ; pcc->init_proc = init_proc_POWER10; pcc->check_pow = check_pow_nocheck; pcc->check_attn = check_attn_hid0_power9; - 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_ISA300 |PPC2_PRCNTL |PPC2_ISA310 | -PPC2_MEM_LWSYNC |PPC2_BCDA_ISA206 ; - pcc->msr_mask = (1ull <<MSR_SF ) | - (1ull <<MSR_HV ) | - (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 ); - 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 ; + pcc->insns_flags =PPC_INSNS_FLAGS_POWER10 ; + pcc->insns_flags2 =PPC_INSNS_FLAGS2_POWER10 ; + pcc->msr_mask =PPC_MSR_MASK_POWER10 ; + pcc->lpcr_mask =PPC_LPCR_MASK_POWER10 ; pcc->lpcr_pm =LPCR_PDEE |LPCR_HDEE |LPCR_EEE |LPCR_DEE |LPCR_OEE ; pcc->mmu_model =POWERPC_MMU_3_00 ;
@@ -6756,11 +6666,7 @@ POWERPC_FAMILY(POWER10)(ObjectClass *oc, void *data) 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_SCV | -POWERPC_FLAG_BHRB ; + pcc->flags =POWERPC_FLAGS_POWER10 ; pcc->l1_dcache_size =0x8000 ; pcc->l1_icache_size =0x8000 ; }
target/ppc/cpu_init.h new file +84 -0
84 lines not on this page · raw message
Signature · 1 line
2.45.2
PATCH v6 2/5 target/ppc: Introduce 'PowerPCCPUClass::spapr_logical_pvr'
In reply to Aditya GuptaIntroduce 'PnvChipClass::spapr_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 | 4 ++++ 2 files changed, 5 insertions(+)
target/ppc/cpu.h +1 -0
@@ -1482,6 +1482,7 @@ struct PowerPCCPUClass {void (*parent_parse_features)(const char *type,char *str,Error **errp);uint32_t pvr; +uint32_t spapr_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 +4 -0
@@ -6154,6 +6154,7 @@ POWERPC_FAMILY(POWER7)(ObjectClass *oc, void *data) dc->fw_name ="PowerPC,POWER7" ; dc->desc ="POWER7" ; + pcc->spapr_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 ;
@@ -6317,6 +6318,7 @@ POWERPC_FAMILY(POWER8)(ObjectClass *oc, void *data) dc->fw_name ="PowerPC,POWER8" ; dc->desc ="POWER8" ; + pcc->spapr_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 ;
@@ -6510,6 +6512,7 @@ POWERPC_FAMILY(POWER9)(ObjectClass *oc, void *data) dc->fw_name ="PowerPC,POWER9" ; dc->desc ="POWER9" ; + pcc->spapr_logical_pvr =CPU_POWERPC_LOGICAL_3_00 ; pcc->pvr_match = ppc_pvr_match_power9; pcc->pcr_mask =PPC_PCR_MASK_POWER9 ; pcc->pcr_supported =PPC_PCR_SUPPORTED_POWER9 ;
@@ -6644,6 +6647,7 @@ POWERPC_FAMILY(POWER10)(ObjectClass *oc, void *data) dc->fw_name ="PowerPC,POWER10" ; dc->desc ="POWER10" ; + pcc->spapr_logical_pvr =CPU_POWERPC_LOGICAL_3_10 ; pcc->pvr_match = ppc_pvr_match_power10; pcc->pcr_mask =PPC_PCR_MASK_POWER10 ; pcc->pcr_supported =PPC_PCR_SUPPORTED_POWER10 ;
Signature · 1 line
2.45.2
PATCH v6 3/5 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)
--- target/ppc/compat.c | 4 ++++ 1 file changed, 4 insertions(+)
target/ppc/compat.c +4 -0
@@ -132,6 +132,10 @@ static bool pcc_compat(PowerPCCPUClass *pcc, uint32_t compat_pvr,/* Outside specified range */ return false; } +if (compat->pvr > pcc->spapr_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.2
PATCH v6 4/5 target/ppc: Add Power11 DD2.0 processor
In reply to Aditya GuptaAdd 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.h | 2 ++ target/ppc/cpu_init.c | 60 ++++++++++++++++++++++++++++++++++++++++ target/ppc/cpu_init.h | 8 ++++++ target/ppc/excp_helper.c | 4 +++ 7 files changed, 87 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_P11, + .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_P11 = 0x0F000007, };/* System version register (used on MPC 8xxx) */
target/ppc/cpu.h +2 -0
@@ -215,6 +215,8 @@ typedef enum powerpc_excp_t {POWERPC_EXCP_POWER9 ,/* POWER10 exception model */ POWERPC_EXCP_POWER10 , +/* POWER11 exception model */ +POWERPC_EXCP_POWER11 , } powerpc_excp_t;/*****************************************************************************/
target/ppc/cpu_init.c +60 -0
66 lines not on this page · raw message
target/ppc/cpu_init.h +8 -0
@@ -13,6 +13,8 @@#define PPC_INSNS_FLAGS_POWER10 PPC_INSNS_FLAGS_POWER9 +#define PPC_INSNS_FLAGS_POWER11 PPC_INSNS_FLAGS_POWER10 +#define PPC_INSNS_FLAGS2_POWER_COMMON \ PPC2_VSX | PPC2_VSX207 | PPC2_DFP | PPC2_DBRX | \ PPC2_PERM_ISA206 | PPC2_DIVE_ISA206 | PPC2_ATOMIC_ISA206 | \
@@ -25,6 +27,7 @@ PPC_INSNS_FLAGS2_POWER_COMMON | PPC2_TM#define PPC_INSNS_FLAGS2_POWER10 \ PPC_INSNS_FLAGS2_POWER_COMMON | PPC2_ISA310 +#define PPC_INSNS_FLAGS2_POWER11 PPC_INSNS_FLAGS2_POWER10#define PPC_MSR_MASK_POWER_COMMON \ (1ull << MSR_SF) | \
@@ -49,16 +52,19 @@ PPC_MSR_MASK_POWER_COMMON | (1ull << MSR_TM)#define PPC_MSR_MASK_POWER10 \ PPC_MSR_MASK_POWER_COMMON +#define PPC_MSR_MASK_POWER11 PPC_MSR_MASK_POWER10#define PPC_PCR_MASK_POWER9 \ PCR_COMPAT_2_05 | PCR_COMPAT_2_06 | PCR_COMPAT_2_07#define PPC_PCR_MASK_POWER10 \ PPC_PCR_MASK_POWER9 | PCR_COMPAT_3_00 +#define PPC_PCR_MASK_POWER11 PPC_PCR_MASK_POWER10#define PPC_PCR_SUPPORTED_POWER9 \ PCR_COMPAT_3_00 | PCR_COMPAT_2_07 | PCR_COMPAT_2_06 | PCR_COMPAT_2_05#define PPC_PCR_SUPPORTED_POWER10 \ PPC_PCR_SUPPORTED_POWER9 | PCR_COMPAT_3_10 +#define PPC_PCR_SUPPORTED_POWER11 PPC_PCR_SUPPORTED_POWER10#define PPC_LPCR_MASK_POWER9 \ LPCR_VPM1 | LPCR_ISL | LPCR_KBV | LPCR_DPFD | \
@@ -70,6 +76,7 @@/* DD2 adds an extra HAIL bit */ #define PPC_LPCR_MASK_POWER10 \ PPC_LPCR_MASK_POWER9 | LPCR_HAIL +#define PPC_LPCR_MASK_POWER11 PPC_LPCR_MASK_POWER10#define POWERPC_FLAGS_POWER_COMMON \ POWERPC_FLAG_VRE | POWERPC_FLAG_SE | POWERPC_FLAG_BE | \
@@ -80,5 +87,6 @@ POWERPC_FLAGS_POWER_COMMON | POWERPC_FLAG_TM#define POWERPC_FLAGS_POWER10 \ POWERPC_FLAGS_POWER_COMMON | POWERPC_FLAG_BHRB +#define POWERPC_FLAGS_POWER11 POWERPC_FLAGS_POWER10#endif /* TARGET_PPC_CPU_INIT_H */
target/ppc/excp_helper.c +4 -0
@@ -1661,6 +1661,7 @@ static void powerpc_excp(PowerPCCPU *cpu, int excp)case POWERPC_EXCP_POWER8 :case POWERPC_EXCP_POWER9 :case POWERPC_EXCP_POWER10 : +case POWERPC_EXCP_POWER11 :powerpc_excp_books (cpu, excp);break ;default :
@@ -2018,6 +2019,7 @@ static int ppc_next_unmasked_interrupt(CPUPPCState *env)return p8_next_unmasked_interrupt (env);case POWERPC_EXCP_POWER9 :case POWERPC_EXCP_POWER10 : +case POWERPC_EXCP_POWER11 :return p9_next_unmasked_interrupt (env);default :break ;
@@ -2372,6 +2374,7 @@ static void ppc_deliver_interrupt(CPUPPCState *env, int interrupt)return p8_deliver_interrupt (env, interrupt);case POWERPC_EXCP_POWER9 :case POWERPC_EXCP_POWER10 : +case POWERPC_EXCP_POWER11 :return p9_deliver_interrupt (env, interrupt);default :break ;
@@ -3163,6 +3166,7 @@ void ppc_cpu_do_transaction_failed(CPUState *cs, hwaddr physaddr,case POWERPC_EXCP_POWER8 :case POWERPC_EXCP_POWER9 :case POWERPC_EXCP_POWER10 : +case POWERPC_EXCP_POWER11 :/* * Machine check codes can be found in processor User Manual or * Linux or skiboot source.
Signature · 1 line
2.45.2
PATCH v6 5/5 ppc/pseries: Add Power11 cpu type
In reply to Aditya GuptaAdd sPAPR CPU Core definition for Power11
--- docs/system/ppc/pseries.rst | 17 +++++++++++++---- hw/ppc/spapr_cpu_core.c | 1 + 2 files changed, 14 insertions(+), 4 deletions(-)
docs/system/ppc/pseries.rst +13 -4
@@ -14,10 +14,19 @@ virtualization capabilities. 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) + * Multi processor support for many Power processors generations: + - POWER7, POWER7+ + - POWER8, POWER8NVL + - POWER9 + - Power10 + - Power11 + - Support for POWER5+ also exists, works with correct kernel/userspace + * Interrupt Controller + - XICS (POWER8) + - XIVE (Supported by below:) + - 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
@@ -411,6 +411,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.2
Nicholas Piggin
reviewerHey Aditya,
Thanks for this, I think since we're past the hard freeze it may have to wait until next release. If it was simply a new PRV maybe it could be squeezed in, but since it has this PCR tangle then it's a bit non-trivial. Apologies I didn't get to reviewing it earlier, will get it in 9.2.
Thanks,
Nick
Quoted 85 lines · Aditya Gupta
Overview
============Split "Power11 support for QEMU" into 2 patch series: pseries & powernv.
This patch series is for pseries support for Power11.
As Power11 core is same as Power10, hence much of the code has been reused from Power10.
Power11 was added in Linux in:
commitc2ed087ed35c("powerpc: Add Power11 architected and raw mode")Git Tree for Testing
====================QEMU: https://github.com/adi-g15-ibm/qemu/tree/p11-v6-pseries
Has been tested with following cases:
* '-M pseries' / '-M pseries -cpu Power11'
* '-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 withqcow_fileLinux with Power11 support: https://github.com/torvalds/linux, since v6.9-rc1
Changelog
=========
v6:
+ reorganised patches such that Power11 introduction is at end, and cleanups and fixes is done before
+ patch #1: renamed macros from POWER_* to PCC_*
+ patch #2: rename 'logical_pvr' to 'spapr_logical_pvr' to better convey the contextv5:
+ split patch series into pseries+powernv
+ patch #1: apply harsh's patch to reduce duplication
+ patch #2: simplified, by removing duplication
+ patch #3: update docs, according to harsh's suggestion
+ patch #4: no functional change, #define used for P9 & P10pcr_supported
+ patch #5: no changev4:
+ patch #5: fix memory leak inpnv_chip_power10_quad_realize
- no change in other patchesv3:
+ 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: createpnv_chip_power11_dt_populateand splitpnv_chip_power10_common_realizeas per review
+ patch #6-#11: no change
- remove commit to make Power11 as defaultv2:
+ 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.lidAditya Gupta (4):
target/ppc: Introduce 'PowerPCCPUClass::spapr_logical_pvr' target/ppc: Fix regression due to Power10 and Power11 having same PCR target/ppc: Add Power11 DD2.0 processor
ppc/pseries: Add Power11 cpu typeHarsh Prateek Bora (1):
target/ppc: Reduce code duplication across Power9/10 init codedocs/system/ppc/pseries.rst | 17 +++- hw/ppc/spapr_cpu_core.c | 1 + target/ppc/compat.c | 11 +++ target/ppc/cpu-models.c | 3 + target/ppc/cpu-models.h | 3 + target/ppc/cpu.h | 3 + target/ppc/cpu_init.c | 188 +++++++++++++++--------------------- target/ppc/cpu_init.h | 92 ++++++++++++++++++ 8 files changed, 205 insertions(+), 113 deletions(-) create mode 100644 target/ppc/cpu_init.h