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: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200819015727.1977134-5-mpe@ellerman.id.au
This commit is contained in:
Michael Ellerman 2020-08-19 11:57:23 +10:00
parent 178282a054
commit 4c3c3c5025
8 changed files with 15 additions and 1 deletions

View File

@ -10,4 +10,4 @@ include ../../lib.mk
$(OUTPUT)/dscr_default_test: LDLIBS += -lpthread
$(TEST_GEN_PROGS): ../harness.c
$(TEST_GEN_PROGS): ../harness.c ../utils.c

View File

@ -63,6 +63,8 @@ int dscr_default(void)
unsigned long i, *status[THREADS];
unsigned long orig_dscr_default;
SKIP_IF(!have_hwcap2(PPC_FEATURE2_DSCR));
orig_dscr_default = get_default_dscr();
/* Initial DSCR default */

View File

@ -21,6 +21,8 @@ int dscr_explicit(void)
{
unsigned long i, dscr = 0;
SKIP_IF(!have_hwcap2(PPC_FEATURE2_DSCR));
srand(getpid());
set_dscr(dscr);

View File

@ -44,6 +44,8 @@ int dscr_inherit_exec(void)
unsigned long i, dscr = 0;
pid_t pid;
SKIP_IF(!have_hwcap2(PPC_FEATURE2_DSCR));
for (i = 0; i < COUNT; i++) {
dscr++;
if (dscr > DSCR_MAX)

View File

@ -22,6 +22,8 @@ int dscr_inherit(void)
unsigned long i, dscr = 0;
pid_t pid;
SKIP_IF(!have_hwcap2(PPC_FEATURE2_DSCR));
srand(getpid());
set_dscr(dscr);

View File

@ -77,6 +77,8 @@ int dscr_sysfs(void)
unsigned long orig_dscr_default;
int i, j;
SKIP_IF(!have_hwcap2(PPC_FEATURE2_DSCR));
orig_dscr_default = get_default_dscr();
for (i = 0; i < COUNT; i++) {
for (j = 0; j < DSCR_MAX; j++) {

View File

@ -56,6 +56,8 @@ int dscr_sysfs_thread(void)
unsigned long orig_dscr_default;
int i, j;
SKIP_IF(!have_hwcap2(PPC_FEATURE2_DSCR));
orig_dscr_default = get_default_dscr();
for (i = 0; i < COUNT; i++) {
for (j = 0; j < DSCR_MAX; j++) {

View File

@ -36,6 +36,8 @@ int dscr_user(void)
{
int i;
SKIP_IF(!have_hwcap2(PPC_FEATURE2_DSCR));
check_dscr("");
for (i = 0; i < COUNT; i++) {