Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cab175f9 authored by Denis Kirjanov's avatar Denis Kirjanov Committed by Benjamin Herrenschmidt
Browse files

powerpc: Use is_32bit_task() helper to test 32-bit binary



This patch removes all explicit tests for the TIF_32BIT flag

Signed-off-by: default avatarDenis Kirjanov <dkirjanov@kernel.org>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent 05d77ac9
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -143,7 +143,7 @@ static inline void __user *compat_alloc_user_space(long len)
	 * We cant access below the stack pointer in the 32bit ABI and
	 * We cant access below the stack pointer in the 32bit ABI and
	 * can access 288 bytes in the 64bit ABI
	 * can access 288 bytes in the 64bit ABI
	 */
	 */
	if (!(test_thread_flag(TIF_32BIT)))
	if (!is_32bit_task())
		usp -= 288;
		usp -= 288;


	return (void __user *) (usp - len);
	return (void __user *) (usp - len);
@@ -213,7 +213,7 @@ struct compat_shmid64_ds {


static inline int is_compat_task(void)
static inline int is_compat_task(void)
{
{
	return test_thread_flag(TIF_32BIT);
	return is_32bit_task();
}
}


#endif /* __KERNEL__ */
#endif /* __KERNEL__ */
+1 −1
Original line number Original line Diff line number Diff line
@@ -250,7 +250,7 @@ do { \
 * the 64bit ABI has never had these issues dont enable the workaround
 * the 64bit ABI has never had these issues dont enable the workaround
 * even if we have an executable stack.
 * even if we have an executable stack.
 */
 */
# define elf_read_implies_exec(ex, exec_stk) (test_thread_flag(TIF_32BIT) ? \
# define elf_read_implies_exec(ex, exec_stk) (is_32bit_task() ? \
		(exec_stk == EXSTACK_DEFAULT) : 0)
		(exec_stk == EXSTACK_DEFAULT) : 0)
#else 
#else 
# define SET_PERSONALITY(ex) \
# define SET_PERSONALITY(ex) \
+2 −2
Original line number Original line Diff line number Diff line
@@ -163,7 +163,7 @@ do { \
#endif /* !CONFIG_HUGETLB_PAGE */
#endif /* !CONFIG_HUGETLB_PAGE */


#define VM_DATA_DEFAULT_FLAGS \
#define VM_DATA_DEFAULT_FLAGS \
	(test_thread_flag(TIF_32BIT) ? \
	(is_32bit_task() ? \
	 VM_DATA_DEFAULT_FLAGS32 : VM_DATA_DEFAULT_FLAGS64)
	 VM_DATA_DEFAULT_FLAGS32 : VM_DATA_DEFAULT_FLAGS64)


/*
/*
@@ -179,7 +179,7 @@ do { \
					 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
					 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)


#define VM_STACK_DEFAULT_FLAGS \
#define VM_STACK_DEFAULT_FLAGS \
	(test_thread_flag(TIF_32BIT) ? \
	(is_32bit_task() ? \
	 VM_STACK_DEFAULT_FLAGS32 : VM_STACK_DEFAULT_FLAGS64)
	 VM_STACK_DEFAULT_FLAGS32 : VM_STACK_DEFAULT_FLAGS64)


#include <asm-generic/getorder.h>
#include <asm-generic/getorder.h>
+2 −2
Original line number Original line Diff line number Diff line
@@ -118,7 +118,7 @@ extern struct task_struct *last_task_used_spe;
#define TASK_UNMAPPED_BASE_USER32 (PAGE_ALIGN(TASK_SIZE_USER32 / 4))
#define TASK_UNMAPPED_BASE_USER32 (PAGE_ALIGN(TASK_SIZE_USER32 / 4))
#define TASK_UNMAPPED_BASE_USER64 (PAGE_ALIGN(TASK_SIZE_USER64 / 4))
#define TASK_UNMAPPED_BASE_USER64 (PAGE_ALIGN(TASK_SIZE_USER64 / 4))


#define TASK_UNMAPPED_BASE ((test_thread_flag(TIF_32BIT)) ? \
#define TASK_UNMAPPED_BASE ((is_32bit_task()) ? \
		TASK_UNMAPPED_BASE_USER32 : TASK_UNMAPPED_BASE_USER64 )
		TASK_UNMAPPED_BASE_USER32 : TASK_UNMAPPED_BASE_USER64 )
#endif
#endif


@@ -128,7 +128,7 @@ extern struct task_struct *last_task_used_spe;
#define STACK_TOP_USER64 TASK_SIZE_USER64
#define STACK_TOP_USER64 TASK_SIZE_USER64
#define STACK_TOP_USER32 TASK_SIZE_USER32
#define STACK_TOP_USER32 TASK_SIZE_USER32


#define STACK_TOP (test_thread_flag(TIF_32BIT) ? \
#define STACK_TOP (is_32bit_task() ? \
		   STACK_TOP_USER32 : STACK_TOP_USER64)
		   STACK_TOP_USER32 : STACK_TOP_USER64)


#define STACK_TOP_MAX STACK_TOP_USER64
#define STACK_TOP_MAX STACK_TOP_USER64
+1 −1
Original line number Original line Diff line number Diff line
@@ -1681,7 +1681,7 @@ long do_syscall_trace_enter(struct pt_regs *regs)


	if (unlikely(current->audit_context)) {
	if (unlikely(current->audit_context)) {
#ifdef CONFIG_PPC64
#ifdef CONFIG_PPC64
		if (!test_thread_flag(TIF_32BIT))
		if (!is_32bit_task())
			audit_syscall_entry(AUDIT_ARCH_PPC64,
			audit_syscall_entry(AUDIT_ARCH_PPC64,
					    regs->gpr[0],
					    regs->gpr[0],
					    regs->gpr[3], regs->gpr[4],
					    regs->gpr[3], regs->gpr[4],
Loading