qemu-arm
[Top][All Lists]
Advanced

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

Re: [PATCH v7 25/42] target/arm: Implement helper_mte_check1


From: Peter Maydell
Subject: Re: [PATCH v7 25/42] target/arm: Implement helper_mte_check1
Date: Fri, 19 Jun 2020 14:44:29 +0100

On Wed, 3 Jun 2020 at 02:13, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Fill out the stub that was added earlier.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  target/arm/internals.h  |  47 +++++++++++++++
>  target/arm/mte_helper.c | 126 +++++++++++++++++++++++++++++++++++++++-
>  2 files changed, 172 insertions(+), 1 deletion(-)


> +/*
> + * For TBI, ideally, we would do nothing.  Proper behaviour on fault is
> + * for the tag to be present in the FAR_ELx register.  But for user-only
> + * mode, we do not have a TLB with which to implement this, so we must
> + * remote the top byte.

"remove"

> + */
> +static inline uint64_t useronly_clean_ptr(uint64_t ptr)
> +{
> +    /* TBI is known to be enabled. */
> +#ifdef CONFIG_USER_ONLY
> +    ptr = sextract64(ptr, 0, 56);
> +#endif
> +    return ptr;
> +}
> +

> +/* No-fault version of mte_check1, to be used by SVE for MemSingleNF. */
> +bool mte_probe1(CPUARMState *env, uint32_t desc, uint64_t ptr, uintptr_t ra)

If this is a no-fault version, why do we need to pass in the ra ?

> +{
> +    int bit55 = extract64(ptr, 55, 1);
> +
> +    /* If TBI is disabled, the access is unchecked. */
> +    if (unlikely(!tbi_check(desc, bit55))) {
> +        return true;
> +    }
> +
> +    return mte_probe1_int(env, desc, ptr, ra, bit55);
> +}

thanks
-- PMM



reply via email to

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