Merge tag 'defconfig-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc
[linux-2.6-microblaze.git] / arch / arm64 / include / asm / pointer_auth.h
index 28a78b6..efb098d 100644 (file)
@@ -10,6 +10,9 @@
 #include <asm/memory.h>
 #include <asm/sysreg.h>
 
+#define PR_PAC_ENABLED_KEYS_MASK                                               \
+       (PR_PAC_APIAKEY | PR_PAC_APIBKEY | PR_PAC_APDAKEY | PR_PAC_APDBKEY)
+
 #ifdef CONFIG_ARM64_PTR_AUTH
 /*
  * Each key is a 128-bit quantity which is split across a pair of 64-bit
@@ -117,9 +120,9 @@ static __always_inline void ptrauth_enable(void)
                                                                               \
                /* enable all keys */                                          \
                if (system_supports_address_auth())                            \
-                       set_task_sctlr_el1(current->thread.sctlr_user |        \
-                                          SCTLR_ELx_ENIA | SCTLR_ELx_ENIB |   \
-                                          SCTLR_ELx_ENDA | SCTLR_ELx_ENDB);   \
+                       ptrauth_set_enabled_keys(current,                      \
+                                                PR_PAC_ENABLED_KEYS_MASK,     \
+                                                PR_PAC_ENABLED_KEYS_MASK);    \
        } while (0)
 
 #define ptrauth_thread_switch_user(tsk)                                        \
@@ -146,7 +149,4 @@ static __always_inline void ptrauth_enable(void)
 #define ptrauth_thread_switch_kernel(tsk)
 #endif /* CONFIG_ARM64_PTR_AUTH_KERNEL */
 
-#define PR_PAC_ENABLED_KEYS_MASK                                               \
-       (PR_PAC_APIAKEY | PR_PAC_APIBKEY | PR_PAC_APDAKEY | PR_PAC_APDBKEY)
-
 #endif /* __ASM_POINTER_AUTH_H */