OpenBLAS: HWCAP_CPUID should not be used to detect CPU uarch on aarch64

Ref https://github.com/xianyi/OpenBLAS/issues/2696#issuecomment-652762539 since the issue was closed.

This is because with big-LITTLE and alike the CPUID result for MIDR_EL1 is unstable and it depends on the core the code is running on. You can easily get the wrong (/unwanted) result if you happen to run on a little core.

The correct way is to read the /sys/devices/system/cpu/cpu<n>/regs/identification/midr_el1 file.

This should replace https://github.com/xianyi/OpenBLAS/blob/a9aeb6745cb5bb044bea4a6f078458d749158fa6/driver/others/dynamic_arm64.c#L150 and should also be preferred over the /proc/cpuinfo reader in https://github.com/xianyi/OpenBLAS/blob/a9aeb6745cb5bb044bea4a6f078458d749158fa6/cpuid_arm64.c#L123

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Comments: 19 (6 by maintainers)

Most upvoted comments

Yes, thank you. It’d be a shame if the upcoming Debian release would be missing the fix. I filed it as Debian Bug 986996 on their system.