From patchwork Mon Mar 5 13:30:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 26199 Received: (qmail 129578 invoked by alias); 5 Mar 2018 13:30:51 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 125965 invoked by uid 89); 5 Mar 2018 13:30:50 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS, TIME_LIMIT_EXCEEDED autolearn=unavailable version=3.3.2 spammy= X-HELO: mail-yb0-f180.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=UW7KszUWTY7WK5Wtya37nRUIEQLbbr383U2IfGHfw5Q=; b=Xx7lzPXN3O1J0BqgoyF4NH/1wUbT0vnRk7+XnOeEg+gUZeWFv0d52WAbdBfIIsNiPD IZbAeD+kYQSzcev3mM3md2h2NZvaJkQokp4TgerKLdSDaku9R+Gpjhkmv3l6fTw/xJxI Jvh6E8K/rpCikhymk7NErAAt4pRD0Mn5Aa7unzaDz1KSnXThQJsP3wwJrfoDofEm9JE/ azHk6imRsObQiRrs8l8HCSHkKCtqmRdffFxH1pjOkUPGWRy4fQmWC3eybrM+pVfs3DJH KsLoUrMq7T8HFe0A4od+xs69FwSvAfegz+COd25abSyy8LYAVDAvNfZoI15qQ/VMqGAq ZHBw== X-Gm-Message-State: APf1xPC1wiEuwXP905NslzVjvMCYNzoRhhAzAb5MXAYYTPLP773/c6o2 ZlWuv2Tldwey9AXgjxxqVbIzqosC5pc= X-Google-Smtp-Source: AG47ELtb4miWjIRnV3sbnAuz/ajwNtXwtJWRFPaprAVhVuzGz1l2kX1920jRcPVygGcINDgHqlE0Zg== X-Received: by 2002:a25:e809:: with SMTP id k9-v6mr8996577ybd.78.1520256634401; Mon, 05 Mar 2018 05:30:34 -0800 (PST) Subject: Re: glibc 2.27 regression on powerpc-linux-gnuspe To: John Paul Adrian Glaubitz Cc: GNU C Library References: From: Adhemerval Zanella Message-ID: <96d9640e-86f8-fad9-53b3-eacc591898eb@linaro.org> Date: Mon, 5 Mar 2018 10:30:30 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: On 04/03/2018 06:27, John Paul Adrian Glaubitz wrote: > Hi! > > Just a quick heads-up, glibc 2.27 fails to build on powerpc-linux-gnuspe [1]: > > powerpc-linux-gnuspe-gcc-7 -no-pie -fno-PIE -c -isystem /<>/debian/include -I../include -I/<>/build-tree/powerpcspe-libc/signal > -I/<>/build-tree/powerpcspe-libc -I../sysdeps/unix/sysv/linux/powerpc/powerpc32/e500/nofpu -I../sysdeps/powerpc/powerpc32/e500/nofpu > -I../sysdeps/powerpc/nofpu -I../sysdeps/powerpc/soft-fp -I../sysdeps/unix/sysv/linux/powerpc/powerpc32/e500 > -I../sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu -I../sysdeps/unix/sysv/linux/powerpc/powerpc32 -I../sysdeps/unix/sysv/linux/powerpc > -I../sysdeps/powerpc/nptl -I../sysdeps/unix/sysv/linux/include -I../sysdeps/unix/sysv/linux -I../sysdeps/nptl -I../sysdeps/pthread -I../sysdeps/gnu > -I../sysdeps/unix/inet -I../sysdeps/unix/sysv -I../sysdeps/unix/powerpc -I../sysdeps/unix -I../sysdeps/posix -I../sysdeps/powerpc/powerpc32/e500 > -I../sysdeps/powerpc/powerpc32 -I../sysdeps/wordsize-32 -I../sysdeps/powerpc -I../sysdeps/ieee754/ldbl-128ibm/include -I../sysdeps/ieee754/ldbl-128ibm > -I../sysdeps/ieee754/ldbl-opt -I../sysdeps/ieee754/dbl-64 -I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754 -I../sysdeps/generic -I.. -I../libio -I. > -nostdinc -isystem /usr/lib/gcc/powerpc-linux-gnuspe/7/include -isystem /usr/lib/gcc/powerpc-linux-gnuspe/7/include-fixed -isystem > /<>/debian/include -D_LIBC_REENTRANT -include /<>/build-tree/powerpcspe-libc/libc-modules.h -DMODULE_NAME=libc -include > ../include/libc-symbols.h -DTOP_NAMESPACE=glibc -DASSEMBLER -pipe -O2 -g -Werror=undef -Wa,--noexecstack -o > /<>/build-tree/powerpcspe-libc/signal/kill.o -x assembler-with-cpp - -MD -MP -MF /<>/build-tree/powerpcspe-libc/signal/kill.o.dt -MT > /<>/build-tree/powerpcspe-libc/signal/kill.o > ../sysdeps/unix/syscall-template.S: Assembler messages: > ../sysdeps/unix/syscall-template.S:78: Error: unrecognized opcode: `tabort.' > make[3]: *** [/<>/build-tree/powerpcspe-libc/sysd-syscalls:2109: /<>/build-tree/powerpcspe-libc/signal/kill.o] Error 1 > make[3]: Leaving directory '/<>/signal' > make[2]: *** [Makefile:231: signal/subdir_lib] Error 2 > make[2]: Leaving directory '/<>' > make[1]: *** [Makefile:9: all] Error 2 > make[1]: Leaving directory '/<>/build-tree/powerpcspe-libc' > make: *** [debian/rules.d/build.mk:103: /<>/stamp-dir/build_libc] Error 2 > dpkg-buildpackage: error: debian/rules build-arch subprocess returned exit status 2 > > Adrian > >> [1] https://buildd.debian.org/status/fetch.php?pkg=glibc&arch=powerpcspe&ver=2.27-1&stamp=1520078744&raw=0 > VLE opcodes clashes with some recent ISA opcodes and until recently gas did not complain about it. However it was recently changed by Alan on 14b57c7c6 and now VLE configure gas does not support to assembler some opcodes that might class with VLE (HTM included). It does not help when we changed glibc to add lock elision support with HLE as default (regardless of assembler support). I think best approach is just to disable any HTM usage when __VLE__ is defined: I will prepare a patch. diff --git a/sysdeps/powerpc/powerpc32/sysdep.h b/sysdeps/powerpc/powerpc32/sysdep.h index 8e32a2a..5f1294e 100644 --- a/sysdeps/powerpc/powerpc32/sysdep.h +++ b/sysdeps/powerpc/powerpc32/sysdep.h @@ -90,7 +90,7 @@ GOT_LABEL: ; \ cfi_endproc; \ ASM_SIZE_DIRECTIVE(name) -#if ! IS_IN(rtld) +#if !IS_IN(rtld) && !defined(__SPE__) # define ABORT_TRANSACTION_IMPL \ cmpwi 2,0; \ beq 1f; \ diff --git a/sysdeps/powerpc/sysdep.h b/sysdeps/powerpc/sysdep.h index 03db75f..8a6d236 100644 --- a/sysdeps/powerpc/sysdep.h +++ b/sysdeps/powerpc/sysdep.h @@ -174,7 +174,7 @@ we abort transaction just before syscalls. [1] Documentation/powerpc/transactional_memory.txt [Syscalls] */ -#if !IS_IN(rtld) +#if !IS_IN(rtld) && !defined(__SPE__) # define ABORT_TRANSACTION \ ({ \ if (THREAD_GET_TM_CAPABLE ()) \ diff --git a/sysdeps/unix/sysv/linux/powerpc/elision-lock.c b/sysdeps/unix/sysv/linux/powerpc/elision-lock.c index b7093fe..98a23f0 100644 --- a/sysdeps/unix/sysv/linux/powerpc/elision-lock.c +++ b/sysdeps/unix/sysv/linux/powerpc/elision-lock.c @@ -45,6 +45,7 @@ int __lll_lock_elision (int *lock, short *adapt_count, EXTRAARG int pshared) { +#ifndef __SPE__ /* adapt_count is accessed concurrently but is just a hint. Thus, use atomic accesses but relaxed MO is sufficient. */ if (atomic_load_relaxed (adapt_count) > 0) @@ -82,5 +83,6 @@ __lll_lock_elision (int *lock, short *adapt_count, EXTRAARG int pshared) aconf.skip_lock_out_of_tbegin_retries); use_lock: +#endif return LLL_LOCK ((*lock), pshared); } diff --git a/sysdeps/unix/sysv/linux/powerpc/elision-trylock.c b/sysdeps/unix/sysv/linux/powerpc/elision-trylock.c index b74a810..fabb03b 100644 --- a/sysdeps/unix/sysv/linux/powerpc/elision-trylock.c +++ b/sysdeps/unix/sysv/linux/powerpc/elision-trylock.c @@ -30,6 +30,7 @@ int __lll_trylock_elision (int *futex, short *adapt_count) { +#ifndef __SPE__ /* Implement POSIX semantics by forbiding nesting elided trylocks. */ __libc_tabort (_ABORT_NESTED_TRYLOCK); @@ -65,5 +66,6 @@ __lll_trylock_elision (int *futex, short *adapt_count) } use_lock: +#endif return lll_trylock (*futex); } diff --git a/sysdeps/unix/sysv/linux/powerpc/elision-unlock.c b/sysdeps/unix/sysv/linux/powerpc/elision-unlock.c index dcfab19..14e0680 100644 --- a/sysdeps/unix/sysv/linux/powerpc/elision-unlock.c +++ b/sysdeps/unix/sysv/linux/powerpc/elision-unlock.c @@ -23,6 +23,7 @@ int __lll_unlock_elision (int *lock, short *adapt_count, int pshared) { +#ifndef __SPE__ /* When the lock was free we're in a transaction. */ if (*lock == 0) __libc_tend (0); @@ -39,5 +40,8 @@ __lll_unlock_elision (int *lock, short *adapt_count, int pshared) lll_unlock ((*lock), pshared); } +#else + lll_unlock ((*lock), pshared); +#endif return 0; }