[PATCH] target/arm: Fix PAuth keys access checks for disabled SEL2

Florian Lugou posted 1 patch 1 year, 11 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20220517145242.1215271-1-florian.lugou@provenrun.com
Maintainers: Peter Maydell <peter.maydell@linaro.org>
target/arm/helper.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] target/arm: Fix PAuth keys access checks for disabled SEL2
Posted by Florian Lugou 1 year, 11 months ago
As per the description of the HCR_EL2.APK field in the ARMv8 ARM,
Pointer Authentication keys accesses should only be trapped to Secure
EL2 if it is enabled.

Signed-off-by: Florian Lugou <florian.lugou@provenrun.com>
---
 target/arm/helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/arm/helper.c b/target/arm/helper.c
index 432bd81919..29f73c7343 100644
--- a/target/arm/helper.c
+++ b/target/arm/helper.c
@@ -6758,7 +6758,7 @@ static CPAccessResult access_pauth(CPUARMState *env, const ARMCPRegInfo *ri,
     int el = arm_current_el(env);
 
     if (el < 2 &&
-        arm_feature(env, ARM_FEATURE_EL2) &&
+        arm_is_el2_enabled(env) &&
         !(arm_hcr_el2_eff(env) & HCR_APK)) {
         return CP_ACCESS_TRAP_EL2;
     }
-- 
2.25.1
Re: [PATCH] target/arm: Fix PAuth keys access checks for disabled SEL2
Posted by Peter Maydell 1 year, 11 months ago
On Tue, 17 May 2022 at 15:53, Florian Lugou <florian.lugou@provenrun.com> wrote:
>
> As per the description of the HCR_EL2.APK field in the ARMv8 ARM,
> Pointer Authentication keys accesses should only be trapped to Secure
> EL2 if it is enabled.
>
> Signed-off-by: Florian Lugou <florian.lugou@provenrun.com>
> ---
>  target/arm/helper.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM
Re: [PATCH] target/arm: Fix PAuth keys access checks for disabled SEL2
Posted by Richard Henderson 1 year, 11 months ago
On 5/17/22 07:52, Florian Lugou wrote:
> As per the description of the HCR_EL2.APK field in the ARMv8 ARM,
> Pointer Authentication keys accesses should only be trapped to Secure
> EL2 if it is enabled.
> 
> Signed-off-by: Florian Lugou <florian.lugou@provenrun.com>
> ---
>   target/arm/helper.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)


Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~