This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] powerpc: Fix syscalls during early process initialization [BZ #22685]
- From: Aurelien Jarno <aurelien at aurel32 dot net>
- To: Tulio Magno Quites Machado Filho <tuliom at linux dot vnet dot ibm dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Thu, 11 Jan 2018 22:36:56 +0100
- Subject: Re: [PATCH] powerpc: Fix syscalls during early process initialization [BZ #22685]
- Authentication-results: sourceware.org; auth=none
- References: <20180111192750.6256-1-tuliom@linux.vnet.ibm.com>
On 2018-01-11 17:27, Tulio Magno Quites Machado Filho wrote:
> The tunables framework needs to make syscall early during process
> initialization, before the TCB is available for consumption. This
> behavior conflicts with powerpc{|64|64le}'s lock elision code, that
> tries to abort transactions before a syscall when lock elision is
> available and enabled.
>
> This patch adds the macro EARLY_INTERNAL_SYSCALL in order to let early
> syscalls happen without depending on the TCB initialization for
> powerpc{|64|64le}. Other architectures are redirected to INTERNAL_SYSCALL.
>
> Tested on powerpc{|64|64le}, s390x and x86_64.
>
> 2018-01-11 Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
>
> [BZ #22685]
> * sysdeps/unix/sysdep.h (__EARLY_INTERNAL_SYSCALL0,
> __EARLY_INTERNAL_SYSCALL1, __EARLY_INTERNAL_SYSCALL2,
> __EARLY_INTERNAL_SYSCALL3, __EARLY_INTERNAL_SYSCALL4,
> __EARLY_INTERNAL_SYSCALL5, __EARLY_INTERNAL_SYSCALL6,
> __EARLY_INTERNAL_SYSCALL7, EARLY_INTERNAL_SYSCALL_CALL): New macros
> (EARLY_INTERNAL_SYSCALL): New macro. Redirect to
> INTERNAL_SYSCALL by default.
> * sysdeps/unix/sysv/linux/not-errno.h (__access_noerrno):
> Replace INTERNAL_SYSCALL_CALL with EARLY_INTERNAL_SYSCALL_CALL.
> * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h
> (EARLY_INTERNAL_SYSCALL_NCS, EARLY_INTERNAL_SYSCALL): New macros.
> * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h
> (EARLY_INTERNAL_SYSCALL_NCS, EARLY_INTERNAL_SYSCALL): Likewise.
>
> Signed-off-by: Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
> ---
> sysdeps/unix/sysdep.h | 25 +++++++++++++++
> sysdeps/unix/sysv/linux/not-errno.h | 4 +--
> sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h | 36 +++++++++++++++++++++-
> sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h | 34 +++++++++++++++++++-
> 4 files changed, 95 insertions(+), 4 deletions(-)
Thanks for the patch, I have just tested it and I confirm it fixes the
issue.
Tested-by: Aurelien Jarno <aurelien@aurel32.net>
--
Aurelien Jarno GPG: 4096R/1DDD8C9B
aurelien@aurel32.net http://www.aurel32.net