Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests/powerpc: Don't touch VMX/VSX on older CPUs

If we're running on a CPU without VMX/VSX then don't touch them. This
is fragile, the compiler could spill a VMX/VSX register and break the
test anyway. But in practice it seems to work, ie. the test runs to
completion on a system without VSX with this change.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200819015727.1977134-8-mpe@ellerman.id.au

+6
+6
tools/testing/selftests/powerpc/benchmarks/context_switch.c
··· 481 481 else 482 482 printf("futex"); 483 483 484 + if (!have_hwcap(PPC_FEATURE_HAS_ALTIVEC)) 485 + touch_altivec = 0; 486 + 487 + if (!have_hwcap(PPC_FEATURE_HAS_VSX)) 488 + touch_vector = 0; 489 + 484 490 printf(" on cpus %d/%d touching FP:%s altivec:%s vector:%s vdso:%s\n", 485 491 cpu1, cpu2, touch_fp ? "yes" : "no", touch_altivec ? "yes" : "no", 486 492 touch_vector ? "yes" : "no", touch_vdso ? "yes" : "no");