aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/testing/selftests/powerpc/security
diff options
context:
space:
mode:
authorSachin Sant <sachinp@linux.vnet.ibm.com>2021-12-13 22:12:23 +0530
committerMichael Ellerman <mpe@ellerman.id.au>2021-12-16 21:31:46 +1100
commit18678591846d668649fbd4f87b4a4c470818d386 (patch)
tree7530da75f9674bbd97c6d1168248aa175f9ee6e9 /tools/testing/selftests/powerpc/security
parentpowerpc/pseries: use slab context cpumask allocation in CPU hotplug init (diff)
downloadwireguard-linux-18678591846d668649fbd4f87b4a4c470818d386.tar.xz
wireguard-linux-18678591846d668649fbd4f87b4a4c470818d386.zip
selftests/powerpc: skip tests for unavailable mitigations.
Mitigation patching test iterates over a set of mitigations irrespective of whether a certain mitigation is supported/available in the kernel. This causes following messages on a kernel where some mitigations are unavailable: Spawned threads enabling/disabling mitigations ... cat: entry_flush: No such file or directory cat: uaccess_flush: No such file or directory Waiting for timeout ... OK This patch adds a check for available mitigations in the kernel. Reported-by: Nageswara R Sastry <rnsastry@linux.ibm.com> Signed-off-by: Sachin Sant <sachinp@linux.vnet.ibm.com> Tested-by: Nageswara R Sastry <rnsastry@linux.ibm.com> Reviewed-by: Russell Currey <ruscur@russell.cc> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/163941374362.36967.18016981579099073379.sendpatchset@1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa
Diffstat (limited to 'tools/testing/selftests/powerpc/security')
-rwxr-xr-xtools/testing/selftests/powerpc/security/mitigation-patching.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/testing/selftests/powerpc/security/mitigation-patching.sh b/tools/testing/selftests/powerpc/security/mitigation-patching.sh
index b0b20e0b4e30..f43aa4b77fba 100755
--- a/tools/testing/selftests/powerpc/security/mitigation-patching.sh
+++ b/tools/testing/selftests/powerpc/security/mitigation-patching.sh
@@ -44,7 +44,10 @@ mitigations="barrier_nospec stf_barrier count_cache_flush rfi_flush entry_flush
for m in $mitigations
do
- do_one "$m" &
+ if [[ -f /sys/kernel/debug/powerpc/$m ]]
+ then
+ do_one "$m" &
+ fi
done
echo "Spawned threads enabling/disabling mitigations ..."