14 orig
=$
(cat "$mitigation")
19 while [[ $
((now-start
)) -lt "$TIMEOUT" ]]
21 echo 0 > "$mitigation"
22 echo 1 > "$mitigation"
27 echo "$orig" > "$mitigation"
31 cd /sys
/kernel
/debug
/powerpc || rc
=1
32 if [[ "$rc" -ne 0 ]]; then
33 echo "Error: couldn't cd to /sys/kernel/debug/powerpc" >&2
37 tainted
=$
(cat /proc
/sys
/kernel
/tainted
)
38 if [[ "$tainted" -ne 0 ]]; then
39 echo "Warning: kernel already tainted! ($tainted)" >&2
42 mitigations
="barrier_nospec stf_barrier count_cache_flush rfi_flush entry_flush uaccess_flush"
46 if [[ -f /sys
/kernel
/debug
/powerpc
/$m ]]
52 echo "Spawned threads enabling/disabling mitigations ..."
54 if stress-ng
> /dev
/null
2>&1; then
56 elif stress
> /dev
/null
2>&1; then
62 if [[ -n "$stress" ]]; then
63 "$stress" -m "$(nproc)" -t "$TIMEOUT" &
64 echo "Spawned VM stressors ..."
67 echo "Waiting for timeout ..."
71 tainted
=$
(cat /proc
/sys
/kernel
/tainted
)
72 if [[ "$tainted" != "$orig_tainted" ]]; then
73 echo "Error: kernel newly tainted, before ($orig_tainted) after ($tainted)" >&2