1. 26 Oct, 2022 6 commits
    • Thomas Richter's avatar
      s390/pai: rename structure member users to active_events · 58354c7d
      Thomas Richter authored
      Rename structure member users to active_events to make it consistent
      with PMU pai_ext. Also use the same prefix syntax for increment and
      decrement operators in both PMUs.
      Signed-off-by: default avatarThomas Richter <tmricht@linux.ibm.com>
      Acked-by: default avatarSumanth Korikkar <sumanthk@linux.ibm.com>
      Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
      58354c7d
    • Thomas Richter's avatar
      s390/pai: rework pai_crypto mapped buffer reference count · d3db4ac3
      Thomas Richter authored
      Rework the mapped buffer reference count in PMU pai_crypto
      to match the same technique as in PMU pai_ext.
      This simplifies the logic.
      Do not count the individual number of counter and sampling
      processes. Remember the type of access and the total number of
      references to the buffer.
      Signed-off-by: default avatarThomas Richter <tmricht@linux.ibm.com>
      Acked-by: default avatarSumanth Korikkar <sumanthk@linux.ibm.com>
      Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
      d3db4ac3
    • Thomas Richter's avatar
      s390/pai: move enum definition to header file · 4c787963
      Thomas Richter authored
      Move enum definition to header file. This is done in preparation
      for a follow on patch where this enum will be used in another source
      file.
      Also change the enum name from paiext_mode to paievt_mode
      to indicate this enum is now used for several events.
      Make naming consistent and rename PAI_MODE_COUNTER to PAI_MODE_COUNTING.
      Signed-off-by: default avatarThomas Richter <tmricht@linux.ibm.com>
      Acked-by: default avatarSumanth Korikkar <sumanthk@linux.ibm.com>
      Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
      4c787963
    • Thomas Richter's avatar
      s390/con3215: Fix white space errors · 55af33fd
      Thomas Richter authored
      Adjust white space according to coding guidelines.
      Signed-off-by: default avatarThomas Richter <tmricht@linux.ibm.com>
      Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
      55af33fd
    • Thomas Richter's avatar
      s390/con3215: Drop console data printout when buffer full · 1f3307cf
      Thomas Richter authored
      Using z/VM the 3270 terminal emulator also emulates an IBM 3215 console
      which outputs line by line. When the screen is full, the console enters
      the MORE... state and waits for the operator to confirm the data
      on the screen by pressing a clear key. If this does not happen in the
      default time frame (currently 50 seconds) the console enters the HOLDING
      state.
      It then waits another time frame (currently 10 seconds) before the output
      continues on the next screen. When the operator presses the clear key
      during these wait times, the output continues immediately.
      
      This may lead to a very long boot time when the console
      has to print many messages, also the system may hang because of the
      console's limited buffer space and the system waits for the console
      output to drain and finally to finish. This problem can only occur
      when a terminal emulator is actually connected to the 3215 console
      driver. If not z/VM simply drops console output.
      
      Remedy this rare situation and add a kernel boot command line parameter
      con3215_drop. It can be set to 0 (do not drop) or 1 (do drop) which is
      the default. This instructs the kernel drop console data when the
      console buffer is full. This speeds up the boot time considerable and
      also does not hang the system anymore.
      
      Add a sysfs attribute file for console IBM 3215 named con_drop.
      This allows for changing the behavior after the boot, for example when
      during interactive debugging a panic/crash is expected.
      
      Here is a test of the new behavior using the following test program:
       #/bin/bash
       declare -i cnt=4
      
       mode=$(cat /sys/bus/ccw/drivers/3215/con_drop)
       [ $mode = yes ] && cnt=25
      
       echo "cons_drop $(cat /sys/bus/ccw/drivers/3215/con_drop)"
       echo "vmcp term more 5 2"
       vmcp term more 5 2
       echo "Run $cnt iterations of "'echo t > /proc/sysrq-trigger'
      
       for i in $(seq $cnt)
       do
      	echo "$i. command 'echo t > /proc/sysrq-trigger' at $(date +%F,%T)"
      	echo t > /proc/sysrq-trigger
      	sleep 1
       done
       echo "droptest done" > /dev/kmsg
       #
      
      Output with sysfs attribute con_drop set to 1:
       # ./droptest.sh
       cons_drop yes
       vmcp term more 5 2
       Run 25 iterations of echo t > /proc/sysrq-trigger
       1. command 'echo t > /proc/sysrq-trigger' at 2022-09-02,10:15:09
       2. command 'echo t > /proc/sysrq-trigger' at 2022-09-02,10:15:10
       3. command 'echo t > /proc/sysrq-trigger' at 2022-09-02,10:15:11
       4. command 'echo t > /proc/sysrq-trigger' at 2022-09-02,10:15:12
       5. command 'echo t > /proc/sysrq-trigger' at 2022-09-02,10:15:13
       6. command 'echo t > /proc/sysrq-trigger' at 2022-09-02,10:15:14
       7. command 'echo t > /proc/sysrq-trigger' at 2022-09-02,10:15:15
       8. command 'echo t > /proc/sysrq-trigger' at 2022-09-02,10:15:16
       9. command 'echo t > /proc/sysrq-trigger' at 2022-09-02,10:15:17
       10. command 'echo t > /proc/sysrq-trigger' at 2022-09-02,10:15:18
       11. command 'echo t > /proc/sysrq-trigger' at 2022-09-02,10:15:19
       12. command 'echo t > /proc/sysrq-trigger' at 2022-09-02,10:15:20
       13. command 'echo t > /proc/sysrq-trigger' at 2022-09-02,10:15:21
       14. command 'echo t > /proc/sysrq-trigger' at 2022-09-02,10:15:22
       15. command 'echo t > /proc/sysrq-trigger' at 2022-09-02,10:15:23
       16. command 'echo t > /proc/sysrq-trigger' at 2022-09-02,10:15:24
       17. command 'echo t > /proc/sysrq-trigger' at 2022-09-02,10:15:25
       18. command 'echo t > /proc/sysrq-trigger' at 2022-09-02,10:15:26
       19. command 'echo t > /proc/sysrq-trigger' at 2022-09-02,10:15:27
       20. command 'echo t > /proc/sysrq-trigger' at 2022-09-02,10:15:28
       21. command 'echo t > /proc/sysrq-trigger' at 2022-09-02,10:15:29
       22. command 'echo t > /proc/sysrq-trigger' at 2022-09-02,10:15:30
       23. command 'echo t > /proc/sysrq-trigger' at 2022-09-02,10:15:31
       24. command 'echo t > /proc/sysrq-trigger' at 2022-09-02,10:15:32
       25. command 'echo t > /proc/sysrq-trigger' at 2022-09-02,10:15:33
       #
      
      There are no hangs anymore.
      
      Output with sysfs attribute con_drop set to 0 and identical
      setting for z/VM console 'term more 5 2'. Sometimes hitting the
      clear key at the x3270 console to progress output.
      
       # ./droptest.sh
       cons_drop no
       vmcp term more 5 2
       Run 4 iterations of echo t > /proc/sysrq-trigger
       1. command 'echo t > /proc/sysrq-trigger' at 2022-09-02,10:20:58
       2. command 'echo t > /proc/sysrq-trigger' at 2022-09-02,10:24:32
       3. command 'echo t > /proc/sysrq-trigger' at 2022-09-02,10:28:04
       4. command 'echo t > /proc/sysrq-trigger' at 2022-09-02,10:31:37
       #
      
      Details:
      Enable function raw3215_write() to handle tab expansion and newlines
      and feed it with input not larger than the console buffer of 65536
      bytes. Function raw3125_putchar() just forwards its character for
      output to raw3215_write().
      
      This moves tab to blank conversion to one function raw3215_write()
      which also does call raw3215_make_room() to wait for enough free
      buffer space.
      
      Function handle_write() loops over all its input and segments input
      into chunks of console buffer size (should the input be larger).
      
      Rework tab expansion handling logic to avoid code duplication.
      Signed-off-by: default avatarThomas Richter <tmricht@linux.ibm.com>
      Acked-by: default avatarPeter Oberparleiter <oberpar@linux.ibm.com>
      Acked-by: default avatarHeiko Carstens <hca@linux.ibm.com>
      Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
      1f3307cf
    • Thomas Richter's avatar
      s390/con3215: Simplify console write operation · 655ae931
      Thomas Richter authored
      The functions con3215_write() and tty3215_write() have nearly
      identical function bodies and a slightly different function prototype.
      Create function handle_write() to handle the common function
      body and maintain the function prototypes.
      Signed-off-by: default avatarThomas Richter <tmricht@linux.ibm.com>
      Reviewed-by: default avatarPeter Oberparleiter <oberpar@linux.ibm.com>
      Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
      655ae931
  2. 23 Oct, 2022 9 commits
  3. 22 Oct, 2022 21 commits
  4. 21 Oct, 2022 4 commits