Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically provide x86_64 subarchitecture levels #439

Closed
dirkmueller opened this issue Jan 24, 2023 · 5 comments
Closed

Automatically provide x86_64 subarchitecture levels #439

dirkmueller opened this issue Jan 24, 2023 · 5 comments

Comments

@dirkmueller
Copy link
Member

Recently RPM has gained support for x86_64 subarchitecture levels (see rpm-software-management/rpm#2315). These identify the CPU capabilities and allow via a GLIBC HWCAPS overlay to dynamically select more optimized shared libraries for loading. This functionality has been implemented in openSUSE Tumbleweed now.

What is missing is that the libzypp stack is automatically adding a system provide when the host cpu is capable to execute this level. One could do that via the assembly code in the PR above, or by parsing the output of "ld.so --help" (which might be highly unstable). Unfortunately afaik there is no glibc interface to reliably query the glibc information.

Please let me know if you're willing to implement this functionality as it could be useful to select those overlay libraries for supporting architectures automatically.

@Vogtinator
Copy link
Member

What is missing is that the libzypp stack is automatically adding a system provide when the host cpu is capable to execute this level. One could do that via the assembly code in the PR above, or by parsing the output of "ld.so --help" (which might be highly unstable). Unfortunately afaik there is no glibc interface to reliably query the glibc information.

If it's an option to rely on GCC specific builtins, then just __builtin_cpu_supports("x86-64-vX") is available since GCC 12.2.

@mlandres
Copy link
Member

mlandres commented Mar 8, 2023

__builtin_cpu_supports("x86-64-vX") is available since GCC 12.2.

Unfortunately we need a solution that works for the whole Code15 family.

@Vogtinator
Copy link
Member

Unfortunately it looks like you copied the code before rpm-software-management/rpm#2412 was merged, can you include that as well?

@mlandres
Copy link
Member

mlandres commented Mar 8, 2023

I'll do.

mlandres added a commit that referenced this issue Mar 8, 2023
Merges pm-software-management/rpm#2412:
The bit for LZCNT is in CPUID 0x80000001, not 1
@mlandres
Copy link
Member

mlandres commented Mar 8, 2023

Thanks @Vogtinator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants