[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 27/36] target/arm: Move e2h_access() helper around
|
From: |
Peter Maydell |
|
Subject: |
[PULL 27/36] target/arm: Move e2h_access() helper around |
|
Date: |
Fri, 26 Jan 2024 14:33:32 +0000 |
From: Philippe Mathieu-Daudé <philmd@linaro.org>
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>
---
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 e068d353831..e07b2af8a3d 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)
{
--
2.34.1
- [PULL 16/36] target/arm/cpregs: Include missing 'kvm-consts.h' header, (continued)
- [PULL 16/36] target/arm/cpregs: Include missing 'kvm-consts.h' header, Peter Maydell, 2024/01/26
- [PULL 17/36] target/arm: Rename arm_cpu_mp_affinity, Peter Maydell, 2024/01/26
- [PULL 18/36] target/arm: Create arm_cpu_mp_affinity, Peter Maydell, 2024/01/26
- [PULL 19/36] target/arm: Expose arm_cpu_mp_affinity() in 'multiprocessing.h' header, Peter Maydell, 2024/01/26
- [PULL 21/36] hw/cpu/a9mpcore: Build it only once, Peter Maydell, 2024/01/26
- [PULL 23/36] hw/misc/xlnx-versal-crl: Build it only once, Peter Maydell, 2024/01/26
- [PULL 22/36] hw/misc/xlnx-versal-crl: Include generic 'cpu-qom.h' instead of 'cpu.h', Peter Maydell, 2024/01/26
- [PULL 25/36] hw/arm/armv7m: Make 'hw/intc/armv7m_nvic.h' a target agnostic header, Peter Maydell, 2024/01/26
- [PULL 30/36] fsl-imx6ul: Add various missing unimplemented devices, Peter Maydell, 2024/01/26
- [PULL 24/36] target/arm: Expose M-profile register bank index definitions, Peter Maydell, 2024/01/26
- [PULL 27/36] target/arm: Move e2h_access() helper around,
Peter Maydell <=
- [PULL 26/36] target/arm: Move ARM_CPU_IRQ/FIQ definitions to 'cpu-qom.h' header, Peter Maydell, 2024/01/26
- [PULL 28/36] target/arm: Move GTimer definitions to new 'gtimer.h' header, Peter Maydell, 2024/01/26
- [PULL 29/36] hw/arm: Build various units only once, Peter Maydell, 2024/01/26
- [PULL 32/36] hw/char/imx_serial: Implement receive FIFO and ageing timer, Peter Maydell, 2024/01/26
- [PULL 36/36] hw/arm: add PCIe to Freescale i.MX6, Peter Maydell, 2024/01/26
- [PULL 31/36] docs/system/arm/virt.rst: Add note on CPU features off by default, Peter Maydell, 2024/01/26
- [PULL 33/36] target/arm: Fix A64 scalar SQSHRN and SQRSHRN, Peter Maydell, 2024/01/26
- [PULL 35/36] target/arm: Fix incorrect aa64_tidcp1 feature check, Peter Maydell, 2024/01/26
- [PULL 34/36] bswap.h: Fix const_le64() macro, Peter Maydell, 2024/01/26
- Re: [PULL 00/36] target-arm queue, Peter Maydell, 2024/01/27