]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
sve2: Test SVE2 availability with both HWCAP_SVE and HWCAP2_SVE2 (#363) develop
authorByeonguk Jeong <jungbu2855@gmail.com>
Thu, 12 Feb 2026 13:23:42 +0000 (22:23 +0900)
committerGitHub <noreply@github.com>
Thu, 12 Feb 2026 13:23:42 +0000 (15:23 +0200)
hwcaps accidentally returns HWCAP2_SVE2 when only SME features are
supported, not SVE. Note that this bug has been fixed on kernel
mainline 6.14.

For more informations about this, see below:
https://lore.kernel.org/r/20250107-arm64-2024-dpisa-v6-1-7578da51fc3d@kernel.org

src/util/arch/arm/cpuid_inline.h

index f8a59af3ea619d4f65f98ffbb19bfa79bf5d076c..feb1825abfbba236c8bf79dff7765ca0ca0c644a 100644 (file)
@@ -60,7 +60,7 @@ int check_sve(void) {
 static inline
 int check_sve2(void) {
     unsigned long hwcap2 = getauxval(AT_HWCAP2);
-    if (hwcap2 & HWCAP2_SVE2) {
+    if (check_sve() && (hwcap2 & HWCAP2_SVE2)) {
         return 1;
     }
     return 0;