~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/tools/testing/selftests/powerpc/scripts/hmi.sh

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /tools/testing/selftests/powerpc/scripts/hmi.sh (Version linux-6.12-rc7) and /tools/testing/selftests/powerpc/scripts/hmi.sh (Version linux-6.8.12)


  1 #!/bin/sh                                           1 #!/bin/sh
  2 # SPDX-License-Identifier: GPL-2.0-only             2 # SPDX-License-Identifier: GPL-2.0-only
  3 #                                                   3 #
  4 # Copyright 2015, Daniel Axtens, IBM Corporati      4 # Copyright 2015, Daniel Axtens, IBM Corporation
  5 #                                                   5 #
  6                                                     6 
  7                                                     7 
  8 # do we have ./getscom, ./putscom?                  8 # do we have ./getscom, ./putscom?
  9 if [ -x ./getscom ] && [ -x ./putscom ]; then       9 if [ -x ./getscom ] && [ -x ./putscom ]; then
 10         GETSCOM=./getscom                          10         GETSCOM=./getscom
 11         PUTSCOM=./putscom                          11         PUTSCOM=./putscom
 12 elif which getscom > /dev/null; then               12 elif which getscom > /dev/null; then
 13         GETSCOM=$(which getscom)                   13         GETSCOM=$(which getscom)
 14         PUTSCOM=$(which putscom)                   14         PUTSCOM=$(which putscom)
 15 else                                               15 else
 16         cat <<EOF                                  16         cat <<EOF
 17 Can't find getscom/putscom in . or \$PATH.         17 Can't find getscom/putscom in . or \$PATH.
 18 See https://github.com/open-power/skiboot.         18 See https://github.com/open-power/skiboot.
 19 The tool is in external/xscom-utils                19 The tool is in external/xscom-utils
 20 EOF                                                20 EOF
 21         exit 1                                     21         exit 1
 22 fi                                                 22 fi
 23                                                    23 
 24 # We will get 8 HMI events per injection           24 # We will get 8 HMI events per injection
 25 # todo: deal with things being offline             25 # todo: deal with things being offline
 26 expected_hmis=8                                    26 expected_hmis=8
 27 COUNT_HMIS() {                                     27 COUNT_HMIS() {
 28     dmesg | grep -c 'Harmless Hypervisor Maint     28     dmesg | grep -c 'Harmless Hypervisor Maintenance interrupt'
 29 }                                                  29 }
 30                                                    30 
 31 # massively expand snooze delay, allowing inje     31 # massively expand snooze delay, allowing injection on all cores
 32 ppc64_cpu --smt-snooze-delay=1000000000            32 ppc64_cpu --smt-snooze-delay=1000000000
 33                                                    33 
 34 # when we exit, restore it                         34 # when we exit, restore it
 35 trap "ppc64_cpu --smt-snooze-delay=100" 0 1        35 trap "ppc64_cpu --smt-snooze-delay=100" 0 1
 36                                                    36 
 37 # for each chip+core combination                   37 # for each chip+core combination
 38 # todo - less fragile parsing                      38 # todo - less fragile parsing
 39 grep -E -o 'OCC: Chip [0-9a-f]+ Core [0-9a-f]'     39 grep -E -o 'OCC: Chip [0-9a-f]+ Core [0-9a-f]' < /sys/firmware/opal/msglog |
 40 while read chipcore; do                            40 while read chipcore; do
 41         chip=$(echo "$chipcore"|awk '{print $3     41         chip=$(echo "$chipcore"|awk '{print $3}')
 42         core=$(echo "$chipcore"|awk '{print $5     42         core=$(echo "$chipcore"|awk '{print $5}')
 43         fir="0x1${core}013100"                     43         fir="0x1${core}013100"
 44                                                    44 
 45         # verify that Core FIR is zero as expe     45         # verify that Core FIR is zero as expected
 46         if [ "$($GETSCOM -c 0x${chip} $fir)" !     46         if [ "$($GETSCOM -c 0x${chip} $fir)" != 0 ]; then
 47                 echo "FIR was not zero before      47                 echo "FIR was not zero before injection for chip $chip, core $core. Aborting!"
 48                 echo "Result of $GETSCOM -c 0x     48                 echo "Result of $GETSCOM -c 0x${chip} $fir:"
 49                 $GETSCOM -c 0x${chip} $fir         49                 $GETSCOM -c 0x${chip} $fir
 50                 echo "If you get a -5 error, t     50                 echo "If you get a -5 error, the core may be in idle state. Try stress-ng."
 51                 echo "Otherwise, try $PUTSCOM      51                 echo "Otherwise, try $PUTSCOM -c 0x${chip} $fir 0"
 52                 exit 1                             52                 exit 1
 53         fi                                         53         fi
 54                                                    54 
 55         # keep track of the number of HMIs han     55         # keep track of the number of HMIs handled
 56         old_hmis=$(COUNT_HMIS)                     56         old_hmis=$(COUNT_HMIS)
 57                                                    57 
 58         # do injection, adding a marker to dme     58         # do injection, adding a marker to dmesg for clarity
 59         echo "Injecting HMI on core $core, chi     59         echo "Injecting HMI on core $core, chip $chip" | tee /dev/kmsg
 60         # inject a RegFile recoverable error       60         # inject a RegFile recoverable error
 61         if ! $PUTSCOM -c 0x${chip} $fir 200000     61         if ! $PUTSCOM -c 0x${chip} $fir 2000000000000000 > /dev/null; then
 62                 echo "Error injecting. Abortin     62                 echo "Error injecting. Aborting!"
 63                 exit 1                             63                 exit 1
 64         fi                                         64         fi
 65                                                    65 
 66         # now we want to wait for all the HMIs     66         # now we want to wait for all the HMIs to be processed
 67         # we expect one per thread on the core     67         # we expect one per thread on the core
 68         i=0;                                       68         i=0;
 69         new_hmis=$(COUNT_HMIS)                     69         new_hmis=$(COUNT_HMIS)
 70         while [ $new_hmis -lt $((old_hmis + ex     70         while [ $new_hmis -lt $((old_hmis + expected_hmis)) ] && [ $i -lt 12 ]; do
 71             echo "Seen $((new_hmis - old_hmis)     71             echo "Seen $((new_hmis - old_hmis)) HMI(s) out of $expected_hmis expected, sleeping"
 72             sleep 5;                               72             sleep 5;
 73             i=$((i + 1))                           73             i=$((i + 1))
 74             new_hmis=$(COUNT_HMIS)                 74             new_hmis=$(COUNT_HMIS)
 75         done                                       75         done
 76         if [ $i = 12 ]; then                       76         if [ $i = 12 ]; then
 77             echo "Haven't seen expected $expec     77             echo "Haven't seen expected $expected_hmis recoveries after 1 min. Aborting."
 78             exit 1                                 78             exit 1
 79         fi                                         79         fi
 80         echo "Processed $expected_hmis events;     80         echo "Processed $expected_hmis events; presumed success. Check dmesg."
 81         echo ""                                    81         echo ""
 82 done                                               82 done
                                                      

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php