[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 08/41] target/arm: Set CTR_EL0.{IDC,DIC} for the 'max' CPU
|
From: |
Peter Maydell |
|
Subject: |
[PULL 08/41] target/arm: Set CTR_EL0.{IDC,DIC} for the 'max' CPU |
|
Date: |
Thu, 11 Jan 2024 11:04:32 +0000 |
The CTR_EL0 register has some bits which allow the implementation to
tell the guest that it does not need to do cache maintenance for
data-to-instruction coherence and instruction-to-data coherence.
QEMU doesn't emulate caches and so our cache maintenance insns are
all NOPs.
We already have some models of specific CPUs where we set these bits
(e.g. the Neoverse V1), but the 'max' CPU still uses the settings it
inherits from Cortex-A57. Set the bits for 'max' as well, so the
guest doesn't need to do unnecessary work.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Tested-by: Miguel Luis <miguel.luis@oracle.com>
---
target/arm/tcg/cpu64.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/target/arm/tcg/cpu64.c b/target/arm/tcg/cpu64.c
index fcda99e1583..40e7a45166f 100644
--- a/target/arm/tcg/cpu64.c
+++ b/target/arm/tcg/cpu64.c
@@ -1105,6 +1105,16 @@ void aarch64_max_tcg_initfn(Object *obj)
u = FIELD_DP32(u, CLIDR_EL1, LOUU, 0);
cpu->clidr = u;
+ /*
+ * Set CTR_EL0.DIC and IDC to tell the guest it doesnt' need to
+ * do any cache maintenance for data-to-instruction or
+ * instruction-to-guest coherence. (Our cache ops are nops.)
+ */
+ t = cpu->ctr;
+ t = FIELD_DP64(t, CTR_EL0, IDC, 1);
+ t = FIELD_DP64(t, CTR_EL0, DIC, 1);
+ cpu->ctr = t;
+
t = cpu->isar.id_aa64isar0;
t = FIELD_DP64(t, ID_AA64ISAR0, AES, 2); /* FEAT_PMULL */
t = FIELD_DP64(t, ID_AA64ISAR0, SHA1, 1); /* FEAT_SHA1 */
--
2.34.1
- [PULL 04/41] hw/intc/armv7m_nvic: add "num-prio-bits" property, (continued)
- [PULL 04/41] hw/intc/armv7m_nvic: add "num-prio-bits" property, Peter Maydell, 2024/01/11
- [PULL 07/41] hw/arm: Add missing QOM parent for v7-M SoCs, Peter Maydell, 2024/01/11
- [PULL 03/41] hw/arm: Add minimal support for the B-L475E-IOT01A board, Peter Maydell, 2024/01/11
- [PULL 05/41] hw/arm/armv7m: alias the NVIC "num-prio-bits" property, Peter Maydell, 2024/01/11
- [PULL 14/41] target/arm: Allow use of upper 32 bits of TBFLAG_A64, Peter Maydell, 2024/01/11
- [PULL 41/41] target/arm: Add FEAT_NV2 to max, neoverse-n2, neoverse-v1 CPUs, Peter Maydell, 2024/01/11
- [PULL 38/41] hw/intc/arm_gicv3_cpuif: Mark up VNCR offsets for GIC CPU registers, Peter Maydell, 2024/01/11
- [PULL 02/41] hw/arm: Add minimal support for the STM32L4x5 SoC, Peter Maydell, 2024/01/11
- [PULL 06/41] hw/arm/socs: configure priority bits for existing SOCs, Peter Maydell, 2024/01/11
- [PULL 09/41] hw/intc/arm_gicv3_cpuif: handle LPIs in in the list registers, Peter Maydell, 2024/01/11
- [PULL 08/41] target/arm: Set CTR_EL0.{IDC,DIC} for the 'max' CPU,
Peter Maydell <=
[PULL 11/41] target/arm: Implement HCR_EL2.AT handling, Peter Maydell, 2024/01/11
[PULL 10/41] target/arm: Handle HCR_EL2 accesses for bits introduced with FEAT_NV, Peter Maydell, 2024/01/11
[PULL 13/41] target/arm: Always honour HCR_EL2.TSC when HCR_EL2.NV is set, Peter Maydell, 2024/01/11
[PULL 16/41] target/arm: *_EL12 registers should UNDEF when HCR_EL2.E2H is 0, Peter Maydell, 2024/01/11
[PULL 28/41] target/arm: Handle HCR_EL2 accesses for FEAT_NV2 bits, Peter Maydell, 2024/01/11
[PULL 25/41] target/arm: Treat LDTR* and STTR* as LDR/STR when NV, NV1 is 1, 1, Peter Maydell, 2024/01/11