diff options
author | Michael Ellerman <mpe@ellerman.id.au> | 2020-08-03 12:07:19 +1000 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2020-08-03 22:12:41 +1000 |
commit | 872d11bca9c29ed19595c993b9f552ffe9b63dcb (patch) | |
tree | 101f33625913e951cad50b2ea693162014d6efb0 /tools/testing/selftests/powerpc/stringloops | |
parent | 8d8a629d00a5283874b81b594f31f8d436dc57d8 (diff) | |
download | linux-872d11bca9c29ed19595c993b9f552ffe9b63dcb.tar.bz2 |
selftests/powerpc: Skip vmx/vsx/tar/etc tests on older CPUs
Some of our tests use VSX or newer VMX instructions, so need to be
skipped on older CPUs to avoid SIGILL'ing.
Similarly TAR was added in v2.07, and the PMU event used in the stcx
fail test only works on Power8 or later.
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200803020719.96114-1-mpe@ellerman.id.au
Diffstat (limited to 'tools/testing/selftests/powerpc/stringloops')
-rw-r--r-- | tools/testing/selftests/powerpc/stringloops/Makefile | 2 | ||||
-rw-r--r-- | tools/testing/selftests/powerpc/stringloops/memcmp.c | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/tools/testing/selftests/powerpc/stringloops/Makefile b/tools/testing/selftests/powerpc/stringloops/Makefile index 7fc0623d85c3..9c39f55a58ff 100644 --- a/tools/testing/selftests/powerpc/stringloops/Makefile +++ b/tools/testing/selftests/powerpc/stringloops/Makefile @@ -8,7 +8,7 @@ build_32bit = $(shell if ($(CC) $(CFLAGS) -m32 -o /dev/null memcmp.c >/dev/null TEST_GEN_PROGS := memcmp_64 strlen -$(OUTPUT)/memcmp_64: memcmp.c +$(OUTPUT)/memcmp_64: memcmp.c ../utils.c $(OUTPUT)/memcmp_64: CFLAGS += -m64 -maltivec ifeq ($(build_32bit),1) diff --git a/tools/testing/selftests/powerpc/stringloops/memcmp.c b/tools/testing/selftests/powerpc/stringloops/memcmp.c index e4605ca850dc..979df3d98368 100644 --- a/tools/testing/selftests/powerpc/stringloops/memcmp.c +++ b/tools/testing/selftests/powerpc/stringloops/memcmp.c @@ -4,6 +4,7 @@ #include <string.h> #include <sys/mman.h> #include <time.h> +#include <asm/cputable.h> #include "utils.h" #define SIZE 256 @@ -151,6 +152,11 @@ static int testcase(bool islarge) static int testcases(void) { +#ifdef __powerpc64__ + // vcmpequd used in memcmp_64.S is v2.07 + SKIP_IF(!have_hwcap2(PPC_FEATURE2_ARCH_2_07)); +#endif + testcase(0); testcase(1); return 0; |