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

FreeBSD Arm64 MIDR_EL1 detection info #344

Open
toor1245 opened this issue Oct 17, 2023 · 0 comments
Open

FreeBSD Arm64 MIDR_EL1 detection info #344

toor1245 opened this issue Oct 17, 2023 · 0 comments

Comments

@toor1245
Copy link
Contributor

This issue was created to make it easier for people experiencing the problem of MIDR_EL1 not receiving information on FreeBSD Arm64 to more easily determine the root cause.

We use elf_aux_info(3) to detect MIDR_EL1 info (implementer, variant, part, revision) for FreeBSD Arm64. To retrieve this information we check if HWCAP_CPUID is enabled to retrieve data from system registers EL1 in user mode. However, FreeBSD export the cpuid registers since 2018 but never set the
HWCAP_CPUID flag to tell userspace, so it was fixed recently.

ref: https://cgit.freebsd.org/src/commit/?id=d61f9bfb0e5c119c97a559f187b1e9c73077307b

Below you can see results with build on current main FreeBSD branch before and after the fix:

mhohsadze@generic:~/cpu_features_toor1245_2 $ bazel run list_cpu_features
INFO: Analyzed target //:list_cpu_features (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
Target //:list_cpu_features up-to-date:
  bazel-bin/list_cpu_features
INFO: Elapsed time: 0.991s, Critical Path: 0.02s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
INFO: Running command line: bazel-bin/list_cpu_features
arch            : aarch64
implementer     :   0 (0x00)
variant         :   0 (0x00)
part            :   0 (0x00)
revision        :   0 (0x00)
flags           : asimd,crc32,fp
mhohsadze@generic:~/cpu_features_toor1245_2 $ bazel run list_cpu_features
Starting local Bazel server and connecting to it...
... still trying to connect to local Bazel server (1532) after 10 seconds ...
INFO: Analyzed target //:list_cpu_features (37 packages loaded, 192 targets configured).
INFO: Found 1 target...
Target //:list_cpu_features up-to-date:
  bazel-bin/list_cpu_features
INFO: Elapsed time: 61.431s, Critical Path: 4.52s
INFO: 8 processes: 1 internal, 7 processwrapper-sandbox.
INFO: Build completed successfully, 8 total actions
INFO: Running command line: bazel-bin/list_cpu_features
arch            : aarch64
implementer     :  65 (0x41)
variant         :   0 (0x00)
part            : 3336 (0xD08)
revision        :   3 (0x03)
flags           : asimd,cpuid,crc32,fp
mhohsadze@generic:~/cpu_features_toor1245_2 $ 

As you can see, a user of the stable version of FreeBSD will currently see empty MIDR information. The fix will probably work starting from versions 14.x+

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