[PATCH v2 16/15] syscall_get_arch: add "struct task_struct *" argument
Michael Ellerman
mpe at ellerman.id.au
Tue Nov 27 21:34:29 AEDT 2018
"Dmitry V. Levin" <ldv at altlinux.org> writes:
> diff --git a/arch/powerpc/include/asm/syscall.h b/arch/powerpc/include/asm/syscall.h
> index ab9f3f0a8637..d88b34179118 100644
> --- a/arch/powerpc/include/asm/syscall.h
> +++ b/arch/powerpc/include/asm/syscall.h
> @@ -100,9 +100,15 @@ static inline void syscall_set_arguments(struct task_struct *task,
> regs->orig_gpr3 = args[0];
> }
>
> -static inline int syscall_get_arch(void)
> +static inline int syscall_get_arch(struct task_struct *task)
> {
> - int arch = is_32bit_task() ? AUDIT_ARCH_PPC : AUDIT_ARCH_PPC64;
> + int arch;
> +
> + if (IS_ENABLED(CONFIG_PPC64) && !test_tsk_thread_flag(task, TIF_32BIT))
> + arch = AUDIT_ARCH_PPC64;
> + else
> + arch = AUDIT_ARCH_PPC;
> +
> #ifdef __LITTLE_ENDIAN__
> arch |= __AUDIT_ARCH_LE;
> #endif
LGTM.
Acked-by: Michael Ellerman <mpe at ellerman.id.au> (powerpc)
cheers
More information about the Linuxppc-dev
mailing list