S390: Influence hwcaps/stfle via GLIBC_TUNABLES.
commit41f67ccbe92b4fd09e1062b383e55e407ae5bfa1
authorStefan Liebler <stli@linux.ibm.com>
Thu, 2 Feb 2023 13:57:50 +0000 (2 14:57 +0100)
committerStefan Liebler <stli@linux.ibm.com>
Tue, 7 Feb 2023 08:19:27 +0000 (7 09:19 +0100)
treedfda0fd844157445add9ab30f59eeea659b38dcc
parent0b9d2d4a76508fdcbd9f421cdd98bf324c22af3c
S390: Influence hwcaps/stfle via GLIBC_TUNABLES.

This patch enables the option to influence hwcaps and stfle bits used
by the s390 specific ifunc-resolvers.  The currently x86-specific
tunable glibc.cpu.hwcaps is also used on s390x to achieve the task. In
addition the user can also set a CPU arch-level like z13 instead of
single HWCAP and STFLE features.

Note that the tunable only handles the features which are really used
in the IFUNC-resolvers.  All others are ignored as the values are only
used inside glibc.  Thus we can influence:
- HWCAP_S390_VXRS (z13)
- HWCAP_S390_VXRS_EXT (z14)
- HWCAP_S390_VXRS_EXT2 (z15)
- STFLE_MIE3 (z15)

The influenced hwcap/stfle-bits are stored in the s390-specific
cpu_features struct which also contains reserved fields for future
usage.

The ifunc-resolvers and users of stfle bits are adjusted to use the
information from cpu_features struct.

On 31bit, the ELF_MACHINE_IRELATIVE macro is now also defined.
Otherwise the new ifunc-resolvers segfaults as they depend on
the not yet processed_rtld_global_ro@GLIBC_PRIVATE relocation.
12 files changed:
manual/tunables.texi
sysdeps/s390/cpu-features.c [new file with mode: 0644]
sysdeps/s390/cpu-features.h [new file with mode: 0644]
sysdeps/s390/dl-procinfo.c
sysdeps/s390/dl-tunables.list [new file with mode: 0644]
sysdeps/s390/ldsodefs.h
sysdeps/s390/libc-start.c [copied from sysdeps/s390/dl-procinfo.c with 61% similarity]
sysdeps/s390/multiarch/ifunc-impl-list.c
sysdeps/s390/multiarch/ifunc-resolve.h
sysdeps/s390/s390-32/dl-machine.h
sysdeps/s390/s390-64/dl-machine.h
sysdeps/unix/sysv/linux/s390/sysconf.c