Skip to contentSkip to conversation

kselftest/arm64: Add simple hwcap validation

PATCH In review Mark Brown 2 participants 2 messages Aug 29, 2022 – Sep 6, 2022

Subsystems (2)
lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH v2 1/1 kselftest/arm64: Add simple hwcap validation

Add some trivial hwcap validation which checks that /proc/cpuinfo and AT_HWCAP agree with each other and can verify that for extensions that can generate a SIGILL due to adding new instructions one appears or doesn't appear as expected. I've added SVE and SME, other capabilities can be added later if this gets merged.

This isn't super exciting but on the other hand took very little time to write and should be handy when verifying that you wired up AT_HWCAP properly.

---
 tools/testing/selftests/arm64/abi/.gitignore |   1 +
 tools/testing/selftests/arm64/abi/Makefile   |   2 +-
 tools/testing/selftests/arm64/abi/hwcap.c    | 188 +++++++++++++++++++
 3 files changed, 190 insertions(+), 1 deletion(-)
 create mode 100644 tools/testing/selftests/arm64/abi/hwcap.c
tools/testing/selftests/arm64/abi/.gitignore +1 -0
index b9e54417250d..c31d34d48a30 100644
@@ -1,2 +1,3 @@
+hwcap
 syscall-abi
 tpidr2
tools/testing/selftests/arm64/abi/Makefile +1 -1
index c8d7f2495eb2..e60752eb8334 100644
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0
 # Copyright (C) 2021 ARM Limited
 
-TEST_GEN_PROGS := syscall-abi tpidr2
+TEST_GEN_PROGS := hwcap syscall-abi tpidr2
 
 include ../../lib.mk
 
tools/testing/selftests/arm64/abi/hwcap.c new file +188 -0

188 lines not on this page · raw message

base-commit: b90cb1053190353cc30f0fef0ef1f378ccc063c5

Signature · 1 line
2.30.2
maintainer
#1 lore raw
Quoted 11 lines · Mark Brown

Add some trivial hwcap validation which checks that /proc/cpuinfo and AT_HWCAP agree with each other and can verify that for extensions that can generate a SIGILL due to adding new instructions one appears or doesn't appear as expected. I've added SVE and SME, other capabilities can be added later if this gets merged.

This isn't super exciting but on the other hand took very little time to write and should be handy when verifying that you wired up AT_HWCAP properly.

[...]

Applied to arm64 (for-next/kselftest), thanks!

[1/1] kselftest/arm64: Add simple hwcap validation

      https://git.kernel.org/arm64/c/7a9bcaaad5f1
Signature · 1 line
Catalin