Bug 2216554

Summary: glibc: Debug GLIBC_TUNABLES=glibc.cpu.hwcaps=
Product: Red Hat Enterprise Linux 8 Reporter: Paulo Andrade <pandrade>
Component: glibcAssignee: glibc team <glibc-bugzilla>
Status: CLOSED MIGRATED QA Contact: qe-baseos-tools-bugs
Severity: medium Docs Contact:
Priority: unspecified    
Version: 8.6CC: ashankar, codonell, dj, fweimer, mnewsome, pfrankli, sipoyare
Target Milestone: rcKeywords: FutureFeature, MigratedToJIRA, Triaged
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-07-06 15:01:54 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Paulo Andrade 2023-06-21 19:27:49 UTC
Debugging setting these flags very early is not very easy.

What is a good approach, for example, attempting to disable AVX, with
several approaches in the pattern:

$ GLIBC_TUNABLES=glibc.cpu.hwcaps=-AVX,-AVX2,-AVX_Usable /lib64/ld-2.28.so --list-diagnostics|grep -i AVX
env[0x0]="GLIBC_TUNABLES=glibc.cpu.hwcaps=-AVX,-AVX2,-AVX_Usable"
x86.cpu_features.preferred.AVX_Fast_Unaligned_Load=0x1
x86.cpu_features.preferred.Prefer_No_AVX512=0x1
x86.cpu_features.preferred.MathVec_Prefer_No_AVX512=0x0

The desired trest is, for example, to get x86.cpu_features.preferred.AVX_Fast_Unaligned_Load set to zero.

This request is to help an user to experiment with forcing glibc to choose __memcpy_ssse3_back (as was done in rhel7) instead of __memcpy_avx_unaligned_erms

Tried several combinations from the switch in sysdeps/x86/cpu-tunables.c
and could not find a good pattern to experiment. Note that info libc
shows an incorrect path to check for possible values.

The main request is to be able to experiment with different ifunc patterns
for benchmark purposes.

Comment 1 Paulo Andrade 2023-06-23 15:25:10 UTC
This appears to cause it to use the alternate memcpy.

GLIBC_TUNABLES="glibc.cpu.hwcaps=Fast_Copy_Backward,SSSE3,-Fast_Unaligned_Copy,-Fast_Unaligned_Load,-ERMS,-Prefer_ERMS,-AVX,-AVX_Usable,-AVX_Fast_Unaligned_Load"

Comment 9 Florian Weimer 2023-07-06 13:46:05 UTC
I am going to move this bug over to Jira. A link to issues.redhat.com should appear in due course. If you cannot access this ticket, feel free to ask for assistance here.