return ptrauth_clear_pac(ptr);
 }
 
+static __always_inline void ptrauth_enable(void)
+{
+       if (!system_supports_address_auth())
+               return;
+       sysreg_clear_set(sctlr_el1, 0, (SCTLR_ELx_ENIA | SCTLR_ELx_ENIB |
+                                       SCTLR_ELx_ENDA | SCTLR_ELx_ENDB));
+       isb();
+}
+
 #define ptrauth_thread_init_user(tsk)                                  \
        ptrauth_keys_init_user(&(tsk)->thread.keys_user)
 #define ptrauth_thread_init_kernel(tsk)                                        \
        ptrauth_keys_switch_kernel(&(tsk)->thread.keys_kernel)
 
 #else /* CONFIG_ARM64_PTR_AUTH */
+#define ptrauth_enable()
 #define ptrauth_prctl_reset_keys(tsk, arg)     (-EINVAL)
 #define ptrauth_strip_insn_pac(lr)     (lr)
 #define ptrauth_thread_init_user(tsk)
 
        adr_l   x5, init_task
        msr     sp_el0, x5                      // Save thread_info
 
-#ifdef CONFIG_ARM64_PTR_AUTH
-       __ptrauth_keys_init_cpu x5, x6, x7, x8
-#endif
-
        adr_l   x8, vectors                     // load VBAR_EL1 with virtual
        msr     vbar_el1, x8                    // vector table address
        isb