aboutsummaryrefslogtreecommitdiff
path: root/target
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@linaro.org>2024-01-18 21:06:39 +0100
committerPeter Maydell <peter.maydell@linaro.org>2024-01-26 11:30:49 +0000
commit32b3a0c90095f4b5b453e72c2a3a25964ef04640 (patch)
tree90257ed132d9a9daf68bd3696e05171cbdfbc267 /target
parentd780d056f8acdee73a1c34d95733851d58aecd60 (diff)
downloadqemu-32b3a0c90095f4b5b453e72c2a3a25964ef04640.zip
qemu-32b3a0c90095f4b5b453e72c2a3a25964ef04640.tar.gz
qemu-32b3a0c90095f4b5b453e72c2a3a25964ef04640.tar.bz2
target/arm: Move e2h_access() helper around
e2h_access() was added in commit bb5972e439 ("target/arm: Add VHE timer register redirection and aliasing") close to the generic_timer_cp_reginfo[] array, but isn't used until vhe_reginfo[] definition. Move it closer to the other e2h helpers. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20240118200643.29037-19-philmd@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'target')
-rw-r--r--target/arm/helper.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/target/arm/helper.c b/target/arm/helper.c
index e068d35..e07b2af 100644
--- a/target/arm/helper.c
+++ b/target/arm/helper.c
@@ -3345,20 +3345,6 @@ static const ARMCPRegInfo generic_timer_cp_reginfo[] = {
},
};
-static CPAccessResult e2h_access(CPUARMState *env, const ARMCPRegInfo *ri,
- bool isread)
-{
- if (arm_current_el(env) == 1) {
- /* This must be a FEAT_NV access */
- /* TODO: FEAT_ECV will need to check CNTHCTL_EL2 here */
- return CP_ACCESS_OK;
- }
- if (!(arm_hcr_el2_eff(env) & HCR_E2H)) {
- return CP_ACCESS_TRAP;
- }
- return CP_ACCESS_OK;
-}
-
#else
/*
@@ -6546,6 +6532,21 @@ static const ARMCPRegInfo el3_cp_reginfo[] = {
};
#ifndef CONFIG_USER_ONLY
+
+static CPAccessResult e2h_access(CPUARMState *env, const ARMCPRegInfo *ri,
+ bool isread)
+{
+ if (arm_current_el(env) == 1) {
+ /* This must be a FEAT_NV access */
+ /* TODO: FEAT_ECV will need to check CNTHCTL_EL2 here */
+ return CP_ACCESS_OK;
+ }
+ if (!(arm_hcr_el2_eff(env) & HCR_E2H)) {
+ return CP_ACCESS_TRAP;
+ }
+ return CP_ACCESS_OK;
+}
+
/* Test if system register redirection is to occur in the current state. */
static bool redirect_for_e2h(CPUARMState *env)
{