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

aarch64: support LSE instructions #1129

Closed
wkozaczuk opened this issue Mar 13, 2021 · 0 comments
Closed

aarch64: support LSE instructions #1129

wkozaczuk opened this issue Mar 13, 2021 · 0 comments

Comments

@wkozaczuk
Copy link
Collaborator

This might be a low priority issue but it might be worth addressing at some point.

As @punitagrawal discovered, starting with version 10.1.0 GCC compiler enables usage of outline atomics bases on LSE instructions and also adds runtime detection of this optional cpu feature handled by the init function init_have_lse_atomics (part of libgcc.a). The init_have_lse_atomics calls __getauxval to fetch AT_HWCAP and check for presense of HWCAP_ATOMICS flag. The __getauxval in OSv does not handle __getauxval and shows a warning (getauxval() stubbed):

OSv v0.55.0-206-g6df05b6c
getauxval() stubbed
eth0: 192.168.122.15
Booted up in 49.35 ms
Cmdline: /tests/tst-hello.so
Hello World

To address it we could disable LTE usage by compiling with -mno-outline-atomics or implement AT_HWCAP in getauxval. For the former, we would need to detect the version of GCC (>= 10.1) and only then pass -mno-outline-atomics.

Also, I have noticed that on Ubuntu 20.10 with GCC 10.2.0, compiling natively with -mno-outline-atomics does NOT remove the init_have_lse_atomics function which still gets executed by early ELF initialization logic. On Fedora with GCC 10.2.1, the init_have_lse_atomics is removed. I wonder why this happens.

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

1 participant