qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 5/7] targer/arm: Inform helpers whether a PAC instruction is


From: Peter Maydell
Subject: Re: [PATCH 5/7] targer/arm: Inform helpers whether a PAC instruction is 'combined'
Date: Mon, 13 Feb 2023 17:08:09 +0000

On Thu, 2 Feb 2023 at 21:12, Aaron Lindsay <aaron@os.amperecomputing.com> wrote:
>
> An instruction is a 'combined' Pointer Authentication instruction if it
> does something in addition to PAC - for instance, branching to or
> loading an address from the authenticated pointer. Knowing whether a PAC
> operation is 'combined' is needed to implement the FPACCOMBINE feature
> for ARMv8.3.
>
> Signed-off-by: Aaron Lindsay <aaron@os.amperecomputing.com>
> ---


> -uint64_t HELPER(autia)(CPUARMState *env, uint64_t x, uint64_t y)
> +static uint64_t pauth_autia(CPUARMState *env, uint64_t x, uint64_t y,
> +                            bool is_combined)
>  {
>      int el = arm_current_el(env);
>      if (!pauth_key_enabled(env, el, SCTLR_EnIA)) {
>          return x;
>      }
>      pauth_check_trap(env, el, GETPC());

You can't move a GETPC() into a sub-function like this : it has
to remain in the top level helper function. If you need the
value in a sub-function, you need to pass it down. This is why
pauth_check_trap() has its 'ra' argument. (See patch 6 review
comment for more explanation.)

> -    return pauth_auth(env, x, y, &env->keys.apia, false, 0);
> +    return pauth_auth(env, x, y, &env->keys.apia, false, 0, is_combined);
>  }

thanks
-- PMM



reply via email to

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