@@ -160,8 +160,19 @@ typedef struct user_fpsimd_state elf_fpregset_t;
#define SET_PERSONALITY(ex) \
({ \
+ if (IS_ENABLED(CONFIG_ARM64_ERRATUM_1418040)) \
+ preempt_disable(); \
+ \
clear_thread_flag(TIF_32BIT); \
current->personality &= ~READ_IMPLIES_EXEC; \
+ \
+ if (IS_ENABLED(CONFIG_ARM64_ERRATUM_1418040) && \
+ this_cpu_has_cap(ARM64_WORKAROUND_1418040)) \
+ sysreg_clear_set(cntkctl_el1, 0, \
+ ARCH_TIMER_USR_VCT_ACCESS_EN); \
+ \
+ if (IS_ENABLED(CONFIG_ARM64_ERRATUM_1418040)) \
+ preempt_enable(); \
})
/* update AT_VECTOR_SIZE_ARCH if the number of NEW_AUX_ENT entries changes */
@@ -223,7 +234,18 @@ int compat_elf_check_arch(const struct elf32_hdr *);
*/
#define COMPAT_SET_PERSONALITY(ex) \
({ \
+ if (IS_ENABLED(CONFIG_ARM64_ERRATUM_1418040)) \
+ preempt_disable(); \
+ \
set_thread_flag(TIF_32BIT); \
+ \
+ if (IS_ENABLED(CONFIG_ARM64_ERRATUM_1418040) && \
+ this_cpu_has_cap(ARM64_WORKAROUND_1418040)) \
+ sysreg_clear_set(cntkctl_el1, \
+ ARCH_TIMER_USR_VCT_ACCESS_EN, 0); \
+ \
+ if (IS_ENABLED(CONFIG_ARM64_ERRATUM_1418040)) \
+ preempt_enable(); \
})
#ifdef CONFIG_COMPAT_VDSO
#define COMPAT_ARCH_DLINFO \