[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH v2 07/19] target/arm: Move helper_set_pstate_* into cpregs.c
From: |
Fabiano Rosas |
Subject: |
[RFC PATCH v2 07/19] target/arm: Move helper_set_pstate_* into cpregs.c |
Date: |
Mon, 9 Jan 2023 19:42:20 -0300 |
We want to move sme_helper into the tcg directory, but the cpregs
accessor functions cannot go along, otherwise they would be separate
from the respective ARMCPRegInfo definition which needs to be compiled
with CONFIG_TCG=n as well.
Signed-off-by: Fabiano Rosas <farosas@suse.de>
---
target/arm/cpregs.c | 29 +++++++++++++++++++++++++++++
target/arm/sme_helper.c | 29 -----------------------------
2 files changed, 29 insertions(+), 29 deletions(-)
diff --git a/target/arm/cpregs.c b/target/arm/cpregs.c
index 88d71dbe70..a6deae9926 100644
--- a/target/arm/cpregs.c
+++ b/target/arm/cpregs.c
@@ -6633,6 +6633,35 @@ static CPAccessResult access_esm(CPUARMState *env, const
ARMCPRegInfo *ri,
return CP_ACCESS_OK;
}
+void helper_set_pstate_sm(CPUARMState *env, uint32_t i)
+{
+ if (i == FIELD_EX64(env->svcr, SVCR, SM)) {
+ return;
+ }
+ env->svcr ^= R_SVCR_SM_MASK;
+ arm_reset_sve_state(env);
+}
+
+void helper_set_pstate_za(CPUARMState *env, uint32_t i)
+{
+ if (i == FIELD_EX64(env->svcr, SVCR, ZA)) {
+ return;
+ }
+ env->svcr ^= 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));
+ }
+}
+
static void svcr_write(CPUARMState *env, const ARMCPRegInfo *ri,
uint64_t value)
{
diff --git a/target/arm/sme_helper.c b/target/arm/sme_helper.c
index f891306bb9..ed04daf5d4 100644
--- a/target/arm/sme_helper.c
+++ b/target/arm/sme_helper.c
@@ -38,35 +38,6 @@ void arm_reset_sve_state(CPUARMState *env)
vfp_set_fpcr(env, 0x0800009f);
}
-void helper_set_pstate_sm(CPUARMState *env, uint32_t i)
-{
- if (i == FIELD_EX64(env->svcr, SVCR, SM)) {
- return;
- }
- env->svcr ^= R_SVCR_SM_MASK;
- arm_reset_sve_state(env);
-}
-
-void helper_set_pstate_za(CPUARMState *env, uint32_t i)
-{
- if (i == FIELD_EX64(env->svcr, SVCR, ZA)) {
- return;
- }
- env->svcr ^= 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));
- }
-}
-
void helper_sme_zero(CPUARMState *env, uint32_t imm, uint32_t svl)
{
uint32_t i;
--
2.35.3
- [RFC PATCH v2 00/19] target/arm: Allow CONFIG_TCG=n builds, Fabiano Rosas, 2023/01/09
- [RFC PATCH v2 01/19] target/arm: rename handle_semihosting to tcg_handle_semihosting, Fabiano Rosas, 2023/01/09
- [RFC PATCH v2 02/19] target/arm: wrap psci call with tcg_enabled, Fabiano Rosas, 2023/01/09
- [RFC PATCH v2 03/19] target/arm: wrap call to aarch64_sve_change_el in tcg_enabled(), Fabiano Rosas, 2023/01/09
- [RFC PATCH v2 04/19] target/arm: Move PC alignment check, Fabiano Rosas, 2023/01/09
- [RFC PATCH v2 06/19] target/arm: Move define_debug_regs() to cpregs.c, Fabiano Rosas, 2023/01/09
- [RFC PATCH v2 07/19] target/arm: Move helper_set_pstate_* into cpregs.c,
Fabiano Rosas <=
- [RFC PATCH v2 05/19] target/arm: Move cpregs code into cpregs.c, Fabiano Rosas, 2023/01/09
- [RFC PATCH v2 08/19] target/arm: move translate modules to tcg/, Fabiano Rosas, 2023/01/09
- [RFC PATCH v2 09/19] target/arm: move helpers to tcg/, Fabiano Rosas, 2023/01/09
- [RFC PATCH v2 10/19] target/arm: Move psci.c into the tcg directory, Fabiano Rosas, 2023/01/09
- [RFC PATCH v2 11/19] target/arm: Wrap arm_rebuild_hflags calls with tcg_enabled, Fabiano Rosas, 2023/01/09