[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 18/20] target/arm: Move e2h_access() helper around
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 18/20] target/arm: Move e2h_access() helper around |
Date: |
Thu, 18 Jan 2024 21:06:39 +0100 |
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>
---
target/arm/helper.c | 29 +++++++++++++++--------------
1 file changed, 15 insertions(+), 14 deletions(-)
diff --git a/target/arm/helper.c b/target/arm/helper.c
index dc8f14f433..1ef00e50e4 100644
--- a/target/arm/helper.c
+++ b/target/arm/helper.c
@@ -3342,20 +3342,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
/*
@@ -6543,6 +6529,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)
{
--
2.41.0
- [PATCH 07/20] target/arm/cpregs: Include missing 'kvm-consts.h' header, (continued)
- [PATCH 07/20] target/arm/cpregs: Include missing 'kvm-consts.h' header, Philippe Mathieu-Daudé, 2024/01/18
- [PATCH 08/20] target/arm: Rename arm_cpu_mp_affinity, Philippe Mathieu-Daudé, 2024/01/18
- [PATCH 09/20] target/arm: Create arm_cpu_mp_affinity, Philippe Mathieu-Daudé, 2024/01/18
- [PATCH 10/20] target/arm: Expose arm_cpu_mp_affinity() in 'multiprocessing.h' header, Philippe Mathieu-Daudé, 2024/01/18
- [PATCH 11/20] target/arm: Declare ARM_CPU_TYPE_NAME/SUFFIX in 'cpu-qom.h', Philippe Mathieu-Daudé, 2024/01/18
- [PATCH 12/20] hw/cpu/a9mpcore: Build it only once, Philippe Mathieu-Daudé, 2024/01/18
- [PATCH 13/20] hw/misc/xlnx-versal-crl: Include generic 'cpu-qom.h' instead of 'cpu.h', Philippe Mathieu-Daudé, 2024/01/18
- [PATCH 14/20] hw/misc/xlnx-versal-crl: Build it only once, Philippe Mathieu-Daudé, 2024/01/18
- [PATCH 15/20] target/arm: Expose M-profile register bank index definitions, Philippe Mathieu-Daudé, 2024/01/18
- [PATCH 16/20] hw/arm/armv7m: Make 'hw/intc/armv7m_nvic.h' a target agnostic header, Philippe Mathieu-Daudé, 2024/01/18
- [PATCH 18/20] target/arm: Move e2h_access() helper around,
Philippe Mathieu-Daudé <=
- [PATCH 17/20] target/arm: Move ARM_CPU_IRQ/FIQ definitions to 'cpu-qom.h' header, Philippe Mathieu-Daudé, 2024/01/18
- [PATCH 19/20] target/arm: Move GTimer definitions to new 'gtimer.h' header, Philippe Mathieu-Daudé, 2024/01/18
- [PATCH 20/20] hw/arm: Build various units only once, Philippe Mathieu-Daudé, 2024/01/18
- Re: [PATCH 00/20] arm: Rework target/ headers to build various hw/ files once, Philippe Mathieu-Daudé, 2024/01/18
- Re: [PATCH 00/20] arm: Rework target/ headers to build various hw/ files once, Richard Henderson, 2024/01/18
- Re: [PATCH 00/20] arm: Rework target/ headers to build various hw/ files once, Peter Maydell, 2024/01/19