[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 17/26] target/arm/sme: Reset ZA state in aarch64_set_svcr()
From: |
Peter Maydell |
Subject: |
[PULL 17/26] target/arm/sme: Reset ZA state in aarch64_set_svcr() |
Date: |
Mon, 23 Jan 2023 13:35:44 +0000 |
From: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20230112102436.1913-6-philmd@linaro.org
Message-Id: <20230112004322.161330-1-richard.henderson@linaro.org>
[PMD: Split patch in multiple tiny steps]
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
target/arm/helper.c | 12 ++++++++++++
target/arm/sme_helper.c | 12 ------------
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/target/arm/helper.c b/target/arm/helper.c
index 0ac867c4119..564c5d93320 100644
--- a/target/arm/helper.c
+++ b/target/arm/helper.c
@@ -6743,6 +6743,18 @@ void aarch64_set_svcr(CPUARMState *env, uint64_t new,
uint64_t mask)
if (change & R_SVCR_SM_MASK) {
arm_reset_sve_state(env);
}
+
+ /*
+ * ResetSMEState.
+ *
+ * SetPSTATE_ZA zeros on enable and disable. We can zero this only
+ * on enable: while disabled, the storage is inaccessible and the
+ * value does not matter. We're not saving the storage in vmstate
+ * when disabled either.
+ */
+ if (change & new & R_SVCR_ZA_MASK) {
+ memset(env->zarray, 0, sizeof(env->zarray));
+ }
}
static void svcr_write(CPUARMState *env, const ARMCPRegInfo *ri,
diff --git a/target/arm/sme_helper.c b/target/arm/sme_helper.c
index f73bf4d2853..e146c17ba19 100644
--- a/target/arm/sme_helper.c
+++ b/target/arm/sme_helper.c
@@ -44,18 +44,6 @@ void helper_set_pstate_za(CPUARMState *env, uint32_t i)
return;
}
aarch64_set_svcr(env, 0, R_SVCR_ZA_MASK);
-
- /*
- * ResetSMEState.
- *
- * SetPSTATE_ZA zeros on enable and disable. We can zero this only
- * on enable: while disabled, the storage is inaccessible and the
- * value does not matter. We're not saving the storage in vmstate
- * when disabled either.
- */
- if (i) {
- memset(env->zarray, 0, sizeof(env->zarray));
- }
arm_rebuild_hflags(env);
}
--
2.34.1
- [PULL 21/26] target/arm: Fix in_debug path in S1_ptw_translate, (continued)
- [PULL 21/26] target/arm: Fix in_debug path in S1_ptw_translate, Peter Maydell, 2023/01/23
- [PULL 18/26] target/arm/sme: Rebuild hflags in aarch64_set_svcr(), Peter Maydell, 2023/01/23
- [PULL 02/26] target/arm: Unify checking for M Main Extension in MRS/MSR, Peter Maydell, 2023/01/23
- [PULL 03/26] hw/i2c/bitbang_i2c: Define TYPE_GPIO_I2C in public header, Peter Maydell, 2023/01/23
- [PULL 04/26] hw/i2c/bitbang_i2c: Remove unused dummy MemoryRegion, Peter Maydell, 2023/01/23
- [PULL 08/26] hw/i2c/versatile_i2c: Drop useless casts from void * to pointer, Peter Maydell, 2023/01/23
- [PULL 06/26] hw/i2c/bitbang_i2c: Trace state changes, Peter Maydell, 2023/01/23
- [PULL 10/26] hw/i2c/versatile_i2c: Replace TYPE_VERSATILE_I2C -> TYPE_ARM_SBCON_I2C, Peter Maydell, 2023/01/23
- [PULL 05/26] hw/i2c/bitbang_i2c: Change state calling bitbang_i2c_set_state() helper, Peter Maydell, 2023/01/23
- [PULL 12/26] hw/i2c/versatile_i2c: Rename versatile_i2c -> arm_sbcon_i2c, Peter Maydell, 2023/01/23
- [PULL 17/26] target/arm/sme: Reset ZA state in aarch64_set_svcr(),
Peter Maydell <=
- [PULL 23/26] target/arm: implement DBGCLAIM registers, Peter Maydell, 2023/01/23
- [PULL 20/26] target/arm: Fix physical address resolution for MTE, Peter Maydell, 2023/01/23
- [PULL 25/26] target/arm: Reorg do_coproc_insn, Peter Maydell, 2023/01/23
- [PULL 14/26] target/arm/sme: Rebuild hflags in set_pstate() helpers, Peter Maydell, 2023/01/23
- [PULL 13/26] target/arm/sme: Reorg SME access handling in handle_msr_i(), Peter Maydell, 2023/01/23
- [PULL 24/26] target/arm: provide stubs for more external debug registers, Peter Maydell, 2023/01/23
- [PULL 26/26] target/arm: Look up ARMCPRegInfo at runtime, Peter Maydell, 2023/01/23
- Re: [PULL 00/26] target-arm queue, Peter Maydell, 2023/01/23