[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 32/67] target/ppc: Fix regression due to Power10 and Power11 havin
From: |
Nicholas Piggin |
Subject: |
[PULL 32/67] target/ppc: Fix regression due to Power10 and Power11 having same PCR |
Date: |
Mon, 4 Nov 2024 10:18:21 +1000 |
From: Aditya Gupta <adityag@linux.ibm.com>
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)
Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Aditya Gupta <adityag@linux.ibm.com>
Tested-by: Amit Machhiwal <amachhiw@linux.ibm.com>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
target/ppc/compat.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/target/ppc/compat.c b/target/ppc/compat.c
index ebef2cccec..5b20fd7ef0 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
- [PULL 20/67] ppc/spapr: remove deprecated machine pseries-2.4, (continued)
- [PULL 20/67] ppc/spapr: remove deprecated machine pseries-2.4, Nicholas Piggin, 2024/11/03
- [PULL 22/67] ppc/spapr: remove deprecated machine pseries-2.6, Nicholas Piggin, 2024/11/03
- [PULL 25/67] ppc/spapr: remove deprecated machine pseries-2.9, Nicholas Piggin, 2024/11/03
- [PULL 24/67] ppc/spapr: remove deprecated machine pseries-2.8, Nicholas Piggin, 2024/11/03
- [PULL 26/67] ppc/spapr: remove deprecated machine pseries-2.10, Nicholas Piggin, 2024/11/03
- [PULL 27/67] ppc/spapr: remove deprecated machine pseries-2.11, Nicholas Piggin, 2024/11/03
- [PULL 28/67] ppc/spapr: remove deprecated machine pseries-2.12-sxxm, Nicholas Piggin, 2024/11/03
- [PULL 29/67] ppc/spapr: remove deprecated machine pseries-2.12, Nicholas Piggin, 2024/11/03
- [PULL 30/67] target/ppc: Reduce code duplication across Power9/10 init code, Nicholas Piggin, 2024/11/03
- [PULL 31/67] target/ppc: Introduce 'PowerPCCPUClass::spapr_logical_pvr', Nicholas Piggin, 2024/11/03
- [PULL 32/67] target/ppc: Fix regression due to Power10 and Power11 having same PCR,
Nicholas Piggin <=
- [PULL 33/67] target/ppc: Add Power11 DD2.0 processor, Nicholas Piggin, 2024/11/03
- [PULL 34/67] ppc/pseries: Add Power11 cpu type, Nicholas Piggin, 2024/11/03
- [PULL 35/67] target/ppc: use locally stored msr and avoid indirect access, Nicholas Piggin, 2024/11/03
- [PULL 36/67] target/ppc: optimize hreg_compute_pmu_hflags_value, Nicholas Piggin, 2024/11/03
- [PULL 37/67] target/ppc: optimize hreg_compute_pmu_hflags_value, Nicholas Piggin, 2024/11/03
- [PULL 38/67] target/ppc: optimize p9 exception handling routines, Nicholas Piggin, 2024/11/03
- [PULL 39/67] target/ppc: optimize p8 exception handling routines, Nicholas Piggin, 2024/11/03
- [PULL 40/67] target/ppc: optimize p7 exception handling routines, Nicholas Piggin, 2024/11/03
- [PULL 42/67] target/ppc: combine multiple ail checks into one, Nicholas Piggin, 2024/11/03
- [PULL 43/67] target/ppc: reduce duplicate code between init_proc_POWER{9, 10}, Nicholas Piggin, 2024/11/03