Files
glibc/sysdeps/s390/configure.ac
Stefan Liebler b9579342c6 Remove support for lock elision.
The support for lock elision was already deprecated with glibc 2.42:
commit 77438db8cf
"Mark support for lock elision as deprecated."
See also discussions:
https://sourceware.org/pipermail/libc-alpha/2025-July/168492.html

This patch removes the architecture specific support for lock elision
for x86, powerpc and s390 by removing the elision-conf.h, elision-conf.c,
elision-lock.c, elision-timed.c, elision-unlock.c, elide.h, htm.h/hle.h files.
Those generic files are also removed.

The architecture specific structures are adjusted and the elision fields are
marked as unused.  See struct_mutex.h files.
Furthermore in struct_rwlock.h, the leftover __rwelision was also removed.
Those were originally removed with commit 0377a7fde6
"nptl: Remove rwlock elision definitions"
and by chance reintroduced with commit 7df8af43ad
"nptl: Add struct_rwlock.h"

The common code (e.g. the pthread_mutex-files) are changed back to the time
before lock elision was introduced with the x86-support:
- commit 1cdbe57948
"Add the low level infrastructure for pthreads lock elision with TSX"
- commit b023e4ca99
"Add new internal mutex type flags for elision."
- commit 68cc29355f
"Add minimal test suite changes for elision enabled kernels"
- commit e8c659d74e
"Add elision to pthread_mutex_{try,timed,un}lock"
- commit 49186d21ef
"Disable elision for any pthread_mutexattr_settype call"
- commit 1717da59ae
"Add a configure option to enable lock elision and disable by default"

Elision is removed also from the tunables, the initialization part, the
pretty-printers and the manual.

Some extra handling in the testsuite is removed as well as the full tst-mutex10
testcase, which tested a race while enabling lock elision.

I've also searched the code for "elision", "elide", "transaction" and e.g.
cleaned some comments.

I've run the testsuite on x86_64 and s390x and run the build-many-glibcs.py
script.
Thanks to Sachin Monga, this patch is also tested on powerpc.

A NEWS entry also mentions the removal.
Reviewed-by: Wilco Dijkstra  <Wilco.Dijkstra@arm.com>
2025-11-18 14:21:13 +01:00

140 lines
3.6 KiB
Plaintext

GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
# Local configure fragment for sysdeps/s390.
AC_CACHE_CHECK([for S390 vector instruction support], libc_cv_asm_s390_vx, [
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
void testvecinsn ()
{
__asm__ (".machine \"z13\" \n\t"
".machinemode \"zarch_nohighgprs\" \n\t"
"vistrbs %%v16,%%v17 \n\t"
"locghie %%r1,0" : :);
}
]])],
[libc_cv_asm_s390_vx=yes],
[libc_cv_asm_s390_vx=no])])
if test "$libc_cv_asm_s390_vx" = yes ;
then
AC_DEFINE(HAVE_S390_VX_ASM_SUPPORT)
else
AC_MSG_WARN([Use binutils with vector-support in order to use optimized implementations.])
fi
dnl test, if gcc supports S390 vector registers as clobber in inline assembly
AC_CACHE_CHECK([for S390 vector support in gcc], libc_cv_gcc_s390_vx, [
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
void testvecclobber ()
{
__asm__ ("" : : : "v16");
}
]])],
[libc_cv_gcc_s390_vx=yes],
[libc_cv_gcc_s390_vx=no])])
if test "$libc_cv_gcc_s390_vx" = yes ;
then
AC_DEFINE(HAVE_S390_VX_GCC_SUPPORT)
fi
AC_CACHE_CHECK([for S390 arch13 zarch instruction support],
libc_cv_asm_s390_arch13, [
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
void testinsn (char *buf)
{
__asm__ (".machine \"arch13\" \n\t"
".machinemode \"zarch_nohighgprs\" \n\t"
"lghi %%r0,16 \n\t"
"mvcrl 0(%0),32(%0) \n\t"
"vstrs %%v20,%%v20,%%v20,%%v20,0,2"
: : "a" (buf) : "memory", "r0");
}
]])],
[libc_cv_asm_s390_arch13=yes],
[libc_cv_asm_s390_arch13=no])])
if test "$libc_cv_asm_s390_arch13" = yes ;
then
AC_DEFINE(HAVE_S390_ARCH13_ASM_SUPPORT)
fi
AC_CACHE_CHECK([for S390 z10 zarch instruction support as default],
libc_cv_asm_s390_min_z10_zarch, [
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
void testinsn (void *a, void *b, int n)
{
__asm__ ("exrl %2,1f \n\t"
"j 2f \n\t"
"1: mvc 0(1,%0),0(%1) \n\t"
"2:"
: : "a" (a), "a" (b), "d" (n)
: "memory", "cc");
}
]])],
[libc_cv_asm_s390_min_z10_zarch=yes],
[libc_cv_asm_s390_min_z10_zarch=no])])
if test "$libc_cv_asm_s390_min_z10_zarch" = yes ;
then
AC_DEFINE(HAVE_S390_MIN_Z10_ZARCH_ASM_SUPPORT)
fi
AC_CACHE_CHECK([for S390 z196 zarch instruction support as default],
libc_cv_asm_s390_min_z196_zarch, [
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
float testinsn (double e)
{
float d;
__asm__ ("ledbra %0,5,%1,4" : "=f" (d) : "f" (e) );
return d;
}
]])],
[libc_cv_asm_s390_min_z196_zarch=yes],
[libc_cv_asm_s390_min_z196_zarch=no])])
if test "$libc_cv_asm_s390_min_z196_zarch" = yes ;
then
AC_DEFINE(HAVE_S390_MIN_Z196_ZARCH_ASM_SUPPORT)
fi
AC_CACHE_CHECK([for S390 z13 zarch instruction support as default],
libc_cv_asm_s390_min_z13_zarch, [
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
int testinsn (void)
{
int i;
__asm__ ("vl %%v16,0(%%r15)\n\t"
"vlgvf %0,%%v16,0"
: "=d" (i) : : "memory", "v16");
return i;
}
]])],
[libc_cv_asm_s390_min_z13_zarch=yes],
[libc_cv_asm_s390_min_z13_zarch=no])])
if test "$libc_cv_asm_s390_min_z13_zarch" = yes ;
then
AC_DEFINE(HAVE_S390_MIN_Z13_ZARCH_ASM_SUPPORT)
fi
AC_CACHE_CHECK([for S390 arch13 zarch instruction support as default],
libc_cv_asm_s390_min_arch13_zarch, [
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
void testinsn (char *buf)
{
__asm__ ("lghi %%r0,16 \n\t"
"mvcrl 0(%0),32(%0) \n\t"
"vstrs %%v20,%%v20,%%v20,%%v20,0,2"
: : "a" (buf) : "memory", "r0");
}
]])],
[libc_cv_asm_s390_min_arch13_zarch=yes],
[libc_cv_asm_s390_min_arch13_zarch=no])])
if test "$libc_cv_asm_s390_min_arch13_zarch" = yes ;
then
AC_DEFINE(HAVE_S390_MIN_ARCH13_ZARCH_ASM_SUPPORT)
fi
test -n "$critic_missing" && AC_MSG_ERROR([
*** $critic_missing])