diff options
author | Thomas Weißschuh <linux@weissschuh.net> | 2025-08-21 17:13:03 +0200 |
---|---|---|
committer | Will Deacon <will@kernel.org> | 2025-09-08 15:54:39 +0100 |
commit | a985fe638344492727528e52416211dda1c391d5 (patch) | |
tree | 0103624fe885c57669252b507a29924af2277909 | |
parent | 740cdafd0d998903c1faeee921028a8a78698be5 (diff) |
kselftest/arm64/gcs: Use nolibc's getauxval()
Nolibc now does have getauxval(), use it.
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Reviewed-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Will Deacon <will@kernel.org>
-rw-r--r-- | tools/testing/selftests/arm64/gcs/basic-gcs.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/testing/selftests/arm64/gcs/basic-gcs.c b/tools/testing/selftests/arm64/gcs/basic-gcs.c index 100d2a983155..250977abc398 100644 --- a/tools/testing/selftests/arm64/gcs/basic-gcs.c +++ b/tools/testing/selftests/arm64/gcs/basic-gcs.c @@ -10,6 +10,7 @@ #include <sys/mman.h> #include <asm/mman.h> +#include <asm/hwcap.h> #include <linux/sched.h> #include "kselftest.h" @@ -386,14 +387,13 @@ int main(void) ksft_print_header(); - /* - * We don't have getauxval() with nolibc so treat a failure to - * read GCS state as a lack of support and skip. - */ + if (!(getauxval(AT_HWCAP) & HWCAP_GCS)) + ksft_exit_skip("SKIP GCS not supported\n"); + ret = my_syscall5(__NR_prctl, PR_GET_SHADOW_STACK_STATUS, &gcs_mode, 0, 0, 0); if (ret != 0) - ksft_exit_skip("Failed to read GCS state: %d\n", ret); + ksft_exit_fail_msg("Failed to read GCS state: %d\n", ret); if (!(gcs_mode & PR_SHADOW_STACK_ENABLE)) { gcs_mode = PR_SHADOW_STACK_ENABLE; |