* [PATCH v6 RESEND 0/5] Power11 support for QEMU [PSeries]
@ 2024-07-31 5:50 Aditya Gupta
2024-07-31 5:50 ` [PATCH v6 RESEND 1/5] target/ppc: Reduce code duplication across Power9/10 init code Aditya Gupta
` (7 more replies)
0 siblings, 8 replies; 11+ messages in thread
From: Aditya Gupta @ 2024-07-31 5:50 UTC (permalink / raw)
To: Mahesh J Salgaonkar, Madhavan Srinivasan, Nicholas Piggin,
Cédric Le Goater, Harsh Prateek Bora
Cc: qemu-devel, qemu-ppc
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 RESEND:
+ added my initials instead of PMM in patch #1 description
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
--
2.45.2
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v6 RESEND 1/5] target/ppc: Reduce code duplication across Power9/10 init code
2024-07-31 5:50 [PATCH v6 RESEND 0/5] Power11 support for QEMU [PSeries] Aditya Gupta
@ 2024-07-31 5:50 ` Aditya Gupta
2024-07-31 5:50 ` [PATCH v6 RESEND 2/5] target/ppc: Introduce 'PowerPCCPUClass::spapr_logical_pvr' Aditya Gupta
` (6 subsequent siblings)
7 siblings, 0 replies; 11+ messages in thread
From: Aditya Gupta @ 2024-07-31 5:50 UTC (permalink / raw)
To: Mahesh J Salgaonkar, Madhavan Srinivasan, Nicholas Piggin,
Cédric Le Goater, Harsh Prateek Bora
Cc: qemu-devel, qemu-ppc
From: Harsh Prateek Bora <harshpb@linux.ibm.com>
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.
Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
[adityag: renamed many POWERPC_* flags to PPC_* flags, checkpatch fixes]
Signed-off-by: Aditya Gupta <adityag@linux.ibm.com>
---
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
diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c
index 23881d09e9f3..4c7368cfaeb5 100644
--- a/target/ppc/cpu_init.c
+++ b/target/ppc/cpu_init.c
@@ -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;
}
diff --git a/target/ppc/cpu_init.h b/target/ppc/cpu_init.h
new file mode 100644
index 000000000000..7479b59da73b
--- /dev/null
+++ b/target/ppc/cpu_init.h
@@ -0,0 +1,84 @@
+#ifndef TARGET_PPC_CPU_INIT_H
+#define TARGET_PPC_CPU_INIT_H
+
+#define PPC_INSNS_FLAGS_POWER9 \
+ 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
+
+#define PPC_INSNS_FLAGS_POWER10 PPC_INSNS_FLAGS_POWER9
+
+#define PPC_INSNS_FLAGS2_POWER_COMMON \
+ 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_MEM_LWSYNC | PPC2_BCDA_ISA206
+
+#define PPC_INSNS_FLAGS2_POWER9 \
+ PPC_INSNS_FLAGS2_POWER_COMMON | PPC2_TM
+#define PPC_INSNS_FLAGS2_POWER10 \
+ PPC_INSNS_FLAGS2_POWER_COMMON | PPC2_ISA310
+
+#define PPC_MSR_MASK_POWER_COMMON \
+ (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)
+
+#define PPC_MSR_MASK_POWER9 \
+ PPC_MSR_MASK_POWER_COMMON | (1ull << MSR_TM)
+#define PPC_MSR_MASK_POWER10 \
+ PPC_MSR_MASK_POWER_COMMON
+
+#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_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_LPCR_MASK_POWER9 \
+ 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 */
+#define PPC_LPCR_MASK_POWER10 \
+ PPC_LPCR_MASK_POWER9 | LPCR_HAIL
+
+#define POWERPC_FLAGS_POWER_COMMON \
+ 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
+
+#define POWERPC_FLAGS_POWER9 \
+ POWERPC_FLAGS_POWER_COMMON | POWERPC_FLAG_TM
+#define POWERPC_FLAGS_POWER10 \
+ POWERPC_FLAGS_POWER_COMMON | POWERPC_FLAG_BHRB
+
+#endif /* TARGET_PPC_CPU_INIT_H */
--
2.45.2
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v6 RESEND 2/5] target/ppc: Introduce 'PowerPCCPUClass::spapr_logical_pvr'
2024-07-31 5:50 [PATCH v6 RESEND 0/5] Power11 support for QEMU [PSeries] Aditya Gupta
2024-07-31 5:50 ` [PATCH v6 RESEND 1/5] target/ppc: Reduce code duplication across Power9/10 init code Aditya Gupta
@ 2024-07-31 5:50 ` Aditya Gupta
2024-07-31 5:50 ` [PATCH v6 RESEND 3/5] target/ppc: Fix regression due to Power10 and Power11 having same PCR Aditya Gupta
` (5 subsequent siblings)
7 siblings, 0 replies; 11+ messages in thread
From: Aditya Gupta @ 2024-07-31 5:50 UTC (permalink / raw)
To: Mahesh J Salgaonkar, Madhavan Srinivasan, Nicholas Piggin,
Cédric Le Goater, Harsh Prateek Bora
Cc: qemu-devel, qemu-ppc, Daniel Henrique Barboza
Introduce '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.
Cc: Cédric Le Goater <clg@kaod.org>
Cc: Daniel Henrique Barboza <danielhb413@gmail.com>
Cc: Harsh Prateek Bora <harshpb@linux.ibm.com>
Cc: Mahesh J Salgaonkar <mahesh@linux.ibm.com>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
Cc: Nicholas Piggin <npiggin@gmail.com>
Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Aditya Gupta <adityag@linux.ibm.com>
---
target/ppc/cpu.h | 1 +
target/ppc/cpu_init.c | 4 ++++
2 files changed, 5 insertions(+)
diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h
index 321ed2da75b7..752e11204b35 100644
--- a/target/ppc/cpu.h
+++ b/target/ppc/cpu.h
@@ -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.
diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c
index 4c7368cfaeb5..c5cd4133ea2f 100644
--- a/target/ppc/cpu_init.c
+++ b/target/ppc/cpu_init.c
@@ -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;
--
2.45.2
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v6 RESEND 3/5] target/ppc: Fix regression due to Power10 and Power11 having same PCR
2024-07-31 5:50 [PATCH v6 RESEND 0/5] Power11 support for QEMU [PSeries] Aditya Gupta
2024-07-31 5:50 ` [PATCH v6 RESEND 1/5] target/ppc: Reduce code duplication across Power9/10 init code Aditya Gupta
2024-07-31 5:50 ` [PATCH v6 RESEND 2/5] target/ppc: Introduce 'PowerPCCPUClass::spapr_logical_pvr' Aditya Gupta
@ 2024-07-31 5:50 ` Aditya Gupta
2024-07-31 5:50 ` [PATCH v6 RESEND 4/5] target/ppc: Add Power11 DD2.0 processor Aditya Gupta
` (4 subsequent siblings)
7 siblings, 0 replies; 11+ messages in thread
From: Aditya Gupta @ 2024-07-31 5:50 UTC (permalink / raw)
To: Mahesh J Salgaonkar, Madhavan Srinivasan, Nicholas Piggin,
Cédric Le Goater, Harsh Prateek Bora
Cc: qemu-devel, qemu-ppc, Daniel Henrique Barboza
Power11 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)
Cc: Cédric Le Goater <clg@kaod.org>
Cc: Daniel Henrique Barboza <danielhb413@gmail.com>
Cc: Harsh Prateek Bora <harshpb@linux.ibm.com>
Cc: Mahesh J Salgaonkar <mahesh@linux.ibm.com>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
Cc: Nicholas Piggin <npiggin@gmail.com>
Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Aditya Gupta <adityag@linux.ibm.com>
---
target/ppc/compat.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/target/ppc/compat.c b/target/ppc/compat.c
index ebef2cccecf3..5b20fd7ef04c 100644
--- a/target/ppc/compat.c
+++ b/target/ppc/compat.c
@@ -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;
--
2.45.2
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v6 RESEND 4/5] target/ppc: Add Power11 DD2.0 processor
2024-07-31 5:50 [PATCH v6 RESEND 0/5] Power11 support for QEMU [PSeries] Aditya Gupta
` (2 preceding siblings ...)
2024-07-31 5:50 ` [PATCH v6 RESEND 3/5] target/ppc: Fix regression due to Power10 and Power11 having same PCR Aditya Gupta
@ 2024-07-31 5:50 ` Aditya Gupta
2024-07-31 5:50 ` [PATCH v6 RESEND 5/5] ppc/pseries: Add Power11 cpu type Aditya Gupta
` (3 subsequent siblings)
7 siblings, 0 replies; 11+ messages in thread
From: Aditya Gupta @ 2024-07-31 5:50 UTC (permalink / raw)
To: Mahesh J Salgaonkar, Madhavan Srinivasan, Nicholas Piggin,
Cédric Le Goater, Harsh Prateek Bora
Cc: qemu-devel, qemu-ppc, Daniel Henrique Barboza,
Frédéric Barrat
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 <clg@kaod.org>
Cc: Daniel Henrique Barboza <danielhb413@gmail.com>
Cc: Frédéric Barrat <fbarrat@linux.ibm.com>
Cc: Harsh Prateek Bora <harshpb@linux.ibm.com>
Cc: Mahesh J Salgaonkar <mahesh@linux.ibm.com>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
Cc: Nicholas Piggin <npiggin@gmail.com>
Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Aditya Gupta <adityag@linux.ibm.com>
---
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(+)
diff --git a/target/ppc/compat.c b/target/ppc/compat.c
index 5b20fd7ef04c..0cec1bde9179 100644
--- a/target/ppc/compat.c
+++ b/target/ppc/compat.c
@@ -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)
diff --git a/target/ppc/cpu-models.c b/target/ppc/cpu-models.c
index f2301b43f78b..ece348178188 100644
--- a/target/ppc/cpu-models.c
+++ b/target/ppc/cpu-models.c
@@ -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 */
diff --git a/target/ppc/cpu-models.h b/target/ppc/cpu-models.h
index 0229ef3a9a5c..72ad31ba50d7 100644
--- a/target/ppc/cpu-models.h
+++ b/target/ppc/cpu-models.h
@@ -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) */
diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h
index 752e11204b35..d1d60b4eac55 100644
--- a/target/ppc/cpu.h
+++ b/target/ppc/cpu.h
@@ -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;
/*****************************************************************************/
diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c
index c5cd4133ea2f..9cb5dd4596bf 100644
--- a/target/ppc/cpu_init.c
+++ b/target/ppc/cpu_init.c
@@ -6675,6 +6675,66 @@ POWERPC_FAMILY(POWER10)(ObjectClass *oc, void *data)
pcc->l1_icache_size = 0x8000;
}
+static void init_proc_POWER11(CPUPPCState *env)
+{
+ init_proc_POWER10(env);
+}
+
+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->spapr_logical_pvr = CPU_POWERPC_LOGICAL_3_10_P11;
+ pcc->pvr_match = ppc_pvr_match_power11;
+ pcc->pcr_mask = PPC_PCR_MASK_POWER11;
+ pcc->pcr_supported = PPC_PCR_SUPPORTED_POWER11;
+ pcc->init_proc = init_proc_POWER11;
+ pcc->check_pow = check_pow_nocheck;
+ pcc->check_attn = check_attn_hid0_power9;
+ pcc->insns_flags = PPC_INSNS_FLAGS_POWER11;
+ pcc->insns_flags2 = PPC_INSNS_FLAGS2_POWER11;
+ pcc->msr_mask = PPC_MSR_MASK_POWER11;
+ pcc->lpcr_mask = PPC_LPCR_MASK_POWER11;
+
+ 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_POWER11;
+ pcc->bus_model = PPC_FLAGS_INPUT_POWER9;
+ pcc->bfd_mach = bfd_mach_ppc64;
+ pcc->flags = POWERPC_FLAGS_POWER11;
+ pcc->l1_dcache_size = 0x8000;
+ pcc->l1_icache_size = 0x8000;
+}
+
#if !defined(CONFIG_USER_ONLY)
void cpu_ppc_set_vhyp(PowerPCCPU *cpu, PPCVirtualHypervisor *vhyp)
{
diff --git a/target/ppc/cpu_init.h b/target/ppc/cpu_init.h
index 7479b59da73b..355d304e38ae 100644
--- a/target/ppc/cpu_init.h
+++ b/target/ppc/cpu_init.h
@@ -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 */
diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c
index f33fc36db2aa..2029144622d8 100644
--- a/target/ppc/excp_helper.c
+++ b/target/ppc/excp_helper.c
@@ -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.
--
2.45.2
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v6 RESEND 5/5] ppc/pseries: Add Power11 cpu type
2024-07-31 5:50 [PATCH v6 RESEND 0/5] Power11 support for QEMU [PSeries] Aditya Gupta
` (3 preceding siblings ...)
2024-07-31 5:50 ` [PATCH v6 RESEND 4/5] target/ppc: Add Power11 DD2.0 processor Aditya Gupta
@ 2024-07-31 5:50 ` Aditya Gupta
2024-08-20 10:34 ` [PATCH v6 RESEND 0/5] Power11 support for QEMU [PSeries] Aditya Gupta
` (2 subsequent siblings)
7 siblings, 0 replies; 11+ messages in thread
From: Aditya Gupta @ 2024-07-31 5:50 UTC (permalink / raw)
To: Mahesh J Salgaonkar, Madhavan Srinivasan, Nicholas Piggin,
Cédric Le Goater, Harsh Prateek Bora
Cc: qemu-devel, qemu-ppc, Daniel Henrique Barboza, David Gibson,
Frédéric Barrat
Add sPAPR CPU Core definition for Power11
Cc: Cédric Le Goater <clg@kaod.org>
Cc: Daniel Henrique Barboza <danielhb413@gmail.com>
Cc: David Gibson <david@gibson.dropbear.id.au>
Cc: Frédéric Barrat <fbarrat@linux.ibm.com>
Cc: Harsh Prateek Bora <harshpb@linux.ibm.com>
Cc: Mahesh J Salgaonkar <mahesh@linux.ibm.com>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
Cc: Nicholas Piggin <npiggin@gmail.com>
Reviewed-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Aditya Gupta <adityag@linux.ibm.com>
---
docs/system/ppc/pseries.rst | 17 +++++++++++++----
hw/ppc/spapr_cpu_core.c | 1 +
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/docs/system/ppc/pseries.rst b/docs/system/ppc/pseries.rst
index a876d897b6e4..bbc51aa7fcdb 100644
--- a/docs/system/ppc/pseries.rst
+++ b/docs/system/ppc/pseries.rst
@@ -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.
diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c
index 56090abcd11a..347a1643ac7f 100644
--- a/hw/ppc/spapr_cpu_core.c
+++ b/hw/ppc/spapr_cpu_core.c
@@ -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
--
2.45.2
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v6 RESEND 0/5] Power11 support for QEMU [PSeries]
2024-07-31 5:50 [PATCH v6 RESEND 0/5] Power11 support for QEMU [PSeries] Aditya Gupta
` (4 preceding siblings ...)
2024-07-31 5:50 ` [PATCH v6 RESEND 5/5] ppc/pseries: Add Power11 cpu type Aditya Gupta
@ 2024-08-20 10:34 ` Aditya Gupta
2024-08-29 12:19 ` Amit Machhiwal
2024-09-02 5:49 ` Amit Machhiwal
7 siblings, 0 replies; 11+ messages in thread
From: Aditya Gupta @ 2024-08-20 10:34 UTC (permalink / raw)
To: Mahesh J Salgaonkar, Madhavan Srinivasan, Nicholas Piggin,
Cédric Le Goater, Harsh Prateek Bora
Cc: qemu-devel, qemu-ppc
Hi,
Any comments on this ?
Thanks,
Aditya Gupta
On 31/07/24 11:20, Aditya Gupta wrote:
> 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 RESEND:
> + added my initials instead of PMM in patch #1 description
>
> 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
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v6 RESEND 0/5] Power11 support for QEMU [PSeries]
2024-07-31 5:50 [PATCH v6 RESEND 0/5] Power11 support for QEMU [PSeries] Aditya Gupta
` (5 preceding siblings ...)
2024-08-20 10:34 ` [PATCH v6 RESEND 0/5] Power11 support for QEMU [PSeries] Aditya Gupta
@ 2024-08-29 12:19 ` Amit Machhiwal
2024-08-30 11:53 ` Aditya Gupta
2024-09-02 5:49 ` Amit Machhiwal
7 siblings, 1 reply; 11+ messages in thread
From: Amit Machhiwal @ 2024-08-29 12:19 UTC (permalink / raw)
To: Aditya Gupta
Cc: Mahesh J Salgaonkar, Madhavan Srinivasan, Nicholas Piggin,
Cédric Le Goater, Harsh Prateek Bora, qemu-devel, qemu-ppc
Hi Aditya,
On 2024/07/31 11:20 AM, Aditya Gupta wrote:
> 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'
I tried the below command with mailine QEMU and this patch series applied. I
could boot the guest with -cpu Power11 option but when I check inside the guest
with `lscpu`, I can still see the Model name being reported as "Power 10" while
the PVR value looks fine corresponding to Power11.
Did you see "Power 11" while you were testing this?
$ qemu-system-ppc64 -m 4G -smp 4 -nographic -drive file=/root/testing/debian-12-generic-ppc64el.qcow2,format=qcow2 -accel tcg -cpu Power11
root@localhost:~# lscpu
Architecture: ppc64le
Byte Order: Little Endian
CPU(s): 4
On-line CPU(s) list: 0-3
Model name: POWER10 (architected), altivec supported
Model: 18.0 (pvr 0082 1200)
Thanks,
Amit
> * '-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 RESEND:
> + added my initials instead of PMM in patch #1 description
>
> 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
>
> --
> 2.45.2
>
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v6 RESEND 0/5] Power11 support for QEMU [PSeries]
2024-08-29 12:19 ` Amit Machhiwal
@ 2024-08-30 11:53 ` Aditya Gupta
0 siblings, 0 replies; 11+ messages in thread
From: Aditya Gupta @ 2024-08-30 11:53 UTC (permalink / raw)
To: Harsh Prateek Bora
Hi Amit,
On 29/08/24 17:49, Amit Machhiwal wrote:
> Hi Aditya,
>
> On 2024/07/31 11:20 AM, Aditya Gupta wrote:
>> 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'
> I tried the below command with mailine QEMU and this patch series applied. I
> could boot the guest with -cpu Power11 option but when I check inside the guest
> with `lscpu`, I can still see the Model name being reported as "Power 10" while
> the PVR value looks fine corresponding to Power11.
>
> Did you see "Power 11" while you were testing this?
>
> $ qemu-system-ppc64 -m 4G -smp 4 -nographic -drive file=/root/testing/debian-12-generic-ppc64el.qcow2,format=qcow2 -accel tcg -cpu Power11
>
> root@localhost:~# lscpu
> Architecture: ppc64le
> Byte Order: Little Endian
> CPU(s): 4
> On-line CPU(s) list: 0-3
> Model name: POWER10 (architected), altivec supported
> Model: 18.0 (pvr 0082 1200)
Yes.
Above system's kernel is probably older, and doesn't know about Power11.
Power11 support was added in upstream linux, with commit c2ed087ed35c
("powerpc: Add Power11 architected and raw mode").
Also, if you notice the model is being printed as 0x00821200, it is the
Processor version register (PVR), the 0x82 in it is for Power11. If it
had been Power10, it would be 0x80. You can try that with -cpu Power10.
You will need to use a kernel newer than v6.9-rc1, which contains the
commit adding Power11 support to the kernel.
Thanks,
Aditya Gupta
>
> Thanks,
> Amit
>
>> * '-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 RESEND:
>> + added my initials instead of PMM in patch #1 description
>>
>> 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
>>
>> --
>> 2.45.2
>>
>>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v6 RESEND 0/5] Power11 support for QEMU [PSeries]
2024-07-31 5:50 [PATCH v6 RESEND 0/5] Power11 support for QEMU [PSeries] Aditya Gupta
` (6 preceding siblings ...)
2024-08-29 12:19 ` Amit Machhiwal
@ 2024-09-02 5:49 ` Amit Machhiwal
2024-09-02 8:57 ` Aditya Gupta
7 siblings, 1 reply; 11+ messages in thread
From: Amit Machhiwal @ 2024-09-02 5:49 UTC (permalink / raw)
To: Aditya Gupta
Cc: Mahesh J Salgaonkar, Madhavan Srinivasan, Nicholas Piggin,
Cédric Le Goater, Harsh Prateek Bora, qemu-devel, qemu-ppc
On 2024/07/31 11:20 AM, Aditya Gupta wrote:
> 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'
>
I could boot a Power11 pseries KVM guest with this patch series applied which
does not work without it.
Command Used:
qemu-system-ppc64 -m 4G -smp 4 -nographic -drive file=/root/testing/debian-12-generic-ppc64el.qcow2,format=qcow2 -accel tcg -cpu Power11
Tested-by: Amit Machhiwal <amachhiw@linux.ibm.com>
> * '-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 RESEND:
> + added my initials instead of PMM in patch #1 description
>
> 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
>
> --
> 2.45.2
>
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v6 RESEND 0/5] Power11 support for QEMU [PSeries]
2024-09-02 5:49 ` Amit Machhiwal
@ 2024-09-02 8:57 ` Aditya Gupta
0 siblings, 0 replies; 11+ messages in thread
From: Aditya Gupta @ 2024-09-02 8:57 UTC (permalink / raw)
To: Amit Machhiwal
Cc: Mahesh J Salgaonkar, Madhavan Srinivasan, Nicholas Piggin,
Cédric Le Goater, Harsh Prateek Bora, qemu-devel, qemu-ppc
Hi Amit,
On 02/09/24 11:19, Amit Machhiwal wrote:
> On 2024/07/31 11:20 AM, Aditya Gupta wrote:
>> <...snip...>
>>
>> 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'
>>
> I could boot a Power11 pseries KVM guest with this patch series applied which
> does not work without it.
>
> Command Used:
>
> qemu-system-ppc64 -m 4G -smp 4 -nographic -drive file=/root/testing/debian-12-generic-ppc64el.qcow2,format=qcow2 -accel tcg -cpu Power11
>
> Tested-by: Amit Machhiwal <amachhiw@linux.ibm.com>
Thanks for testing it, Amit !
- Aditya Gupta
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2024-09-02 8:58 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-31 5:50 [PATCH v6 RESEND 0/5] Power11 support for QEMU [PSeries] Aditya Gupta
2024-07-31 5:50 ` [PATCH v6 RESEND 1/5] target/ppc: Reduce code duplication across Power9/10 init code Aditya Gupta
2024-07-31 5:50 ` [PATCH v6 RESEND 2/5] target/ppc: Introduce 'PowerPCCPUClass::spapr_logical_pvr' Aditya Gupta
2024-07-31 5:50 ` [PATCH v6 RESEND 3/5] target/ppc: Fix regression due to Power10 and Power11 having same PCR Aditya Gupta
2024-07-31 5:50 ` [PATCH v6 RESEND 4/5] target/ppc: Add Power11 DD2.0 processor Aditya Gupta
2024-07-31 5:50 ` [PATCH v6 RESEND 5/5] ppc/pseries: Add Power11 cpu type Aditya Gupta
2024-08-20 10:34 ` [PATCH v6 RESEND 0/5] Power11 support for QEMU [PSeries] Aditya Gupta
2024-08-29 12:19 ` Amit Machhiwal
2024-08-30 11:53 ` Aditya Gupta
2024-09-02 5:49 ` Amit Machhiwal
2024-09-02 8:57 ` Aditya Gupta
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).