aboutsummaryrefslogtreecommitdiff
path: root/target/arm/helper.c
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2023-01-12 11:24:32 +0100
committerPeter Maydell <peter.maydell@linaro.org>2023-01-23 13:32:38 +0000
commit2a8af3825958e5d8c98b3ca92ac42a10e25db9e1 (patch)
treeaf55992323929ac54ff8cdaf8efdf33fa0237267 /target/arm/helper.c
parent3c9ee548948870c14235e3fa8fb235c0c1c20822 (diff)
downloadqemu-2a8af3825958e5d8c98b3ca92ac42a10e25db9e1.zip
qemu-2a8af3825958e5d8c98b3ca92ac42a10e25db9e1.tar.gz
qemu-2a8af3825958e5d8c98b3ca92ac42a10e25db9e1.tar.bz2
target/arm/sme: Introduce aarch64_set_svcr()
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-4-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>
Diffstat (limited to 'target/arm/helper.c')
-rw-r--r--target/arm/helper.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/target/arm/helper.c b/target/arm/helper.c
index 22ea8fb..24c069b 100644
--- a/target/arm/helper.c
+++ b/target/arm/helper.c
@@ -6725,11 +6725,19 @@ static CPAccessResult access_esm(CPUARMState *env, const ARMCPRegInfo *ri,
return CP_ACCESS_OK;
}
+void aarch64_set_svcr(CPUARMState *env, uint64_t new, uint64_t mask)
+{
+ uint64_t change = (env->svcr ^ new) & mask;
+
+ env->svcr ^= change;
+}
+
static void svcr_write(CPUARMState *env, const ARMCPRegInfo *ri,
uint64_t value)
{
helper_set_pstate_sm(env, FIELD_EX64(value, SVCR, SM));
helper_set_pstate_za(env, FIELD_EX64(value, SVCR, ZA));
+ aarch64_set_svcr(env, value, -1);
arm_rebuild_hflags(env);
}