qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 3/9] target/arm: Make RVBAR available for all ARMv8 CPUs


From: Peter Maydell
Subject: Re: [PATCH v2 3/9] target/arm: Make RVBAR available for all ARMv8 CPUs
Date: Fri, 12 Aug 2022 14:11:33 +0100

(I've added your rwth-aachen.de address because the quicinc
one seems to be bouncing :-( )

On Mon, 18 Jul 2022 at 12:54, Tobias Roehmel <quic_trohmel@quicinc.com> wrote:
>
> From: Tobias Röhmel <quic_trohmel@quicinc.com>
>
> Signed-off-by: Tobias Röhmel <quic_trohmel@quicinc.com>

Having looked a bit more carefully at the architecture
manual, I think this is not complete. In particular
you don't actually define the AArch32 RVBAR register
(which needs to exist with permissions permitting only
EL2 access if EL2 is the highest EL, and with permissions
for EL1 access if EL1 is the highest EL, in the same way
the AArch64 RVBAR_EL2 and RVBAR_EL1 work (ie by adding
AArch32 alias registers where we define RVBAR_EL2 and
RVBAR_EL1).

(AArch32 has no equivalent of RVBAR_EL3; MVBAR is kind
of the same thing, but it's not required that it has the
actual reset address in it on reset. So we can ignore that
as we're architecturally compliant for A-profile, and for
the R52 we don't care about EL3.).

The commit message here could also usefully be expanded
to explain what we're doing and why it's the right thing.

> ---
>  target/arm/cpu.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/target/arm/cpu.c b/target/arm/cpu.c
> index 1b5d535788..9007768418 100644
> --- a/target/arm/cpu.c
> +++ b/target/arm/cpu.c
> @@ -258,6 +258,10 @@ static void arm_cpu_reset(DeviceState *dev)
>          env->cp15.cpacr_el1 = FIELD_DP64(env->cp15.cpacr_el1,
>                                           CPACR, CP11, 3);
>  #endif
> +        if (arm_feature(env, ARM_FEATURE_V8)) {
> +            env->cp15.rvbar = cpu->rvbar_prop;
> +            env->regs[15] = cpu->rvbar_prop;
> +        }
>      }
>
>  #if defined(CONFIG_USER_ONLY)
> @@ -1273,7 +1277,7 @@ void arm_cpu_post_init(Object *obj)
>          qdev_property_add_static(DEVICE(obj), 
> &arm_cpu_reset_hivecs_property);
>      }
>
> -    if (arm_feature(&cpu->env, ARM_FEATURE_AARCH64)) {
> +    if (arm_feature(&cpu->env, ARM_FEATURE_V8)) {
>          object_property_add_uint64_ptr(obj, "rvbar",
>                                         &cpu->rvbar_prop,
>                                         OBJ_PROP_FLAG_READWRITE);

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]