From 50cf5634da02acd7389fc22e0f8d7bfae304c4c6 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Sun, 3 Feb 2019 17:47:36 -0500 Subject: [PATCH] target/arm: Enable API, APK bits in SCR, HCR These bits become writable with the ARMv8.3-PAuth extension. Backports commit ef682cdb4aded5c65a018e175482e875de66059d from qemu --- qemu/target/arm/helper.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/qemu/target/arm/helper.c b/qemu/target/arm/helper.c index 9add1190..e25192e5 100644 --- a/qemu/target/arm/helper.c +++ b/qemu/target/arm/helper.c @@ -1655,6 +1655,9 @@ static void scr_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value) if (cpu_isar_feature(aa64_lor, cpu)) { valid_mask |= SCR_TLOR; } + if (cpu_isar_feature(aa64_pauth, cpu)) { + valid_mask |= SCR_API | SCR_APK; + } /* Clear all-context RES0 bits. */ value &= valid_mask; @@ -4023,6 +4026,9 @@ static void hcr_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value) if (cpu_isar_feature(aa64_lor, cpu)) { valid_mask |= HCR_TLOR; } + if (cpu_isar_feature(aa64_pauth, cpu)) { + valid_mask |= HCR_API | HCR_APK; + } /* Clear RES0 bits. */ value &= valid_mask;