Skip to content
  1. Oct 13, 2022
    • Ronnie Sahlberg's avatar
      cifs: find and use the dentry for cached non-root directories also · e4029e07
      Ronnie Sahlberg authored
      
      
      This allows us to use cached attributes for the entries in a cached
      directory for as long as a lease is held on the directory itself.
      Previously we have always allowed "used cached attributes for 1 second"
      but this extends this to the lifetime of the lease as well as making the
      caching safer.
      
      Signed-off-by: default avatarRonnie Sahlberg <lsahlber@redhat.com>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      e4029e07
    • Ronnie Sahlberg's avatar
      cifs: enable caching of directories for which a lease is held · ebe98f14
      Ronnie Sahlberg authored
      
      
      This expands the directory caching to now cache an open handle for all
      directories (up to a maximum) and not just the root directory.
      
      In this patch, locking and refcounting is intended to work as so:
      
      The main function to get a reference to a cached handle is
      find_or_create_cached_dir() called from open_cached_dir()
      These functions are protected under the cfid_list_lock spin-lock
      to make sure we do not race creating new references for cached dirs
      with deletion of expired ones.
      
      An successful open_cached_dir() will take out 2 references to the cfid if
      this was the very first and successful call to open the directory and
      it acquired a lease from the server.
      One reference is for the lease  and the other is for the cfid that we
      return. The is lease reference is tracked by cfid->has_lease.
      If the directory already has a handle with an active lease, then we just
      take out one new reference for the cfid and return it.
      It can happen that we have a thread that tries to open a cached directory
      where we have a cfid already but we do not, yet, have a working lease. In
      this case we will just return NULL, and this the caller will fall back to
      the case when no handle was available.
      
      In this model the total number of references we have on a cfid is
      1 for while the handle is open and we have a lease, and one additional
      reference for each open instance of a cfid.
      
      Once we get a lease break (cached_dir_lease_break()) we remove the
      cfid from the list under the spinlock. This prevents any new threads to
      use it, and we also call smb2_cached_lease_break() via the work_queue
      in order to drop the reference we got for the lease (we drop it outside
      of the spin-lock.)
      Anytime a thread calls close_cached_dir() we also drop a reference to the
      cfid.
      When the last reference to the cfid is released smb2_close_cached_fid()
      will be invoked which will drop the reference ot the dentry we held for
      this cfid and it will also, if we the handle is open/has a lease
      also call SMB2_close() to close the handle on the server.
      
      Two events require special handling:
      invalidate_all_cached_dirs() this function is called from SMB2_tdis()
      and cifs_mark_open_files_invalid().
      In both cases the tcon is either gone already or will be shortly so
      we do not need to actually close the handles. They will be dropped
      server side as part of the tcon dropping.
      But we have to be careful about a potential race with a concurrent
      lease break so we need to take out additional refences to avoid the
      cfid from being freed while we are still referencing it.
      
      free_cached_dirs() which is called from tconInfoFree().
      This is called quite late in the umount process so there should no longer
      be any open handles or files and we can just free all the remaining data.
      
      Signed-off-by: default avatarRonnie Sahlberg <lsahlber@redhat.com>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      ebe98f14
    • Paulo Alcantara's avatar
      cifs: prevent copying past input buffer boundaries · 9ee2afe5
      Paulo Alcantara authored
      
      
      Prevent copying past @data buffer in smb2_validate_and_copy_iov() as
      the output buffer in @iov might be potentially bigger and thus copying
      more bytes than requested in @minbufsize.
      
      Signed-off-by: default avatarPaulo Alcantara (SUSE) <pc@cjr.nz>
      Reviewed-by: default avatarRonnie Sahlberg <lsahlber@redhat.com>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      9ee2afe5
    • Paulo Alcantara's avatar
      cifs: fix uninitialised var in smb2_compound_op() · 69ccafdd
      Paulo Alcantara authored
      
      
      Fix uninitialised variable @idata when calling smb2_compound_op() with
      SMB2_OP_POSIX_QUERY_INFO.
      
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Signed-off-by: default avatarPaulo Alcantara (SUSE) <pc@cjr.nz>
      Reviewed-by: default avatarRonnie Sahlberg <lsahlber@redhat.com>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      69ccafdd
    • Paulo Alcantara's avatar
      cifs: improve symlink handling for smb2+ · 76894f3e
      Paulo Alcantara authored
      
      
      When creating inode for symlink, the client used to send below
      requests to fill it in:
      
          * create+query_info+close (STATUS_STOPPED_ON_SYMLINK)
          * create(+reparse_flag)+query_info+close (set file attrs)
          * create+ioctl(get_reparse)+close (query reparse tag)
      
      and then for every access to the symlink dentry, the ->link() method
      would send another:
      
          * create+ioctl(get_reparse)+close (parse symlink)
      
      So, in order to improve:
      
          (i) Get rid of unnecessary roundtrips and then resolve symlinks as
      	follows:
      
              * create+query_info+close (STATUS_STOPPED_ON_SYMLINK +
      	                           parse symlink + get reparse tag)
              * create(+reparse_flag)+query_info+close (set file attrs)
      
          (ii) Set the resolved symlink target directly in inode->i_link and
               use simple_get_link() for ->link() to simply return it.
      
      Signed-off-by: default avatarPaulo Alcantara (SUSE) <pc@cjr.nz>
      Reviewed-by: default avatarRonnie Sahlberg <lsahlber@redhat.com>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      76894f3e
    • Steve French's avatar
      smb3: clarify multichannel warning · 977bb653
      Steve French authored
      
      
      When server does not return network interfaces, clarify the
      message to indicate that "multichannel not available" not just
      that "empty network interface returned by server ..."
      
      Suggested-by: default avatarTom Talpey <tom@talpey.com>
      Reviewed-by: default avatarBharath SM <bharathsm@microsoft.com>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      977bb653
    • Ronnie Sahlberg's avatar
      cifs: fix regression in very old smb1 mounts · 2f6f19c7
      Ronnie Sahlberg authored
      BZ: 215375
      
      Fixes: 76a3c92e
      
       ("cifs: remove support for NTLM and weaker authentication algorithms")
      Reviewed-by: default avatarPaulo Alcantara (SUSE) <pc@cjr.nz>
      Signed-off-by: default avatarRonnie Sahlberg <lsahlber@redhat.com>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      2f6f19c7
  2. Oct 12, 2022
  3. Oct 11, 2022
    • Linus Torvalds's avatar
      Merge tag '6.1-rc-smb3-client-fixes-part1' of git://git.samba.org/sfrench/cifs-2.6 · ac1e8c6c
      Linus Torvalds authored
      Pull cifs updates from Steve French:
      
       - data corruption fix when cache disabled
      
       - four RDMA (smbdirect) improvements, including enabling support for
         SoftiWARP
      
       - four signing improvements
      
       - three directory lease improvements
      
       - four cleanup fixes
      
       - minor security fix
      
       - two debugging improvements
      
      * tag '6.1-rc-smb3-client-fixes-part1' of git://git.samba.org/sfrench/cifs-2.6: (21 commits)
        smb3: fix oops in calculating shash_setkey
        cifs: secmech: use shash_desc directly, remove sdesc
        smb3: rename encryption/decryption TFMs
        cifs: replace kfree() with kfree_sensitive() for sensitive data
        cifs: remove initialization value
        cifs: Replace a couple of one-element arrays with flexible-array members
        smb3: do not log confusing message when server returns no network interfaces
        smb3: define missing create contexts
        cifs: store a pointer to a fid in the cfid structure instead of the struct
        cifs: improve handlecaching
        cifs: Make tcon contain a wrapper structure cached_fids instead of cached_fid
        smb3: add dynamic trace points for tree disconnect
        Fix formatting of client smbdirect RDMA logging
        Handle variable number of SGEs in client smbdirect send.
        Reduce client smbdirect max receive segment size
        Decrease the number of SMB3 smbdirect client SGEs
        cifs: Fix the error length of VALIDATE_NEGOTIATE_INFO message
        cifs: destage dirty pages before re-reading them for cache=none
        cifs: return correct error in ->calc_signature()
        MAINTAINERS: Add Tom Talpey as cifs.ko reviewer
        ...
      ac1e8c6c
    • Linus Torvalds's avatar
      Merge tag 'nfsd-6.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux · dc914858
      Linus Torvalds authored
      Pull more nfsd updates from Chuck Lever:
      
       - filecache code clean-ups
      
      * tag 'nfsd-6.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux:
        nfsd: rework hashtable handling in nfsd_do_file_acquire
        nfsd: fix nfsd_file_unhash_and_dispose
      dc914858
    • Linus Torvalds's avatar
      Merge tag 'pull-tmpfile' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs · f721d24e
      Linus Torvalds authored
      Pull vfs tmpfile updates from Al Viro:
       "Miklos' ->tmpfile() signature change; pass an unopened struct file to
        it, let it open the damn thing. Allows to add tmpfile support to FUSE"
      
      * tag 'pull-tmpfile' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
        fuse: implement ->tmpfile()
        vfs: open inside ->tmpfile()
        vfs: move open right after ->tmpfile()
        vfs: make vfs_tmpfile() static
        ovl: use vfs_tmpfile_open() helper
        cachefiles: use vfs_tmpfile_open() helper
        cachefiles: only pass inode to *mark_inode_inuse() helpers
        cachefiles: tmpfile error handling cleanup
        hugetlbfs: cleanup mknod and tmpfile
        vfs: add vfs_tmpfile_open() helper
      f721d24e
    • Linus Torvalds's avatar
      Merge tag 'mm-stable-2022-10-08' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm · 27bc50fc
      Linus Torvalds authored
      Pull MM updates from Andrew Morton:
      
       - Yu Zhao's Multi-Gen LRU patches are here. They've been under test in
         linux-next for a couple of months without, to my knowledge, any
         negative reports (or any positive ones, come to that).
      
       - Also the Maple Tree from Liam Howlett. An overlapping range-based
         tree for vmas. It it apparently slightly more efficient in its own
         right, but is mainly targeted at enabling work to reduce mmap_lock
         contention.
      
         Liam has identified a number of other tree users in the kernel which
         could be beneficially onverted to mapletrees.
      
         Yu Zhao has identified a hard-to-hit but "easy to fix" lockdep splat
         at [1]. This has yet to be addressed due to Liam's unfortunately
         timed vacation. He is now back and we'll get this fixed up.
      
       - Dmitry Vyukov introduces KMSAN: the Kernel Memory Sanitizer. It uses
         clang-generated instrumentation to detect used-unintialized bugs down
         to the single bit level.
      
         KMSAN keeps finding bugs. New ones, as well as the legacy ones.
      
       - Yang Shi adds a userspace mechanism (madvise) to induce a collapse of
         memory into THPs.
      
       - Zach O'Keefe has expanded Yang Shi's madvise(MADV_COLLAPSE) to
         support file/shmem-backed pages.
      
       - userfaultfd updates from Axel Rasmussen
      
       - zsmalloc cleanups from Alexey Romanov
      
       - cleanups from Miaohe Lin: vmscan, hugetlb_cgroup, hugetlb and
         memory-failure
      
       - Huang Ying adds enhancements to NUMA balancing memory tiering mode's
         page promotion, with a new way of detecting hot pages.
      
       - memcg updates from Shakeel Butt: charging optimizations and reduced
         memory consumption.
      
       - memcg cleanups from Kairui Song.
      
       - memcg fixes and cleanups from Johannes Weiner.
      
       - Vishal Moola provides more folio conversions
      
       - Zhang Yi removed ll_rw_block() :(
      
       - migration enhancements from Peter Xu
      
       - migration error-path bugfixes from Huang Ying
      
       - Aneesh Kumar added ability for a device driver to alter the memory
         tiering promotion paths. For optimizations by PMEM drivers, DRM
         drivers, etc.
      
       - vma merging improvements from Jakub Matěn.
      
       - NUMA hinting cleanups from David Hildenbrand.
      
       - xu xin added aditional userspace visibility into KSM merging
         activity.
      
       - THP & KSM code consolidation from Qi Zheng.
      
       - more folio work from Matthew Wilcox.
      
       - KASAN updates from Andrey Konovalov.
      
       - DAMON cleanups from Kaixu Xia.
      
       - DAMON work from SeongJae Park: fixes, cleanups.
      
       - hugetlb sysfs cleanups from Muchun Song.
      
       - Mike Kravetz fixes locking issues in hugetlbfs and in hugetlb core.
      
      Link: https://lkml.kernel.org/r/CAOUHufZabH85CeUN-MEMgL8gJGzJEWUrkiM58JkTbBhh-jew0Q@mail.gmail.com [1]
      
      * tag 'mm-stable-2022-10-08' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (555 commits)
        hugetlb: allocate vma lock for all sharable vmas
        hugetlb: take hugetlb vma_lock when clearing vma_lock->vma pointer
        hugetlb: fix vma lock handling during split vma and range unmapping
        mglru: mm/vmscan.c: fix imprecise comments
        mm/mglru: don't sync disk for each aging cycle
        mm: memcontrol: drop dead CONFIG_MEMCG_SWAP config symbol
        mm: memcontrol: use do_memsw_account() in a few more places
        mm: memcontrol: deprecate swapaccounting=0 mode
        mm: memcontrol: don't allocate cgroup swap arrays when memcg is disabled
        mm/secretmem: remove reduntant return value
        mm/hugetlb: add available_huge_pages() func
        mm: remove unused inline functions from include/linux/mm_inline.h
        selftests/vm: add selftest for MADV_COLLAPSE of uffd-minor memory
        selftests/vm: add file/shmem MADV_COLLAPSE selftest for cleared pmd
        selftests/vm: add thp collapse shmem testing
        selftests/vm: add thp collapse file and tmpfs testing
        selftests/vm: modularize thp collapse memory operations
        selftests/vm: dedup THP helpers
        mm/khugepaged: add tracepoint to hpage_collapse_scan_file()
        mm/madvise: add file and shmem support to MADV_COLLAPSE
        ...
      27bc50fc
    • Linus Torvalds's avatar
      Merge tag 'x86_mm_for_v6.1_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 70442fc5
      Linus Torvalds authored
      Pull x86 mm updates from Dave Hansen:
       "There are some small things here, plus one big one.
      
        The big one detected and refused to create W+X kernel mappings. This
        caused a bit of trouble and it is entirely disabled on 32-bit due to
        known unfixable EFI issues. It also oopsed on some systemd eBPF use,
        which kept some users from booting.
      
        The eBPF issue is fixed, but those troubles were caught relatively
        recently which made me nervous that there are more lurking. The final
        commit in here retains the warnings, but doesn't actually refuse to
        create W+X mappings.
      
        Summary:
      
         - Detect insecure W+X mappings and warn about them, including a few
           bug fixes and relaxing the enforcement
      
         - Do a long-overdue defconfig update and enabling W+X boot-time
           detection
      
         - Cleanup _PAGE_PSE handling (follow-up on an earlier bug)
      
         - Rename a change_page_attr function"
      
      * tag 'x86_mm_for_v6.1_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/mm: Ease W^X enforcement back to just a warning
        x86/mm: Disable W^X detection and enforcement on 32-bit
        x86/mm: Add prot_sethuge() helper to abstract out _PAGE_PSE handling
        x86/mm/32: Fix W^X detection when page tables do not support NX
        x86/defconfig: Enable CONFIG_DEBUG_WX=y
        x86/defconfig: Refresh the defconfigs
        x86/mm: Refuse W^X violations
        x86/mm: Rename set_memory_present() to set_memory_p()
      70442fc5
    • Linus Torvalds's avatar
      Merge tag 'xtensa-20221010' of https://github.com/jcmvbkbc/linux-xtensa · e2302539
      Linus Torvalds authored
      Pull xtensa updates from Max Filippov:
      
       - add support for FDPIC and static PIE executable formats for noMMU
      
      * tag 'xtensa-20221010' of https://github.com/jcmvbkbc/linux-xtensa:
        xtensa: add FDPIC and static PIE support for noMMU
        xtensa: clean up ELF_PLAT_INIT macro
      e2302539
    • Linus Torvalds's avatar
      Merge tag 'm68knommu-for-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu · 34fdd22c
      Linus Torvalds authored
      Pull m68knommu updates from Greg Ungerer:
       "Just a couple of changes. Fixes to compilation of the old/legacy
        Freescale 68328 targets in some kernel configurations, and some
        default configuration updates.
      
        Summary:
      
         - fix build problems for legacy 68328 targets
      
         - clean out configs of removed options"
      
      * tag 'm68knommu-for-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu:
        m68k: update config files
        m68knommu: fix non-mmu classic 68000 legacy timer tick selection
        m68knommu: fix non-specific 68328 choice interrupt build failure
      34fdd22c
    • Linus Torvalds's avatar
      Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost · 8aeab132
      Linus Torvalds authored
      Pull virtio updates from Michael Tsirkin:
      
       - 9k mtu perf improvements
      
       - vdpa feature provisioning
      
       - virtio blk SECURE ERASE support
      
       - fixes and cleanups all over the place
      
      * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost:
        virtio_pci: don't try to use intxif pin is zero
        vDPA: conditionally read MTU and MAC in dev cfg space
        vDPA: fix spars cast warning in vdpa_dev_net_mq_config_fill
        vDPA: check virtio device features to detect MQ
        vDPA: check VIRTIO_NET_F_RSS for max_virtqueue_paris's presence
        vDPA: only report driver features if FEATURES_OK is set
        vDPA: allow userspace to query features of a vDPA device
        virtio_blk: add SECURE ERASE command support
        vp_vdpa: support feature provisioning
        vdpa_sim_net: support feature provisioning
        vdpa: device feature provisioning
        virtio-net: use mtu size as buffer length for big packets
        virtio-net: introduce and use helper function for guest gso support checks
        virtio: drop vp_legacy_set_queue_size
        virtio_ring: make vring_alloc_queue_packed prettier
        virtio_ring: split: Operators use unified style
        vhost: add __init/__exit annotations to module init/exit funcs
      8aeab132
    • Linus Torvalds's avatar
      Merge tag 'hyperv-next-signed-20221009' of... · 0e0073eb
      Linus Torvalds authored
      Merge tag 'hyperv-next-signed-20221009' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux
      
      Pull hyperv updates from Wei Liu:
      
       - Remove unnecessary delay while probing for VMBus (Stanislav
         Kinsburskiy)
      
       - Optimize vmbus_on_event (Saurabh Sengar)
      
       - Fix a race in Hyper-V DRM driver (Saurabh Sengar)
      
       - Miscellaneous clean-up patches from various people
      
      * tag 'hyperv-next-signed-20221009' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux:
        x86/hyperv: Replace kmap() with kmap_local_page()
        drm/hyperv: Add ratelimit on error message
        hyperv: simplify and rename generate_guest_id
        Drivers: hv: vmbus: Split memcpy of flex-array
        scsi: storvsc: remove an extraneous "to" in a comment
        Drivers: hv: vmbus: Don't wait for the ACPI device upon initialization
        Drivers: hv: vmbus: Use PCI_VENDOR_ID_MICROSOFT for better discoverability
        Drivers: hv: vmbus: Fix kernel-doc
        drm/hyperv: Don't overwrite dirt_needed value set by host
        Drivers: hv: vmbus: Optimize vmbus_on_event
      0e0073eb
    • Linus Torvalds's avatar
      Merge tag 'thermal-6.1-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · aa512c11
      Linus Torvalds authored
      Pull more thermal control updates from Rafael Wysocki:
       "These fix assorted issues in the thermal core and ARM thermal drivers.
      
        Specifics:
      
         - Use platform data to get the sensor ID instead of parsing the
           device in imx_sc thermal driver and remove the dedicated OF
           function from the core code (Daniel Lezcano).
      
         - Fix Kconfig dependency for the QCom tsens thermal driver (Jonathan
           Cameron).
      
         - Add missing const annotation to the RCar ops thermal driver (Lad
           Prabhakar).
      
         - Drop duplicate parameter check from
           thermal_zone_device_register_with_trips() (Lad Prabhakar).
      
         - Fix NULL pointer dereference in trip_point_temp_store() by making
           it check if the ->set_trip_temp() operation is present (Lad
           Prabhakar).
      
         - Fix the MSM8939 fourth sensor hardware ID in the QCom tsens thermal
           driver (Vincent Knecht)"
      
      * tag 'thermal-6.1-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        thermal/drivers/qcom/tsens-v0_1: Fix MSM8939 fourth sensor hw_id
        thermal/core: Add a check before calling set_trip_temp()
        thermal/core: Drop valid pointer check for type
        thermal/drivers/rcar_thermal: Constify static thermal_zone_device_ops
        thermal/drivers/qcom: Drop false build dependency of all QCOM drivers on QCOM_TSENS
        thermal/of: Remove the thermal_zone_of_get_sensor_id() function
        thermal/drivers/imx_sc: Rely on the platform data to get the resource id
      aa512c11
    • Linus Torvalds's avatar
      Merge tag 'pm-6.1-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · f848b3cd
      Linus Torvalds authored
      Pull more power management updates from Rafael Wysocki:
       "These update the turbostat utility, extend the macros used for
        defining device power management callbacks and add a diagnostic
        message to the generic power domains code.
      
        Specifics:
      
         - Add an error message to be printed when a power domain marked as
           "always on" is not actually on during initialization (Johan
           Hovold).
      
         - Extend macros used for defining power management callbacks to allow
           conditional exporting of noirq and late/early suspend/resume PM
           callbacks (Paul Cercueil).
      
         - Update the turbostat utility:
            - Add support for two new platforms (Zhang Rui).
            - Adjust energy unit for Sapphire Rapids (Zhang Rui).
            - Do not dump TRL if turbo is not supported (Artem Bityutskiy)"
      
      * tag 'pm-6.1-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        tools/power turbostat: version 2022.10.04
        tools/power turbostat: Use standard Energy Unit for SPR Dram RAPL domain
        tools/power turbostat: Do not dump TRL if turbo is not supported
        tools/power turbostat: Add support for MeteorLake platforms
        tools/power turbostat: Add support for RPL-S
        PM: Improve EXPORT_*_DEV_PM_OPS macros
        PM: domains: log failures to register always-on domains
      f848b3cd
    • Linus Torvalds's avatar
      Merge tag 'acpi-6.1-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 3a1e24fa
      Linus Torvalds authored
      Pull more ACPI updates from Rafael Wysocki:
       "These fix two issues, in APEI and in the int3472 driver, clean up the
        ACPI thermal driver, add ACPI support for non-GPE system wakeup events
        and make the system reboot code use the S5 (system off) state by
        default.
      
        Specifics:
      
         - Fix ACPI device object reference counting in (recently updated)
           skl_int3472_fill_clk_pdata() (Andy Shevchenko).
      
         - Fix a memory leak in APEI by avoiding to add a task_work to kernel
           threads running when an asynchronous error is detected (Shuai Xue).
      
         - Add ACPI support for handling system wakeups via GPIO wake capable
           IRQs in addition to GPEs (Raul E Rangel).
      
         - Make the system reboot code put ACPI-enabled systems into the S5
           (system off) state which is necessary for some platforms to work as
           expected (Kai-Heng Feng).
      
         - Make the white space usage in the ACPI thermal driver more
           consistent and drop redundant code from it (Rafael Wysocki)"
      
      * tag 'acpi-6.1-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        ACPI: thermal: Drop some redundant code
        ACPI: thermal: Drop redundant parens from expressions
        ACPI: thermal: Use white space more consistently
        platform/x86: int3472: Don't leak reference on error
        ACPI: APEI: do not add task_work to kernel thread to avoid memory leak
        PM: ACPI: reboot: Reinstate S5 for reboot
        kernel/reboot: Add SYS_OFF_MODE_RESTART_PREPARE mode
        ACPI: PM: Take wake IRQ into consideration when entering suspend-to-idle
        i2c: acpi: Use ACPI wake capability bit to set wake_irq
        ACPI: resources: Add wake_capable parameter to acpi_dev_irq_flags
        gpiolib: acpi: Add wake_capable variants of acpi_dev_gpio_irq_get
      3a1e24fa
    • Linus Torvalds's avatar
      Merge tag 'dma-mapping-6.1-2022-10-10' of git://git.infradead.org/users/hch/dma-mapping · 10b22b53
      Linus Torvalds authored
      Pull dma-mapping updates from Christoph Hellwig:
      
       - fix a regression in the ARM dma-direct conversion (Christoph Hellwig)
      
       - use memcpy_{from,to}_page (Fabio M. De Francesco)
      
       - cleanup the swiotlb MAINTAINERS entry (Lukas Bulwahn)
      
       - make SG table pool allocation less fragile (Masahiro Yamada)
      
       - don't panic on swiotlb initialization failure (Robin Murphy)
      
      * tag 'dma-mapping-6.1-2022-10-10' of git://git.infradead.org/users/hch/dma-mapping:
        ARM/dma-mapping: remove the dma_coherent member of struct dev_archdata
        ARM/dma-mappіng: don't override ->dma_coherent when set from a bus notifier
        lib/sg_pool: change module_init(sg_pool_init) to subsys_initcall
        MAINTAINERS: merge SWIOTLB SUBSYSTEM into DMA MAPPING HELPERS
        swiotlb: don't panic!
        swiotlb: replace kmap_atomic() with memcpy_{from,to}_page()
      10b22b53
    • Linus Torvalds's avatar
      Merge tag 'iommu-updates-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu · f23cdfcd
      Linus Torvalds authored
      Pull iommu updates from Joerg Roedel:
      
       - remove the bus_set_iommu() interface which became unnecesary because
         of IOMMU per-device probing
      
       - make the dma-iommu.h header private
      
       - Intel VT-d changes from Lu Baolu:
      	  - Decouple PASID and PRI from SVA
      	  - Add ESRTPS & ESIRTPS capability check
      	  - Cleanups
      
       - Apple DART support for the M1 Pro/MAX SOCs
      
       - support for AMD IOMMUv2 page-tables for the DMA-API layer.
      
         The v2 page-tables are compatible with the x86 CPU page-tables. Using
         them for DMA-API prepares support for hardware-assisted IOMMU
         virtualization
      
       - support for MT6795 Helio X10 M4Us in the Mediatek IOMMU driver
      
       - some smaller fixes and cleanups
      
      * tag 'iommu-updates-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: (59 commits)
        iommu/vt-d: Avoid unnecessary global DMA cache invalidation
        iommu/vt-d: Avoid unnecessary global IRTE cache invalidation
        iommu/vt-d: Rename cap_5lp_support to cap_fl5lp_support
        iommu/vt-d: Remove pasid_set_eafe()
        iommu/vt-d: Decouple PASID & PRI enabling from SVA
        iommu/vt-d: Remove unnecessary SVA data accesses in page fault path
        dt-bindings: iommu: arm,smmu-v3: Relax order of interrupt names
        iommu: dart: Support t6000 variant
        iommu/io-pgtable-dart: Add DART PTE support for t6000
        iommu/io-pgtable: Add DART subpage protection support
        iommu/io-pgtable: Move Apple DART support to its own file
        iommu/mediatek: Add support for MT6795 Helio X10 M4Us
        iommu/mediatek: Introduce new flag TF_PORT_TO_ADDR_MT8173
        dt-bindings: mediatek: Add bindings for MT6795 M4U
        iommu/iova: Fix module config properly
        iommu/amd: Fix sparse warning
        iommu/amd: Remove outdated comment
        iommu/amd: Free domain ID after domain_flush_pages
        iommu/amd: Free domain id in error path
        iommu/virtio: Fix compile error with viommu_capable()
        ...
      f23cdfcd
    • Linus Torvalds's avatar
      Merge tag 'devicetree-for-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux · 706eacad
      Linus Torvalds authored
      Pull devicetree updates from Rob Herring:
       "DT core:
      
         - Fix node refcounting in of_find_last_cache_level()
      
         - Constify device_node in of_device_compatible_match()
      
         - Fix 'dma-ranges' handling in bus controller nodes
      
         - Fix handling of initrd start > end
      
         - Improve error reporting in of_irq_init()
      
         - Taint kernel on DT unittest running
      
         - Use strscpy instead of strlcpy
      
         - Add a build target, dt_compatible_check, to check for compatible
           strings used in kernel sources against compatible strings in DT
           schemas.
      
         - Handle DT_SCHEMA_FILES changes when rebuilding
      
        DT bindings:
      
         - LED bindings for MT6370 PMIC
      
         - Convert Mediatek mtk-gce mailbox, MIPS CPU interrupt controller,
           mt7621 I2C, virtio,pci-iommu, nxp,tda998x, QCom fastrpc, qcom,pdc,
           and arm,versatile-sysreg to DT schema format
      
         - Add nvmem cells to u-boot,env schema
      
         - Add more LED_COLOR_ID definitions
      
         - Require 'opp-table' uses to be a node
      
         - Various schema fixes to match QEMU 'virt' DT usage
      
         - Tree wide dropping of redundant 'Device Tree Binding' in schema
           titles
      
         - More (unevaluated|additional)Properties fixes in schema child nodes
      
         - Drop various redundant minItems equal to maxItems"
      
      * tag 'devicetree-for-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: (62 commits)
        of: base: Shift refcount decrement in of_find_last_cache_level()
        dt-bindings: leds: Add MediaTek MT6370 flashlight
        dt-bindings: leds: mt6370: Add MediaTek MT6370 current sink type LED indicator
        dt-bindings: mailbox: Convert mtk-gce to DT schema
        of: base: make of_device_compatible_match() accept const device node
        of: Fix "dma-ranges" handling for bus controllers
        of: fdt: Remove unused struct fdt_scan_status
        dt-bindings: display: st,stm32-dsi: Handle data-lanes in DSI port node
        dt-bindings: timer: Add power-domains for TI timer-dm on K3
        dt: Add a check for undocumented compatible strings in kernel
        kbuild: take into account DT_SCHEMA_FILES changes while checking dtbs
        dt-bindings: interrupt-controller: migrate MIPS CPU interrupt controller text bindings to YAML
        dt-bindings: i2c: migrate mt7621 text bindings to YAML
        dt-bindings: power: gpcv2: correct patternProperties
        dt-bindings: virtio: Convert virtio,pci-iommu to DT schema
        dt-bindings: timer: arm,arch_timer: Allow dual compatible string
        dt-bindings: arm: cpus: Add kryo240 compatible
        dt-bindings: display: bridge: nxp,tda998x: Convert to json-schema
        dt-bindings: nvmem: u-boot,env: add basic NVMEM cells
        dt-bindings: remoteproc: qcom,adsp: enforce smd-edge schema
        ...
      706eacad
    • Linus Torvalds's avatar
      Merge tag 'tpmdd-next-v6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd · ada3bfb6
      Linus Torvalds authored
      Pull tpm updates from Jarkko Sakkinen:
       "Just a few bug fixes this time"
      
      * tag 'tpmdd-next-v6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd:
        selftest: tpm2: Add Client.__del__() to close /dev/tpm* handle
        security/keys: Remove inconsistent __user annotation
        char: move from strlcpy with unused retval to strscpy
      ada3bfb6
    • Linus Torvalds's avatar
      Merge tag 'v6.1-p1' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 · 3604a7f5
      Linus Torvalds authored
      Pull crypto updates from Herbert Xu:
       "API:
         - Feed untrusted RNGs into /dev/random
         - Allow HWRNG sleeping to be more interruptible
         - Create lib/utils module
         - Setting private keys no longer required for akcipher
         - Remove tcrypt mode=1000
         - Reorganised Kconfig entries
      
        Algorithms:
         - Load x86/sha512 based on CPU features
         - Add AES-NI/AVX/x86_64/GFNI assembler implementation of aria cipher
      
        Drivers:
         - Add HACE crypto driver aspeed"
      
      * tag 'v6.1-p1' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (124 commits)
        crypto: aspeed - Remove redundant dev_err call
        crypto: scatterwalk - Remove unused inline function scatterwalk_aligned()
        crypto: aead - Remove unused inline functions from aead
        crypto: bcm - Simplify obtain the name for cipher
        crypto: marvell/octeontx - use sysfs_emit() to instead of scnprintf()
        hwrng: core - start hwrng kthread also for untrusted source...
      3604a7f5
    • Linus Torvalds's avatar
      Merge tag 'bitmap-6.1-rc1' of https://github.com/norov/linux · d4013bc4
      Linus Torvalds authored
      Pull bitmap updates from Yury Norov:
      
       - Fix unsigned comparison to -1 in CPUMAP_FILE_MAX_BYTES (Phil Auld)
      
       - cleanup nr_cpu_ids vs nr_cpumask_bits mess (me)
      
         This series cleans that mess and adds new config FORCE_NR_CPUS that
         allows to optimize cpumask subsystem if the number of CPUs is known
         at compile-time.
      
       - optimize find_bit() functions (me)
      
         Reworks find_bit() functions based on new FIND_{FIRST,NEXT}_BIT()
         macros.
      
       - add find_nth_bit() (me)
      
         Adds find_nth_bit(), which is ~70 times faster than bitcounting with
         for_each() loop:
      
      	for_each_set_bit(bit, mask, size)
      		if (n-- == 0)
      			return bit;
      
         Also adds bitmap_weight_and() to let people replace this pattern:
      
      	tmp = bitmap_alloc(nbits);
      	bitmap_and(tmp, map1, map2, nbits);
      	weight = bitmap_weight(tmp, nbits);
      	bitmap_free(tmp);
      
         with a single bitmap_weight_and() call.
      
       - repair cpumask_check() (me)
      
         After switching cpumask to use nr_cpu_ids, cpumask_check() started
         generating many false-positive warnings. This series fixes it.
      
       - Add for_each_cpu_andnot() and for_each_cpu_andnot() (Valentin
         Schneider)
      
         Extends the API with one more function and applies it in sched/core.
      
      * tag 'bitmap-6.1-rc1' of https://github.com/norov/linux: (28 commits)
        sched/core: Merge cpumask_andnot()+for_each_cpu() into for_each_cpu_andnot()
        lib/test_cpumask: Add for_each_cpu_and(not) tests
        cpumask: Introduce for_each_cpu_andnot()
        lib/find_bit: Introduce find_next_andnot_bit()
        cpumask: fix checking valid cpu range
        lib/bitmap: add tests for for_each() loops
        lib/find: optimize for_each() macros
        lib/bitmap: introduce for_each_set_bit_wrap() macro
        lib/find_bit: add find_next{,_and}_bit_wrap
        cpumask: switch for_each_cpu{,_not} to use for_each_bit()
        net: fix cpu_max_bits_warn() usage in netif_attrmask_next{,_and}
        cpumask: add cpumask_nth_{,and,andnot}
        lib/bitmap: remove bitmap_ord_to_pos
        lib/bitmap: add tests for find_nth_bit()
        lib: add find_nth{,_and,_andnot}_bit()
        lib/bitmap: add bitmap_weight_and()
        lib/bitmap: don't call __bitmap_weight() in kernel code
        tools: sync find_bit() implementation
        lib/find_bit: optimize find_next_bit() functions
        lib/find_bit: create find_first_zero_bit_le()
        ...
      d4013bc4
    • Linus Torvalds's avatar
      Merge tag 'trace-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace · cdf072ac
      Linus Torvalds authored
      Pull tracing updates from Steven Rostedt:
       "Major changes:
      
         - Changed location of tracing repo from personal git repo to:
           git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git
      
         - Added Masami Hiramatsu as co-maintainer
      
         - Updated MAINTAINERS file to separate out FTRACE as it is more than
           just TRACING.
      
        Minor changes:
      
         - Added Mark Rutland as FTRACE reviewer
      
         - Updated user_events to make it on its way to remove the BROKEN tag.
           The changes should now be acceptable but will run it through a
           cycle and hopefully we can remove the BROKEN tag next release.
      
         - Added filtering to eprobes
      
         - Added a delta time to the benchmark trace event
      
         - Have the histogram and filter callbacks called via a switch
           statement instead of indirect functions. This speeds it up to avoid
           retpolines.
      
         - Add a way to wake up ring buffer waiters waiting for the ring
           buffer to fill up to its watermark.
      
         - New ioctl() on the trace_pipe_raw file to wake up ring buffer
           waiters.
      
         - Wake up waiters when the ring buffer is disabled. A reader may
           block when the ring buffer is disabled, but if it was blocked when
           the ring buffer is disabled it should then wake up.
      
        Fixes:
      
         - Allow splice to read partially read ring buffer pages. This fixes
           splice never moving forward.
      
         - Fix inverted compare that made the "shortest" ring buffer wait
           queue actually the longest.
      
         - Fix a race in the ring buffer between resetting a page when a
           writer goes to another page, and the reader.
      
         - Fix ftrace accounting bug when function hooks are added at boot up
           before the weak functions are set to "disabled".
      
         - Fix bug that freed a user allocated snapshot buffer when enabling a
           tracer.
      
         - Fix possible recursive locks in osnoise tracer
      
         - Fix recursive locking direct functions
      
         - Other minor clean ups and fixes"
      
      * tag 'trace-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace: (44 commits)
        ftrace: Create separate entry in MAINTAINERS for function hooks
        tracing: Update MAINTAINERS to reflect new tracing git repo
        tracing: Do not free snapshot if tracer is on cmdline
        ftrace: Still disable enabled records marked as disabled
        tracing/user_events: Move pages/locks into groups to prepare for namespaces
        tracing: Add Masami Hiramatsu as co-maintainer
        tracing: Remove unused variable 'dups'
        MAINTAINERS: add myself as a tracing reviewer
        ring-buffer: Fix race between reset page and reading page
        tracing/user_events: Update ABI documentation to align to bits vs bytes
        tracing/user_events: Use bits vs bytes for enabled status page data
        tracing/user_events: Use refcount instead of atomic for ref tracking
        tracing/user_events: Ensure user provided strings are safely formatted
        tracing/user_events: Use WRITE instead of READ for io vector import
        tracing/user_events: Use NULL for strstr checks
        tracing: Fix spelling mistake "preapre" -> "prepare"
        tracing: Wake up waiters when tracing is disabled
        tracing: Add ioctl() to force ring buffer waiters to wake up
        tracing: Wake up ring buffer waiters on closing of the file
        ring-buffer: Add ring_buffer_wake_waiters()
        ...
      cdf072ac
    • Linus Torvalds's avatar
      Merge tag 'sysctl-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux · dc553428
      Linus Torvalds authored
      Pull sysctl updates from Luis Chamberlain:
       "Just some boring cleanups on the sysctl front for this release"
      
      * tag 'sysctl-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux:
        kernel/sysctl-test: use SYSCTL_{ZERO/ONE_HUNDRED} instead of i_{zero/one_hundred}
        kernel/sysctl.c: move sysctl_vals and sysctl_long_vals to sysctl.c
        sysctl: remove max_extfrag_threshold
        kernel/sysctl.c: remove unnecessary (void*) conversions
        proc: remove initialization assignment
      dc553428
    • Aaron Tomlin's avatar
      module: tracking: Keep a record of tainted unloaded modules only · 47cc75aa
      Aaron Tomlin authored
      
      
      This ensures that no module record/or entry is added to the
      unloaded_tainted_modules list if it does not carry a taint.
      
      Reported-by: default avatarAlexey Dobriyan <adobriyan@gmail.com>
      Fixes: 99bd9956
      
       ("module: Introduce module unload taint tracking")
      Signed-off-by: default avatarAaron Tomlin <atomlin@redhat.com>
      Acked-by: default avatarLuis Chamberlain <mcgrof@kernel.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      47cc75aa
    • Linus Torvalds's avatar
      Merge tag 'modules-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux · 385f4a10
      Linus Torvalds authored
      Pull module updates from Luis Chamberlain:
      
       - minor enhancement for sysfs compression string (David Disseldorp)
      
       - debugfs interface to view unloaded tainted modules (Aaron Tomlin)
      
      * tag 'modules-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux:
        module/decompress: generate sysfs string at compile time
        module: Add debugfs interface to view unloaded tainted modules
      385f4a10
    • Linus Torvalds's avatar
      Merge tag 'kbuild-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild · 8afc66e8
      Linus Torvalds authored
      Pull Kbuild updates from Masahiro Yamada:
      
       - Remove potentially incomplete targets when Kbuid is interrupted by
         SIGINT etc in case GNU Make may miss to do that when stderr is piped
         to another program.
      
       - Rewrite the single target build so it works more correctly.
      
       - Fix rpm-pkg builds with V=1.
      
       - List top-level subdirectories in ./Kbuild.
      
       - Ignore auto-generated __kstrtab_* and __kstrtabns_* symbols in
         kallsyms.
      
       - Avoid two different modules in lib/zstd/ having shared code, which
         potentially causes building the common code as build-in and modular
         back-and-forth.
      
       - Unify two modpost invocations to optimize the build process.
      
       - Remove head-y syntax in favor of linker scripts for placing
         particular sections in the head of vmlinux.
      
       - Bump the minimal GNU Make version to 3.82.
      
       - Clean up misc Makefiles and scripts.
      
      * tag 'kbuild-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/g...
      8afc66e8
    • Linus Torvalds's avatar
      Merge tag 'livepatching-for-6.1' of... · 4de65c58
      Linus Torvalds authored
      Merge tag 'livepatching-for-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/livepatching/livepatching
      
      Pull livepatching updates from Petr Mladek:
      
       - Fix race between fork and livepatch transition revert
      
       - Add sysfs entry that shows "patched" state for each object (module)
         that can be livepatched by the given livepatch
      
       - Some clean up
      
      * tag 'livepatching-for-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/livepatching/livepatching:
        selftests/livepatch: add sysfs test
        livepatch: add sysfs entry "patched" for each klp_object
        selftests/livepatch: normalize sysctl error message
        livepatch: Add a missing newline character in klp_module_coming()
        livepatch: fix race between fork and KLP transition
      4de65c58
    • Linus Torvalds's avatar
      Merge tag 'printk-for-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux · b5204106
      Linus Torvalds authored
      Pull printk updates from Petr Mladek:
      
       - Initialize pointer hashing using the system workqueue. It avoids
         taking locks in printk()/vsprintf() code path
      
       - Misc code clean up
      
      * tag 'printk-for-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux:
        printk: Mark __printk percpu data ready __ro_after_init
        printk: Remove bogus comment vs. boot consoles
        printk: Remove write only variable nr_ext_console_drivers
        printk: Declare log_wait properly
        printk: Make pr_flush() static
        lib/vsprintf: Initialize vsprintf's pointer hash once the random core is ready.
        lib/vsprintf: Remove static_branch_likely() from __ptr_to_hashval().
        lib/vnsprintf: add const modifier for param 'bitmap'
      b5204106
    • Linus Torvalds's avatar
      Merge tag 'cgroup-for-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup · adf4bfc4
      Linus Torvalds authored
      Pull cgroup updates from Tejun Heo:
      
       - cpuset now support isolated cpus.partition type, which will enable
         dynamic CPU isolation
      
       - pids.peak added to remember the max number of pids used
      
       - holes in cgroup namespace plugged
      
       - internal cleanups
      
      * tag 'cgroup-for-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup: (25 commits)
        cgroup: use strscpy() is more robust and safer
        iocost_monitor: reorder BlkgIterator
        cgroup: simplify code in cgroup_apply_control
        cgroup: Make cgroup_get_from_id() prettier
        cgroup/cpuset: remove unreachable code
        cgroup: Remove CFTYPE_PRESSURE
        cgroup: Improve cftype add/rm error handling
        kselftest/cgroup: Add cpuset v2 partition root state test
        cgroup/cpuset: Update description of cpuset.cpus.partition in cgroup-v2.rst
        cgroup/cpuset: Make partition invalid if cpumask change violates exclusivity rule
        cgroup/cpuset: Relocate a code block in validate_change()
        cgroup/cpuset: Show invalid partition reason string
        cgroup/cpuset: Add a new isolated cpus.partition type
        cgroup/cpuset: Relax constraints to partition & cpus changes
        cgroup/cpuset: Allow no-task partition to have empty cpuset.cpus.effective
        cgroup/cpuset: Miscellaneous cleanups & add helper functions
        cgroup/cpuset: Enable update_tasks_cpumask() on top_cpuset
        cgroup: add pids.peak interface for pids controller
        cgroup: Remove data-race around cgrp_dfl_visible
        cgroup: Fix build failure when CONFIG_SHRINKER_DEBUG
        ...
      adf4bfc4
    • Linus Torvalds's avatar
      Merge tag 'random-6.1-rc1-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/crng/random · 8adc0486
      Linus Torvalds authored
      Pull random number generator updates from Jason Donenfeld:
      
       - Huawei reported that when they updated their kernel from 4.4 to
         something much newer, some userspace code they had broke, the culprit
         being the accidental removal of O_NONBLOCK from /dev/random way back
         in 5.6. It's been gone for over 2 years now and this is the first
         we've heard of it, but userspace breakage is userspace breakage, so
         O_NONBLOCK is now back.
      
       - Use randomness from hardware RNGs much more often during early boot,
         at the same interval that crng reseeds are done, from Dominik.
      
       - A semantic change in hardware RNG throttling, so that the hwrng
         framework can properly feed random.c with randomness from hardware
         RNGs that aren't specifically marked as creditable.
      
         A related patch coming to you via Herbert's hwrng tree depends on
         this one, not to compile, but just to function properly, so you may
         want to merge this PULL before that one.
      
       - A fix to clamp credited bits from the interrupts pool to the size of
         the pool sample. This is mainly just a theoretical fix, as it'd be
         pretty hard to exceed it in practice.
      
       - Oracle reported that InfiniBand TCP latency regressed by around
         10-15% after a change a few cycles ago made at the request of the RT
         folks, in which we hoisted a somewhat rare operation (1 in 1024
         times) out of the hard IRQ handler and into a workqueue, a pretty
         common and boring pattern.
      
         It turns out, though, that scheduling a worker from there has
         overhead of its own, whereas scheduling a timer on that same CPU for
         the next jiffy amortizes better and doesn't incur the same overhead.
      
         I also eliminated a cache miss by moving the work_struct (and
         subsequently, the timer_list) to below a critical cache line, so that
         the more critical members that are accessed on every hard IRQ aren't
         split between two cache lines.
      
       - The boot-time initialization of the RNG has been split into two
         approximate phases: what we can accomplish before timekeeping is
         possible and what we can accomplish after.
      
         This winds up being useful so that we can use RDRAND to seed the RNG
         before CONFIG_SLAB_FREELIST_RANDOM=y systems initialize slabs, in
         addition to other early uses of randomness. The effect is that
         systems with RDRAND (or a bootloader seed) will never see any
         warnings at all when setting CONFIG_WARN_ALL_UNSEEDED_RANDOM=y. And
         kfence benefits from getting a better seed of its own.
      
       - Small systems without much entropy sometimes wind up putting some
         truncated serial number read from flash into hostname, so contribute
         utsname changes to the RNG, without crediting.
      
       - Add smaller batches to serve requests for smaller integers, and make
         use of them when people ask for random numbers bounded by a given
         compile-time constant. This has positive effects all over the tree,
         most notably in networking and kfence.
      
       - The original jitter algorithm intended (I believe) to schedule the
         timer for the next jiffy, not the next-next jiffy, yet it used
         mod_timer(jiffies + 1), which will fire on the next-next jiffy,
         instead of what I believe was intended, mod_timer(jiffies), which
         will fire on the next jiffy. So fix that.
      
       - Fix a comment typo, from William.
      
      * tag 'random-6.1-rc1-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/crng/random:
        random: clear new batches when bringing new CPUs online
        random: fix typos in get_random_bytes() comment
        random: schedule jitter credit for next jiffy, not in two jiffies
        prandom: make use of smaller types in prandom_u32_max
        random: add 8-bit and 16-bit batches
        utsname: contribute changes to RNG
        random: use init_utsname() instead of utsname()
        kfence: use better stack hash seed
        random: split initialization into early step and later step
        random: use expired timer rather than wq for mixing fast pool
        random: avoid reading two cache lines on irq randomness
        random: clamp credited irq bits to maximum mixed
        random: throttle hwrng writes if no entropy is credited
        random: use hwgenerator randomness more frequently at early boot
        random: restore O_NONBLOCK support
      8adc0486
    • Linus Torvalds's avatar
      Merge tag 'slab-for-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab · 52abb27a
      Linus Torvalds authored
      Pull slab fixes from Vlastimil Babka:
      
       - The "common kmalloc v4" series [1] by Hyeonggon Yoo.
      
         While the plan after LPC is to try again if it's possible to get rid
         of SLOB and SLAB (and if any critical aspect of those is not possible
         to achieve with SLUB today, modify it accordingly), it will take a
         while even in case there are no objections.
      
         Meanwhile this is a nice cleanup and some parts (e.g. to the
         tracepoints) will be useful even if we end up with a single slab
         implementation in the future:
      
            - Improves the mm/slab_common.c wrappers to allow deleting
              duplicated code between SLAB and SLUB.
      
            - Large kmalloc() allocations in SLAB are passed to page allocator
              like in SLUB, reducing number of kmalloc caches.
      
            - Removes the {kmem_cache_alloc,kmalloc}_node variants of
              tracepoints, node id parameter added to non-_node variants.
      
       - Addition of kmalloc_size_roundup()
      
         The first two patches from a series by Kees Cook [2] that introduce
         kmalloc_size_roundup(). This will allow merging of per-subsystem
         patches using the new function and ultimately stop (ab)using ksize()
         in a way that causes ongoing trouble for debugging functionality and
         static checkers.
      
       - Wasted kmalloc() memory tracking in debugfs alloc_traces
      
         A patch from Feng Tang that enhances the existing debugfs
         alloc_traces file for kmalloc caches with information about how much
         space is wasted by allocations that needs less space than the
         particular kmalloc cache provides.
      
       - My series [3] to fix validation races for caches with enabled
         debugging:
      
            - By decoupling the debug cache operation more from non-debug
              fastpaths, extra locking simplifications were possible and thus
              done afterwards.
      
            - Additional cleanup of PREEMPT_RT specific code on top, by Thomas
              Gleixner.
      
            - A late fix for slab page leaks caused by the series, by Feng
              Tang.
      
       - Smaller fixes and cleanups:
      
            - Unneeded variable removals, by ye xingchen
      
            - A cleanup removing a BUG_ON() in create_unique_id(), by Chao Yu
      
      Link: https://lore.kernel.org/all/20220817101826.236819-1-42.hyeyoo@gmail.com/ [1]
      Link: https://lore.kernel.org/all/20220923202822.2667581-1-keescook@chromium.org/ [2]
      Link: https://lore.kernel.org/all/20220823170400.26546-1-vbabka@suse.cz/ [3]
      
      * tag 'slab-for-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab: (30 commits)
        mm/slub: fix a slab missed to be freed problem
        slab: Introduce kmalloc_size_roundup()
        slab: Remove __malloc attribute from realloc functions
        mm/slub: clean up create_unique_id()
        mm/slub: enable debugging memory wasting of kmalloc
        slub: Make PREEMPT_RT support less convoluted
        mm/slub: simplify __cmpxchg_double_slab() and slab_[un]lock()
        mm/slub: convert object_map_lock to non-raw spinlock
        mm/slub: remove slab_lock() usage for debug operations
        mm/slub: restrict sysfs validation to debug caches and make it safe
        mm/sl[au]b: check if large object is valid in __ksize()
        mm/slab_common: move declaration of __ksize() to mm/slab.h
        mm/slab_common: drop kmem_alloc & avoid dereferencing fields when not using
        mm/slab_common: unify NUMA and UMA version of tracepoints
        mm/sl[au]b: cleanup kmem_cache_alloc[_node]_trace()
        mm/sl[au]b: generalize kmalloc subsystem
        mm/slub: move free_debug_processing() further
        mm/sl[au]b: introduce common alloc/free functions without tracepoint
        mm/slab: kmalloc: pass requests larger than order-1 page to page allocator
        mm/slab_common: cleanup kmalloc_large()
        ...
      52abb27a
    • Linus Torvalds's avatar
      Merge tag 'timers-core-2022-10-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 55be6084
      Linus Torvalds authored
      Pull timer updates from Thomas Gleixner:
       "A boring time, timekeeping, timers update:
      
         - No core code changes
      
         - No new clocksource/event driver
      
         - Cleanup of the TI DM clocksource/event driver
      
         - The usual set of device tree binding updates
      
         - Small improvement, fixes and cleanups all over the place"
      
      * tag 'timers-core-2022-10-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (22 commits)
        clocksource/drivers/arm_arch_timer: Fix CNTPCT_LO and CNTVCT_LO value
        clocksource/drivers/imx-sysctr: handle nxp,no-divider property
        dt-bindings: timer: nxp,sysctr-timer: add nxp,no-divider property
        clocksource/drivers/timer-ti-dm: Get clock in probe with devm_clk_get()
        clocksource/drivers/timer-ti-dm: Add flag to detect omap1
        clocksource/drivers/timer-ti-dm: Move struct omap_dm_timer fields to driver
        clocksource/drivers/timer-ti-dm: Use runtime PM directly and check errors
        clocksource/drivers/timer-ti-dm: Move private defines to the driver
        clocksource/drivers/timer-ti-dm: Simplify register access further
        clocksource/drivers/timer-ti-dm: Simplify register writes with dmtimer_write()
        clocksource/drivers/timer-ti-dm: Simplify register reads with dmtimer_read()
        clocksource/drivers/timer-ti-dm: Drop unused functions
        clocksource/drivers/timer-gxp: Add missing error handling in gxp_timer_probe
        clocksource/drivers/arm_arch_timer: Fix handling of ARM erratum 858921
        clocksource/drivers/exynos_mct: Enable building on ARTPEC
        clocksource/drivers/exynos_mct: Support local-timers property
        clocksource/drivers/exynos_mct: Support frc-shared property
        dt-bindings: timer: exynos4210-mct: Add ARTPEC-8 MCT support
        clocksource/drivers/sun4i: Add definition of clear interrupt
        clocksource/drivers/renesas-ostm: Add support for RZ/V2L SoC
        ...
      55be6084
    • Linus Torvalds's avatar
      Merge tag 'sched-rt-2022-10-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 7f6dcffb
      Linus Torvalds authored
      Pull preempt RT updates from Thomas Gleixner:
       "Introduce preempt_[dis|enable_nested() and use it to clean up various
        places which have open coded PREEMPT_RT conditionals.
      
        On PREEMPT_RT enabled kernels, spinlocks and rwlocks are neither
        disabling preemption nor interrupts. Though there are a few places
        which depend on the implicit preemption/interrupt disable of those
        locks, e.g. seqcount write sections, per CPU statistics updates etc.
      
        PREEMPT_RT added open coded CONFIG_PREEMPT_RT conditionals to
        disable/enable preemption in the related code parts all over the
        place. That's hard to read and does not really explain why this is
        necessary.
      
        Linus suggested to use helper functions (preempt_disable_nested() and
        preempt_enable_nested()) and use those in the affected places. On !RT
        enabled kernels these functions are NOPs, but contain a lockdep assert
        to validate that preemption is actually disabled to catch call sites
        which do not have preemption disabled.
      
        Clean up the affected code paths in mm, dentry and lib"
      
      * tag 'sched-rt-2022-10-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        u64_stats: Streamline the implementation
        flex_proportions: Disable preemption entering the write section.
        mm/compaction: Get rid of RT ifdeffery
        mm/memcontrol: Replace the PREEMPT_RT conditionals
        mm/debug: Provide VM_WARN_ON_IRQS_ENABLED()
        mm/vmstat: Use preempt_[dis|en]able_nested()
        dentry: Use preempt_[dis|en]able_nested()
        preempt: Provide preempt_[dis|en]able_nested()
      7f6dcffb
    • Linus Torvalds's avatar
      Merge tag 'objtool-core-2022-10-07' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 65f109e1
      Linus Torvalds authored
      Pull objtool updates from Ingo Molnar:
      
       - Remove the "ANNOTATE_NOENDBR on ENDBR" warning: it's not really
         useful and only found a non-bug false positive so far.
      
       - Properly decode LOOP/LOOPE/LOOPNE, which were missing from the x86
         decoder. Because these instructions are rather ineffective, they
         never showed up in compiler output, but they are simple enough to
         support, so add them for completeness.
      
       - A bit more cross-arch preparatory work.
      
      * tag 'objtool-core-2022-10-07' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        objtool,x86: Teach decode about LOOP* instructions
        objtool: Remove "ANNOTATE_NOENDBR on ENDBR" warning
        objtool: Use arch_jump_destination() in read_intra_function_calls()
      65f109e1
    • Linus Torvalds's avatar
      Merge tag 'locking-core-2022-10-07' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 3e71f016
      Linus Torvalds authored
      Pull locking updates from Ingo Molnar:
      
       - Disable preemption in rwsem_write_trylock()'s attempt to take the
         rwsem, to avoid RT tasks hogging the CPU, which managed to preempt
         this function after the owner has been cleared but before a new owner
         is set. Also add debug checks to enforce this.
      
       - Add __lockfunc to more slow path functions and add __sched to
         semaphore functions.
      
       - Mark spinlock APIs noinline when the respective CONFIG_INLINE_SPIN_*
         toggles are disabled, to reduce LTO text size.
      
       - Print more debug information when lockdep gets confused in
         look_up_lock_class().
      
       - Improve header file abuse checks.
      
       - Misc cleanups
      
      * tag 'locking-core-2022-10-07' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        locking/lockdep: Print more debug information - report name and key when look_up_lock_class() got confused
        locking: Add __sched to semaphore functions
        locking/rwsem: Disable preemption while trying for rwsem lock
        locking: Detect includes rwlock.h outside of spinlock.h
        locking: Add __lockfunc to slow path functions
        locking/spinlocks: Mark spinlocks noinline when inline spinlocks are disabled
        selftests: futex: Fix 'the the' typo in comment
      3e71f016