Commit 06beb72f authored by Pratyush Anand's avatar Pratyush Anand Committed by Catalin Marinas

arm64: introduce mm context flag to keep 32 bit task information

We need to decide in some cases like uprobe instruction analysis that
whether the current mm context belongs to a 32 bit task or 64 bit.

This patch has introduced an unsigned flag variable in mm_context_t.
Currently, we set and clear TIF_32BIT depending on the condition that
whether an elf binary load sets personality for 32 bit or 64 bit
respectively.
Signed-off-by: default avatarPratyush Anand <panand@redhat.com>
Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
parent 53d07e21
...@@ -138,7 +138,11 @@ typedef struct user_fpsimd_state elf_fpregset_t; ...@@ -138,7 +138,11 @@ typedef struct user_fpsimd_state elf_fpregset_t;
*/ */
#define ELF_PLAT_INIT(_r, load_addr) (_r)->regs[0] = 0 #define ELF_PLAT_INIT(_r, load_addr) (_r)->regs[0] = 0
#define SET_PERSONALITY(ex) clear_thread_flag(TIF_32BIT); #define SET_PERSONALITY(ex) \
({ \
clear_bit(TIF_32BIT, &current->mm->context.flags); \
clear_thread_flag(TIF_32BIT); \
})
/* update AT_VECTOR_SIZE_ARCH if the number of NEW_AUX_ENT entries changes */ /* update AT_VECTOR_SIZE_ARCH if the number of NEW_AUX_ENT entries changes */
#define ARCH_DLINFO \ #define ARCH_DLINFO \
...@@ -183,7 +187,11 @@ typedef compat_elf_greg_t compat_elf_gregset_t[COMPAT_ELF_NGREG]; ...@@ -183,7 +187,11 @@ typedef compat_elf_greg_t compat_elf_gregset_t[COMPAT_ELF_NGREG];
((x)->e_flags & EF_ARM_EABI_MASK)) ((x)->e_flags & EF_ARM_EABI_MASK))
#define compat_start_thread compat_start_thread #define compat_start_thread compat_start_thread
#define COMPAT_SET_PERSONALITY(ex) set_thread_flag(TIF_32BIT); #define COMPAT_SET_PERSONALITY(ex) \
({ \
set_bit(TIF_32BIT, &current->mm->context.flags); \
set_thread_flag(TIF_32BIT); \
})
#define COMPAT_ARCH_DLINFO #define COMPAT_ARCH_DLINFO
extern int aarch32_setup_vectors_page(struct linux_binprm *bprm, extern int aarch32_setup_vectors_page(struct linux_binprm *bprm,
int uses_interp); int uses_interp);
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
typedef struct { typedef struct {
atomic64_t id; atomic64_t id;
void *vdso; void *vdso;
unsigned long flags;
} mm_context_t; } mm_context_t;
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment