1. 26 Oct, 2022 5 commits
    • 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 5 commits
    • Linus Torvalds's avatar
      Merge tag '6.1-rc1-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6 · bd8e9634
      Linus Torvalds authored
      Pull cifs fixes from Steve French:
      
       - memory leak fixes
      
       - fixes for directory leases, including an important one which fixes a
         problem noticed by git functional tests
      
       - fixes relating to missing free_xid calls (helpful for
         tracing/debugging of entry/exit into cifs.ko)
      
       - a multichannel fix
      
       - a small cleanup fix (use of list_move instead of list_del/list_add)
      
      * tag '6.1-rc1-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6:
        cifs: update internal module number
        cifs: fix memory leaks in session setup
        cifs: drop the lease for cached directories on rmdir or rename
        smb3: interface count displayed incorrectly
        cifs: Fix memory leak when build ntlmssp negotiate blob failed
        cifs: set rc to -ENOENT if we can not get a dentry for the cached dir
        cifs: use LIST_HEAD() and list_move() to simplify code
        cifs: Fix xid leak in cifs_get_file_info_unix()
        cifs: Fix xid leak in cifs_ses_add_channel()
        cifs: Fix xid leak in cifs_flock()
        cifs: Fix xid leak in cifs_copy_file_range()
        cifs: Fix xid leak in cifs_create()
      bd8e9634
    • Linus Torvalds's avatar
      Merge tag 'nfsd-6.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux · 022c028f
      Linus Torvalds authored
      Pull nfsd fixes from Chuck Lever:
       "Fixes for patches merged in v6.1"
      
      * tag 'nfsd-6.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux:
        nfsd: ensure we always call fh_verify_error tracepoint
        NFSD: unregister shrinker when nfsd_init_net() fails
      022c028f
    • Chang S. Bae's avatar
      x86/fpu: Fix copy_xstate_to_uabi() to copy init states correctly · 471f0aa7
      Chang S. Bae authored
      When an extended state component is not present in fpstate, but in init
      state, the function copies from init_fpstate via copy_feature().
      
      But, dynamic states are not present in init_fpstate because of all-zeros
      init states. Then retrieving them from init_fpstate will explode like this:
      
       BUG: kernel NULL pointer dereference, address: 0000000000000000
       ...
       RIP: 0010:memcpy_erms+0x6/0x10
        ? __copy_xstate_to_uabi_buf+0x381/0x870
        fpu_copy_guest_fpstate_to_uabi+0x28/0x80
        kvm_arch_vcpu_ioctl+0x14c/0x1460 [kvm]
        ? __this_cpu_preempt_check+0x13/0x20
        ? vmx_vcpu_put+0x2e/0x260 [kvm_intel]
        kvm_vcpu_ioctl+0xea/0x6b0 [kvm]
        ? kvm_vcpu_ioctl+0xea/0x6b0 [kvm]
        ? __fget_light+0xd4/0x130
        __x64_sys_ioctl+0xe3/0x910
        ? debug_smp_processor_id+0x17/0x20
        ? fpregs_assert_state_consistent+0x27/0x50
        do_syscall_64+0x3f/0x90
        entry_SYSCALL_64_after_hwframe+0x63/0xcd
      
      Adjust the 'mask' to zero out the userspace buffer for the features that
      are not available both from fpstate and from init_fpstate.
      
      The dynamic features depend on the compacted XSAVE format. Ensure it is
      enabled before reading XCOMP_BV in init_fpstate.
      
      Fixes: 2308ee57 ("x86/fpu/amx: Enable the AMX feature in 64-bit mode")
      Reported-by: default avatarYuan Yao <yuan.yao@intel.com>
      Suggested-by: default avatarDave Hansen <dave.hansen@intel.com>
      Signed-off-by: default avatarChang S. Bae <chang.seok.bae@intel.com>
      Signed-off-by: default avatarDave Hansen <dave.hansen@linux.intel.com>
      Tested-by: default avatarYuan Yao <yuan.yao@intel.com>
      Link: https://lore.kernel.org/lkml/BYAPR11MB3717EDEF2351C958F2C86EED95259@BYAPR11MB3717.namprd11.prod.outlook.com/
      Link: https://lkml.kernel.org/r/20221021185844.13472-1-chang.seok.bae@intel.com
      471f0aa7
    • Linus Torvalds's avatar
      Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · ed537795
      Linus Torvalds authored
      Pull SCSI fixes from James Bottomley:
       "Two small changes, one in the lpfc driver and the other in the core.
      
        The core change is an additional footgun guard which prevents users
        from writing the wrong state to sysfs and causing a hang"
      
      * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
        scsi: lpfc: Fix memory leak in lpfc_create_port()
        scsi: core: Restrict legal sdev_state transitions via sysfs
      ed537795
    • Linus Torvalds's avatar
      Merge tag 'block-6.1-2022-10-20' of git://git.kernel.dk/linux · d4b7332e
      Linus Torvalds authored
      Pull block fixes from Jens Axboe:
      
       - NVMe pull request via Christoph:
            - fix nvme-hwmon for DMA non-cohehrent architectures (Serge Semin)
            - add a nvme-hwmong maintainer (Christoph Hellwig)
            - fix error pointer dereference in error handling (Dan Carpenter)
            - fix invalid memory reference in nvmet_subsys_attr_qid_max_show
              (Daniel Wagner)
            - don't limit the DMA segment size in nvme-apple (Russell King)
            - fix workqueue MEM_RECLAIM flushing dependency (Sagi Grimberg)
            - disable write zeroes on various Kingston SSDs (Xander Li)
      
       - fix a memory leak with block device tracing (Ye)
      
       - flexible-array fix for ublk (Yushan)
      
       - document the ublk recovery feature from this merge window
         (ZiyangZhang)
      
       - remove dead bfq variable in struct (Yuwei)
      
       - error handling rq clearing fix (Yu)
      
       - add an IRQ safety check for the cached bio freeing (Pavel)
      
       - drbd bio cloning fix (Christoph)
      
      * tag 'block-6.1-2022-10-20' of git://git.kernel.dk/linux:
        blktrace: remove unnessary stop block trace in 'blk_trace_shutdown'
        blktrace: fix possible memleak in '__blk_trace_remove'
        blktrace: introduce 'blk_trace_{start,stop}' helper
        bio: safeguard REQ_ALLOC_CACHE bio put
        block, bfq: remove unused variable for bfq_queue
        drbd: only clone bio if we have a backing device
        ublk_drv: use flexible-array member instead of zero-length array
        nvmet: fix invalid memory reference in nvmet_subsys_attr_qid_max_show
        nvmet: fix workqueue MEM_RECLAIM flushing dependency
        nvme-hwmon: kmalloc the NVME SMART log buffer
        nvme-hwmon: consistently ignore errors from nvme_hwmon_init
        nvme: add Guenther as nvme-hwmon maintainer
        nvme-apple: don't limit DMA segement size
        nvme-pci: disable write zeroes on various Kingston SSD
        nvme: fix error pointer dereference in error handling
        Documentation: document ublk user recovery feature
        blk-mq: fix null pointer dereference in blk_mq_clear_rq_mapping()
      d4b7332e