[PATCH 07/11] target/arm: Enable TTBCR_EAE for ARM_FEATURE_V8_R

Tobias Roehmel posted 11 patches 3 years, 7 months ago
Maintainers: Peter Maydell <peter.maydell@linaro.org>
There is a newer version of this series
[PATCH 07/11] target/arm: Enable TTBCR_EAE for ARM_FEATURE_V8_R
Posted by Tobias Roehmel 3 years, 7 months ago
From: Tobias Röhmel <quic_trohmel@quicinc.com>

Enable TTBCR_EAE during reset since it's always set to 1 for Cortex-R52.
See ARM Architecture Reference Manual Supplement - ARMv8, for the ARMv8-R
AArch32 architecture profile Version:A.c section C1.2.

Signed-off-by: Tobias Röhmel <quic_trohmel@quicinc.com>
---
 target/arm/cpu.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/target/arm/cpu.c b/target/arm/cpu.c
index 2c26a5387d..121fc2a819 100644
--- a/target/arm/cpu.c
+++ b/target/arm/cpu.c
@@ -261,6 +261,9 @@ static void arm_cpu_reset(DeviceState *dev)
         if (arm_feature(env, ARM_FEATURE_V8_R)) {
             env->cp15.rvbar = cpu->rvbar_prop;
             env->regs[15] = cpu->rvbar_prop;
+            env->cp15.tcr_el[0].raw_tcr = TTBCR_EAE;
+            env->cp15.tcr_el[1].raw_tcr = TTBCR_EAE;
+            env->cp15.tcr_el[2].raw_tcr = TTBCR_EAE;
         }
     }
 
-- 
2.25.1


Re: [PATCH 07/11] target/arm: Enable TTBCR_EAE for ARM_FEATURE_V8_R
Posted by Peter Maydell 3 years, 7 months ago
On Thu, 14 Jul 2022 at 15:54, Tobias Roehmel <quic_trohmel@quicinc.com> wrote:
>
> From: Tobias Röhmel <quic_trohmel@quicinc.com>
>
> Enable TTBCR_EAE during reset since it's always set to 1 for Cortex-R52.
> See ARM Architecture Reference Manual Supplement - ARMv8, for the ARMv8-R
> AArch32 architecture profile Version:A.c section C1.2.
>
> Signed-off-by: Tobias Röhmel <quic_trohmel@quicinc.com>
> ---
>  target/arm/cpu.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/target/arm/cpu.c b/target/arm/cpu.c
> index 2c26a5387d..121fc2a819 100644
> --- a/target/arm/cpu.c
> +++ b/target/arm/cpu.c
> @@ -261,6 +261,9 @@ static void arm_cpu_reset(DeviceState *dev)
>          if (arm_feature(env, ARM_FEATURE_V8_R)) {
>              env->cp15.rvbar = cpu->rvbar_prop;
>              env->regs[15] = cpu->rvbar_prop;
> +            env->cp15.tcr_el[0].raw_tcr = TTBCR_EAE;
> +            env->cp15.tcr_el[1].raw_tcr = TTBCR_EAE;
> +            env->cp15.tcr_el[2].raw_tcr = TTBCR_EAE;
>          }
>      }

R-profile doesn't have a TTBCR, so I'm not sure this is the right way
to handle this behaviour requirement... Probably extended_addresses_enabled()
and similar places should just return true for v8 PMSA.

-- PMM