You need to sign in or sign up before continuing.
提交 e2d0b5fd 编写于 作者: Y Yury Norov 提交者: Yang Yingliang

arm64: ilp32: add is_ilp32_compat_{task, thread} and TIF_32BIT_AARCH64

hulk inclusion
category: feature
bugzilla: NA
CVE: NA
---------------------------

ILP32 tasks are needed to be distinguished from LP64 and AARCH32.
This patch adds helper functions is_ilp32_compat_{task,thread} and
thread flag TIF_32BIT_AARCH64 to address it. This is a preparation
for following patches in ILP32 patchset.

For consistency, SET_PERSONALITY is changed here accordingly.
Signed-off-by: NAndrew Pinski <Andrew.Pinski@caviumnetworks.com>
Signed-off-by: NPhilipp Tomsich <philipp.tomsich@theobroma-systems.com>
Signed-off-by: NChristoph Muellner <christoph.muellner@theobroma-systems.com>
Signed-off-by: NYury Norov <ynorov@caviumnetworks.com>
Reviewed-by: NDavid Daney <ddaney@caviumnetworks.com>
Signed-off-by: NXiongfeng Wang <wangxiongfeng2@huawei.com>
Reviewed-by: NHanjun Guo &lt;guohanjun@huawei.com <mailto:guohanjun@huawei.com&gt;>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 dc20aaa3
...@@ -146,6 +146,7 @@ typedef struct user_fpsimd_state elf_fpregset_t; ...@@ -146,6 +146,7 @@ typedef struct user_fpsimd_state elf_fpregset_t;
#define SET_PERSONALITY(ex) \ #define SET_PERSONALITY(ex) \
({ \ ({ \
clear_thread_flag(TIF_32BIT_AARCH64); \
clear_thread_flag(TIF_32BIT); \ clear_thread_flag(TIF_32BIT); \
current->personality &= ~READ_IMPLIES_EXEC; \ current->personality &= ~READ_IMPLIES_EXEC; \
}) })
...@@ -207,6 +208,7 @@ typedef compat_elf_greg_t compat_elf_gregset_t[COMPAT_ELF_NGREG]; ...@@ -207,6 +208,7 @@ typedef compat_elf_greg_t compat_elf_gregset_t[COMPAT_ELF_NGREG];
*/ */
#define COMPAT_SET_PERSONALITY(ex) \ #define COMPAT_SET_PERSONALITY(ex) \
({ \ ({ \
clear_thread_flag(TIF_32BIT_AARCH64); \
set_thread_flag(TIF_32BIT); \ set_thread_flag(TIF_32BIT); \
}) })
#define COMPAT_ARCH_DLINFO #define COMPAT_ARCH_DLINFO
......
...@@ -33,18 +33,44 @@ static inline int is_a32_compat_thread(struct thread_info *thread) ...@@ -33,18 +33,44 @@ static inline int is_a32_compat_thread(struct thread_info *thread)
#endif /* CONFIG_AARCH32_EL0 */ #endif /* CONFIG_AARCH32_EL0 */
#ifdef CONFIG_ARM64_ILP32
static inline int is_ilp32_compat_task(void)
{
return test_thread_flag(TIF_32BIT_AARCH64);
}
static inline int is_ilp32_compat_thread(struct thread_info *thread)
{
return test_ti_thread_flag(thread, TIF_32BIT_AARCH64);
}
#else
static inline int is_ilp32_compat_task(void)
{
return 0;
}
static inline int is_ilp32_compat_thread(struct thread_info *thread)
{
return 0;
}
#endif /* CONFIG_ARM64_ILP32 */
#ifdef CONFIG_COMPAT #ifdef CONFIG_COMPAT
static inline int is_compat_task(void) static inline int is_compat_task(void)
{ {
return is_a32_compat_task(); return is_a32_compat_task() || is_ilp32_compat_task();
} }
#endif /* CONFIG_COMPAT */ #endif /* CONFIG_COMPAT */
static inline int is_compat_thread(struct thread_info *thread) static inline int is_compat_thread(struct thread_info *thread)
{ {
return is_a32_compat_thread(thread); return is_a32_compat_thread(thread) || is_ilp32_compat_thread(thread);
} }
......
...@@ -90,6 +90,7 @@ void arch_release_task_struct(struct task_struct *tsk); ...@@ -90,6 +90,7 @@ void arch_release_task_struct(struct task_struct *tsk);
#define TIF_SVE 23 /* Scalable Vector Extension in use */ #define TIF_SVE 23 /* Scalable Vector Extension in use */
#define TIF_SVE_VL_INHERIT 24 /* Inherit sve_vl_onexec across exec */ #define TIF_SVE_VL_INHERIT 24 /* Inherit sve_vl_onexec across exec */
#define TIF_SSBD 25 /* Wants SSB mitigation */ #define TIF_SSBD 25 /* Wants SSB mitigation */
#define TIF_32BIT_AARCH64 26 /* 32 bit process on AArch64(ILP32) */
#define _TIF_SIGPENDING (1 << TIF_SIGPENDING) #define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED) #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
...@@ -106,6 +107,7 @@ void arch_release_task_struct(struct task_struct *tsk); ...@@ -106,6 +107,7 @@ void arch_release_task_struct(struct task_struct *tsk);
#define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP) #define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP)
#define _TIF_32BIT (1 << TIF_32BIT) #define _TIF_32BIT (1 << TIF_32BIT)
#define _TIF_SVE (1 << TIF_SVE) #define _TIF_SVE (1 << TIF_SVE)
#define _TIF_32BIT_AARCH64 (1 << TIF_32BIT_AARCH64)
#define _TIF_WORK_MASK (_TIF_NEED_RESCHED | _TIF_SIGPENDING | \ #define _TIF_WORK_MASK (_TIF_NEED_RESCHED | _TIF_SIGPENDING | \
_TIF_NOTIFY_RESUME | _TIF_FOREIGN_FPSTATE | \ _TIF_NOTIFY_RESUME | _TIF_FOREIGN_FPSTATE | \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册