Commit 4c3c3c50 authored by Michael Ellerman's avatar Michael Ellerman

selftests/powerpc: Don't run DSCR tests on old systems

The DSCR tests fail on systems that don't have DSCR, so check for the
DSCR in hwcap and skip if it's not present.
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200819015727.1977134-5-mpe@ellerman.id.au
parent 178282a0
...@@ -10,4 +10,4 @@ include ../../lib.mk ...@@ -10,4 +10,4 @@ include ../../lib.mk
$(OUTPUT)/dscr_default_test: LDLIBS += -lpthread $(OUTPUT)/dscr_default_test: LDLIBS += -lpthread
$(TEST_GEN_PROGS): ../harness.c $(TEST_GEN_PROGS): ../harness.c ../utils.c
...@@ -63,6 +63,8 @@ int dscr_default(void) ...@@ -63,6 +63,8 @@ int dscr_default(void)
unsigned long i, *status[THREADS]; unsigned long i, *status[THREADS];
unsigned long orig_dscr_default; unsigned long orig_dscr_default;
SKIP_IF(!have_hwcap2(PPC_FEATURE2_DSCR));
orig_dscr_default = get_default_dscr(); orig_dscr_default = get_default_dscr();
/* Initial DSCR default */ /* Initial DSCR default */
......
...@@ -21,6 +21,8 @@ int dscr_explicit(void) ...@@ -21,6 +21,8 @@ int dscr_explicit(void)
{ {
unsigned long i, dscr = 0; unsigned long i, dscr = 0;
SKIP_IF(!have_hwcap2(PPC_FEATURE2_DSCR));
srand(getpid()); srand(getpid());
set_dscr(dscr); set_dscr(dscr);
......
...@@ -44,6 +44,8 @@ int dscr_inherit_exec(void) ...@@ -44,6 +44,8 @@ int dscr_inherit_exec(void)
unsigned long i, dscr = 0; unsigned long i, dscr = 0;
pid_t pid; pid_t pid;
SKIP_IF(!have_hwcap2(PPC_FEATURE2_DSCR));
for (i = 0; i < COUNT; i++) { for (i = 0; i < COUNT; i++) {
dscr++; dscr++;
if (dscr > DSCR_MAX) if (dscr > DSCR_MAX)
......
...@@ -22,6 +22,8 @@ int dscr_inherit(void) ...@@ -22,6 +22,8 @@ int dscr_inherit(void)
unsigned long i, dscr = 0; unsigned long i, dscr = 0;
pid_t pid; pid_t pid;
SKIP_IF(!have_hwcap2(PPC_FEATURE2_DSCR));
srand(getpid()); srand(getpid());
set_dscr(dscr); set_dscr(dscr);
......
...@@ -77,6 +77,8 @@ int dscr_sysfs(void) ...@@ -77,6 +77,8 @@ int dscr_sysfs(void)
unsigned long orig_dscr_default; unsigned long orig_dscr_default;
int i, j; int i, j;
SKIP_IF(!have_hwcap2(PPC_FEATURE2_DSCR));
orig_dscr_default = get_default_dscr(); orig_dscr_default = get_default_dscr();
for (i = 0; i < COUNT; i++) { for (i = 0; i < COUNT; i++) {
for (j = 0; j < DSCR_MAX; j++) { for (j = 0; j < DSCR_MAX; j++) {
......
...@@ -56,6 +56,8 @@ int dscr_sysfs_thread(void) ...@@ -56,6 +56,8 @@ int dscr_sysfs_thread(void)
unsigned long orig_dscr_default; unsigned long orig_dscr_default;
int i, j; int i, j;
SKIP_IF(!have_hwcap2(PPC_FEATURE2_DSCR));
orig_dscr_default = get_default_dscr(); orig_dscr_default = get_default_dscr();
for (i = 0; i < COUNT; i++) { for (i = 0; i < COUNT; i++) {
for (j = 0; j < DSCR_MAX; j++) { for (j = 0; j < DSCR_MAX; j++) {
......
...@@ -36,6 +36,8 @@ int dscr_user(void) ...@@ -36,6 +36,8 @@ int dscr_user(void)
{ {
int i; int i;
SKIP_IF(!have_hwcap2(PPC_FEATURE2_DSCR));
check_dscr(""); check_dscr("");
for (i = 0; i < COUNT; i++) { for (i = 0; i < COUNT; i++) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment