1. 28 Jun, 2023 20 commits
    • Linus Torvalds's avatar
      module: split up 'finit_module()' into init_module_from_file() helper · 054a7300
      Linus Torvalds authored
      This will simplify the next step, where we can then key off the inode to
      do one idempotent module load.
      
      Let's do the obvious re-organization in one step, and then the new code
      in another.
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      054a7300
    • Linus Torvalds's avatar
      Merge tag 'mmc-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc · 89181f54
      Linus Torvalds authored
      Pull MMC updates from Ulf Hansson:
       "MMC core:
         - Allow synchronous detection of (e)MMC/SD/SDIO cards
         - Fixup error check for ioctls for SPI hosts
         - Disable broken SD-Cache support for Kingston Canvas Go Plus from 2019
         - Disable broken eMMC-Trim support for Kingston EMMC04G-M627
         - Disable broken eMMC-Trim support for Micron MTFC4GACAJCN-1M
      
        MMC host:
         - bcm2835: Convert DT bindings to YAML
         - mmci:
            - Enable asynchronous probe
            - Transform the ux500 HW-busy detection into a proper state machine
            - Add support for SW busy-end timeouts for the ux500 variants
         - mmci_stm32:
            - Add support for sdm32 variant revision v3.0 used on STM32MP25
            - Improve the tuning sequence
         - mtk-sd: Tune polling-period to improve performance
         - sdhci: Fixup DMA configuration for 64-bit DMA mode
         - sdhci-bcm-kona: Convert DT bindings to YAML
         - sdhci-msm:
            - Switch to use the new ICE API
            - Add support for the SC8280XP/IPQ6018/QDU1000/QRU1000 variants
         - sdhci-pci-gli:
            - Add support SD Express cards for GL9767
            - Add support for the Genesys Logic GL9767 variant"
      
      * tag 'mmc-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: (42 commits)
        dt-bindings: mmc: fsl-imx-esdhc: Add imx6ul support
        mmc: mmci: Add support for SW busy-end timeouts
        mmc: Add MMC_QUIRK_BROKEN_SD_CACHE for Kingston Canvas Go Plus from 11/2019
        mmc: core: disable TRIM on Kingston EMMC04G-M627
        mmc: mmci: stm32: add delay block support for STM32MP25
        mmc: mmci: stm32: prepare other delay block support
        mmc: mmci: stm32: manage block gap hardware flow control
        mmc: mmci: Add support for sdmmc variant revision v3.0
        mmc: mmci: add stm32_idmabsize_align parameter
        dt-bindings: mmc: mmci: Add st,stm32mp25-sdmmc2 compatible
        mmc: core: disable TRIM on Micron MTFC4GACAJCN-1M
        mmc: mmci: Break out a helper function
        mmc: mmci: Use a switch statement machine
        mmc: mmci: Use state machine state as exit condition
        mmc: mmci: Retry the busy start condition
        mmc: mmci: Make busy complete state machine explicit
        mmc: mmci: Break out error check in busy detect
        mmc: mmci: Stash status while waiting for busy
        mmc: mmci: Unwind big if() clause
        mmc: mmci: Clear busy_status when starting command
        ...
      89181f54
    • Linus Torvalds's avatar
      Merge tag 'mtd/for-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux · 1364b406
      Linus Torvalds authored
      Pull mtd updates from
       "Core MTD changes:
         - otp:
            - Put factory OTP/NVRAM into the entropy pool
            - Clean up on error in mtd_otp_nvmem_add()
      
        MTD devices changes:
         - sm_ftl: Fix typos in comments
         - Use SPDX license headers
         - pismo: Switch back to use i2c_driver's .probe()
         - mtdpart: Drop useless LIST_HEAD
         - st_spi_fsm: Use the devm_clk_get_enabled() helper function
      
        DT binding changes:
         - partitions:
            - Include TP-Link SafeLoader in allowed list
            - Add missing type for "linux,rootfs"
         - Extend the nand node names filter
         - Create a file for raw NAND chip properties
         - Mark nand-ecc-placement deprecated
         - Describe nand-ecc-mode
         - Prevent NAND chip unevaluated properties in all NAND bindings with
           a NAND chip reference.
         - Qcom: Fix a property position
         - Marvell: Convert to YAML DT schema
      
        Raw NAND chip drivers changes:
         - Macronix: OTP access for MX30LFxG18AC
         - Add basic Sandisk manufacturer ops
         - Add support for Sandisk SDTNQGAMA
      
        Raw NAND controller driver changes:
         - Meson:
            - Replace integer consts with proper defines
            - Allow waiting w/o wired ready/busy pin
            - Check buffer length validity
            - Fix unaligned DMA buffers handling
            - dt-bindings: Fix 'nand-rb' property
         - Arasan: Revert "mtd: rawnand: arasan: Prevent an unsupported
           configuration" as this limitation is no longer true thanks to the
           recent efforts in improving the clocks support in this driver
      
        SPI-NAND changes:
         - Gigadevice: add support for GD5F2GQ5xExxH
         - Macronix: Add support for serial NAND flashes"
      
      * tag 'mtd/for-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux: (38 commits)
        dt-bindings: mtd: marvell-nand: Convert to YAML DT scheme
        dt-bindings: mtd: ti,am654: Prevent unevaluated properties
        dt-bindings: mtd: mediatek: Prevent NAND chip unevaluated properties
        dt-bindings: mtd: mediatek: Reference raw-nand-chip.yaml
        dt-bindings: mtd: stm32: Prevent NAND chip unevaluated properties
        dt-bindings: mtd: rockchip: Prevent NAND chip unevaluated properties
        dt-bindings: mtd: intel: Prevent NAND chip unevaluated properties
        dt-bindings: mtd: denali: Prevent NAND chip unevaluated properties
        dt-bindings: mtd: brcmnand: Prevent NAND chip unevaluated properties
        dt-bindings: mtd: meson: Prevent NAND chip unevaluated properties
        dt-bindings: mtd: sunxi: Prevent NAND chip unevaluated properties
        dt-bindings: mtd: ingenic: Prevent NAND chip unevaluated properties
        dt-bindings: mtd: qcom: Prevent NAND chip unevaluated properties
        dt-bindings: mtd: qcom: Fix a property position
        dt-bindings: mtd: Describe nand-ecc-mode
        dt-bindings: mtd: Mark nand-ecc-placement deprecated
        dt-bindings: mtd: Create a file for raw NAND chip properties
        dt-bindings: mtd: Accept nand related node names
        mtd: sm_ftl: Fix typos in comments
        mtd: otp: clean up on error in mtd_otp_nvmem_add()
        ...
      1364b406
    • Linus Torvalds's avatar
      Merge tag 'spi-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi · 84fccbba
      Linus Torvalds authored
      Pull spi updates from Mark Brown:
       "One small core feature this time around but mostly driver improvements
        and additions for SPI:
      
         - Add support for controlling the idle state of MOSI, some systems
           can support this and depending on the system integration may need
           it to avoid glitching in some situations
      
         - Support for polling mode in the S3C64xx driver and DMA on the
           Qualcomm QSPI driver
      
         - Support for several Allwinner SoCs, AMD Pensando Elba, Intel Mount
           Evans, Renesas RZ/V2M, and ST STM32H7"
      
      * tag 'spi-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: (66 commits)
        spi: dt-bindings: atmel,at91rm9200-spi: fix broken sam9x7 compatible
        spi: dt-bindings: atmel,at91rm9200-spi: add sam9x7 compatible
        spi: Add support for Renesas CSI
        spi: dt-bindings: Add bindings for RZ/V2M CSI
        spi: sun6i: Use the new helper to derive the xfer timeout value
        spi: atmel: Prevent false timeouts on long transfers
        spi: dt-bindings: stm32: do not disable spi-slave property for stm32f4-f7
        spi: Create a helper to derive adaptive timeouts
        spi: spi-geni-qcom: correctly handle -EPROBE_DEFER from dma_request_chan()
        spi: stm32: disable spi-slave property for stm32f4-f7
        spi: stm32: introduction of stm32h7 SPI device mode support
        spi: stm32: use dmaengine_terminate_{a}sync instead of _all
        spi: stm32: renaming of spi_master into spi_controller
        spi: dw: Remove misleading comment for Mount Evans SoC
        spi: dt-bindings: snps,dw-apb-ssi: Add compatible for Intel Mount Evans SoC
        spi: dw: Add compatible for Intel Mount Evans SoC
        spi: s3c64xx: Use dev_err_probe()
        spi: s3c64xx: Use the managed spi master allocation function
        spi: spl022: Probe defer is no error
        spi: spi-imx: fix mixing of native and gpio chipselects for imx51/imx53/imx6 variants
        ...
      84fccbba
    • Linus Torvalds's avatar
      Merge tag 'regulator-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator · 362067b6
      Linus Torvalds authored
      Pull regulator updates from Mark Brown:
       "This release is almost all drivers, there's some small improvements in
        the core but otherwise everything is updates to drivers, mostly the
        addition of new ones.
      
        There's also a bunch of changes pulled in from the MFD subsystem as
        dependencies, Rockchip and TI core MFD code that the regulator drivers
        depend on.
      
        I've also yet again managed to put a SPI commit in the regulator tree,
        I don't know what it is about those two trees (this for
        spi-geni-qcom).
      
        Summary:
      
         - Support for Renesas RAA215300, Rockchip RK808, Texas Instruments
           TPS6594 and TPS6287x, and X-Powers AXP15060 and AXP313a"
      
      * tag 'regulator-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (43 commits)
        regulator: Add Renesas PMIC RAA215300 driver
        regulator: dt-bindings: Add Renesas RAA215300 PMIC bindings
        regulator: ltc3676: Use maple tree register cache
        regulator: ltc3589: Use maple tree register cache
        regulator: helper: Document ramp_delay parameter of regulator_set_ramp_delay_regmap()
        regulator: mt6358: Use linear voltage helpers for single range regulators
        regulator: mt6358: Const-ify mt6358_regulator_info data structures
        regulator: mt6358: Drop *_SSHUB regulators
        regulator: mt6358: Merge VCN33_* regulators
        regulator: dt-bindings: mt6358: Drop *_sshub regulators
        regulator: dt-bindings: mt6358: Merge ldo_vcn33_* regulators
        regulator: dt-bindings: pwm-regulator: Add missing type for "pwm-dutycycle-unit"
        regulator: Switch two more i2c drivers back to use .probe()
        spi: spi-geni-qcom: Do not do DMA map/unmap inside driver, use framework instead
        soc: qcom: geni-se: Add interfaces geni_se_tx_init_dma() and geni_se_rx_init_dma()
        regulator: tps6594-regulator: Add driver for TI TPS6594 regulators
        regulator: axp20x: Add AXP15060 support
        regulator: axp20x: Add support for AXP313a variant
        dt-bindings: pfuze100.yaml: Add an entry for interrupts
        regulator: stm32-pwr: Fix regulator disabling
        ...
      362067b6
    • Linus Torvalds's avatar
      Merge tag 'regmap-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap · 4171a9aa
      Linus Torvalds authored
      Pull regmap updates from Mark Brown:
       "Another busy release for regmap with the second half of the maple tree
        register cache implementation, there's some smaller optimisations that
        could be done but this should now be able to replace the rbtree cache
        for most devices.
      
        We also had a followup from Aidan MacDonald's refactoring of some of
        the regmap-irq interfaces, the conversion is complete so the old
        interfaces are removed. This means that even with the new features for
        the maple tree cache we'd have a nice negative diffstat were it not
        for the addition of a bunch more KUnit coverage.
      
        There's one GPIO patch in here, it was a dependency for a cleanup of
        an API in the regmap-irq code for which the gpio-104-dio-48e driver
        was the only user.
      
        Highlights:
      
         - The maple tree cache can now load in default values more
           efficiently, and is capabale of syncing multiple registers
           in a single write during cache sync
      
         - More KUnit coverage, including some coverage for raw I/O
           and a dummy RAM backed cache to support it
      
         - Removal of several old interfaces in regmap-irq now all
           users have been modernised"
      
      * tag 'regmap-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap: (23 commits)
        regmap: Allow reads from write only registers with the flat cache
        regmap: Drop early readability check
        regmap: Check for register readability before checking cache during read
        regmap: Add test to make sure we don't sync to read only registers
        regmap: Add a test case for write only registers
        regmap: Add test that writes to write only registers are prevented
        regmap: Add debugfs file for forcing field writes
        regmap: Don't check for changes in regcache_set_val()
        regmap: maple: Implement block sync for the maple tree cache
        regmap: Provide basic KUnit coverage for the raw register I/O
        regmap: Provide a ram backed regmap with raw support
        regmap: Add missing cache_only checks
        regmap: regmap-irq: Move handle_post_irq to before pm_runtime_put
        regmap: Load register defaults in blocks rather than register by register
        regmap: mmio: Allow passing an empty config->reg_stride
        regmap-irq: Drop backward compatibility for inverted mask/unmask
        regmap-irq: Minor adjustments to .handle_mask_sync()
        regmap-irq: Remove support for not_fixed_stride
        regmap-irq: Remove type registers
        regmap-irq: Remove virtual registers
        ...
      4171a9aa
    • Linus Torvalds's avatar
      x86/mem_encrypt: Remove stale mem_encrypt_init() declaration · 1b2c92a1
      Linus Torvalds authored
      The memory encryption initialization logic was moved from init/main.c
      into arch_cpu_finalize_init() in commit 439e1757 ("init, x86: Move
      mem_encrypt_init() into arch_cpu_finalize_init()"), but a stale
      declaration for the init function was left in <linux/init.h>.
      
      And didn't cause any problems if you had X86_MEM_ENCRYPT enabled, which
      apparently everybody involved did have.  See also commit 0a9567ac
      ("x86/mem_encrypt: Unbreak the AMD_MEM_ENCRYPT=n build") in this whole
      sad saga of conflicting declarations for different situations.
      Reported-by: default avatarMatthew Wilcox <willy@infradead.org>
      Fixes: 439e1757 init, x86: Move mem_encrypt_init() into arch_cpu_finalize_init()
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      1b2c92a1
    • Linus Torvalds's avatar
      mm: fix __access_remote_vm() GUP failure case · 6581ccf0
      Linus Torvalds authored
      Commit ca5e8632 ("mm/gup: remove vmas parameter from
      get_user_pages_remote()") removed the vma argument from GUP handling,
      and instead added a helper function (get_user_page_vma_remote()) that
      looks it up separately using 'vma_lookup()'.  And then converted
      existing users that needed a vma to use the helper instead.
      
      However, the helper function intentionally acts exactly like the old
      get_user_pages_remote() did, and only fills in 'vma' on successful page
      lookup.  Fine so far.
      
      However, __access_remote_vm() wants the vma even for the unsuccessful
      case, and used to do a
      
      	vma = vma_lookup(mm, addr);
      
      explicitly to look it up when the get_user_page() failed.
      
      However, that conversion commit incorrectly removed that vma lookup,
      thinking that get_user_page_vma_remote() would have done it.  Not so.
      
      So add the vma_lookup() back in.
      
      Fixes: ca5e8632 ("mm/gup: remove vmas parameter from get_user_pages_remote()")
      Cc: Lorenzo Stoakes <lstoakes@gmail.com>
      Cc: David Hildenbrand <david@redhat.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      6581ccf0
    • Linus Torvalds's avatar
      Merge tag 'mm-nonmm-stable-2023-06-24-19-23' of... · 77b1a7f7
      Linus Torvalds authored
      Merge tag 'mm-nonmm-stable-2023-06-24-19-23' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
      
      Pull non-mm updates from Andrew Morton:
      
       - Arnd Bergmann has fixed a bunch of -Wmissing-prototypes in top-level
         directories
      
       - Douglas Anderson has added a new "buddy" mode to the hardlockup
         detector. It permits the detector to work on architectures which
         cannot provide the required interrupts, by having CPUs periodically
         perform checks on other CPUs
      
       - Zhen Lei has enhanced kexec's ability to support two crash regions
      
       - Petr Mladek has done a lot of cleanup on the hard lockup detector's
         Kconfig entries
      
       - And the usual bunch of singleton patches in various places
      
      * tag 'mm-nonmm-stable-2023-06-24-19-23' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (72 commits)
        kernel/time/posix-stubs.c: remove duplicated include
        ocfs2: remove redundant assignment to variable bit_off
        watchdog/hardlockup: fix typo in config HARDLOCKUP_DETECTOR_PREFER_BUDDY
        powerpc: move arch_trigger_cpumask_backtrace from nmi.h to irq.h
        devres: show which resource was invalid in __devm_ioremap_resource()
        watchdog/hardlockup: define HARDLOCKUP_DETECTOR_ARCH
        watchdog/sparc64: define HARDLOCKUP_DETECTOR_SPARC64
        watchdog/hardlockup: make HAVE_NMI_WATCHDOG sparc64-specific
        watchdog/hardlockup: declare arch_touch_nmi_watchdog() only in linux/nmi.h
        watchdog/hardlockup: make the config checks more straightforward
        watchdog/hardlockup: sort hardlockup detector related config values a logical way
        watchdog/hardlockup: move SMP barriers from common code to buddy code
        watchdog/buddy: simplify the dependency for HARDLOCKUP_DETECTOR_PREFER_BUDDY
        watchdog/buddy: don't copy the cpumask in watchdog_next_cpu()
        watchdog/buddy: cleanup how watchdog_buddy_check_hardlockup() is called
        watchdog/hardlockup: remove softlockup comment in touch_nmi_watchdog()
        watchdog/hardlockup: in watchdog_hardlockup_check() use cpumask_copy()
        watchdog/hardlockup: don't use raw_cpu_ptr() in watchdog_hardlockup_kick()
        watchdog/hardlockup: HAVE_NMI_WATCHDOG must implement watchdog_hardlockup_probe()
        watchdog/hardlockup: keep kernel.nmi_watchdog sysctl as 0444 if probe fails
        ...
      77b1a7f7
    • Linus Torvalds's avatar
      Merge tag 'mm-stable-2023-06-24-19-15' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm · 6e17c6de
      Linus Torvalds authored
      Pull mm updates from Andrew Morton:
      
       - Yosry Ahmed brought back some cgroup v1 stats in OOM logs
      
       - Yosry has also eliminated cgroup's atomic rstat flushing
      
       - Nhat Pham adds the new cachestat() syscall. It provides userspace
         with the ability to query pagecache status - a similar concept to
         mincore() but more powerful and with improved usability
      
       - Mel Gorman provides more optimizations for compaction, reducing the
         prevalence of page rescanning
      
       - Lorenzo Stoakes has done some maintanance work on the
         get_user_pages() interface
      
       - Liam Howlett continues with cleanups and maintenance work to the
         maple tree code. Peng Zhang also does some work on maple tree
      
       - Johannes Weiner has done some cleanup work on the compaction code
      
       - David Hildenbrand has contributed additional selftests for
         get_user_pages()
      
       - Thomas Gleixner has contributed some maintenance and optimization
         work for the vmalloc code
      
       - Baolin Wang has provided some compaction cleanups,
      
       - SeongJae Park continues maintenance work on the DAMON code
      
       - Huang Ying has done some maintenance on the swap code's usage of
         device refcounting
      
       - Christoph Hellwig has some cleanups for the filemap/directio code
      
       - Ryan Roberts provides two patch series which yield some
         rationalization of the kernel's access to pte entries - use the
         provided APIs rather than open-coding accesses
      
       - Lorenzo Stoakes has some fixes to the interaction between pagecache
         and directio access to file mappings
      
       - John Hubbard has a series of fixes to the MM selftesting code
      
       - ZhangPeng continues the folio conversion campaign
      
       - Hugh Dickins has been working on the pagetable handling code, mainly
         with a view to reducing the load on the mmap_lock
      
       - Catalin Marinas has reduced the arm64 kmalloc() minimum alignment
         from 128 to 8
      
       - Domenico Cerasuolo has improved the zswap reclaim mechanism by
         reorganizing the LRU management
      
       - Matthew Wilcox provides some fixups to make gfs2 work better with the
         buffer_head code
      
       - Vishal Moola also has done some folio conversion work
      
       - Matthew Wilcox has removed the remnants of the pagevec code - their
         functionality is migrated over to struct folio_batch
      
      * tag 'mm-stable-2023-06-24-19-15' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (380 commits)
        mm/hugetlb: remove hugetlb_set_page_subpool()
        mm: nommu: correct the range of mmap_sem_read_lock in task_mem()
        hugetlb: revert use of page_cache_next_miss()
        Revert "page cache: fix page_cache_next/prev_miss off by one"
        mm/vmscan: fix root proactive reclaim unthrottling unbalanced node
        mm: memcg: rename and document global_reclaim()
        mm: kill [add|del]_page_to_lru_list()
        mm: compaction: convert to use a folio in isolate_migratepages_block()
        mm: zswap: fix double invalidate with exclusive loads
        mm: remove unnecessary pagevec includes
        mm: remove references to pagevec
        mm: rename invalidate_mapping_pagevec to mapping_try_invalidate
        mm: remove struct pagevec
        net: convert sunrpc from pagevec to folio_batch
        i915: convert i915_gpu_error to use a folio_batch
        pagevec: rename fbatch_count()
        mm: remove check_move_unevictable_pages()
        drm: convert drm_gem_put_pages() to use a folio_batch
        i915: convert shmem_sg_free_table() to use a folio_batch
        scatterlist: add sg_set_folio()
        ...
      6e17c6de
    • Linus Torvalds's avatar
      Merge tag 'docs-arm64-move' of git://git.lwn.net/linux · 6aeadf78
      Linus Torvalds authored
      Pull arm64 documentation move from Jonathan Corbet:
       "Move the arm64 architecture documentation under Documentation/arch/.
      
        This brings some order to the documentation directory, declutters the
        top-level directory, and makes the documentation organization more
        closely match that of the source"
      
      * tag 'docs-arm64-move' of git://git.lwn.net/linux:
        perf arm-spe: Fix a dangling Documentation/arm64 reference
        mm: Fix a dangling Documentation/arm64 reference
        arm64: Fix dangling references to Documentation/arm64
        dt-bindings: fix dangling Documentation/arm64 reference
        docs: arm64: Move arm64 documentation under Documentation/arch/
      6aeadf78
    • Linus Torvalds's avatar
      Merge tag 'hardening-v6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux · 582c161c
      Linus Torvalds authored
      Pull hardening updates from Kees Cook:
       "There are three areas of note:
      
        A bunch of strlcpy()->strscpy() conversions ended up living in my tree
        since they were either Acked by maintainers for me to carry, or got
        ignored for multiple weeks (and were trivial changes).
      
        The compiler option '-fstrict-flex-arrays=3' has been enabled
        globally, and has been in -next for the entire devel cycle. This
        changes compiler diagnostics (though mainly just -Warray-bounds which
        is disabled) and potential UBSAN_BOUNDS and FORTIFY _warning_
        coverage. In other words, there are no new restrictions, just
        potentially new warnings. Any new FORTIFY warnings we've seen have
        been fixed (usually in their respective subsystem trees). For more
        details, see commit df8fc4e9.
      
        The under-development compiler attribute __counted_by has been added
        so that we can start annotating flexible array members with their
        associated structure member that tracks the count of flexible array
        elements at run-time. It is possible (likely?) that the exact syntax
        of the attribute will change before it is finalized, but GCC and Clang
        are working together to sort it out. Any changes can be made to the
        macro while we continue to add annotations.
      
        As an example of that last case, I have a treewide commit waiting with
        such annotations found via Coccinelle:
      
          https://git.kernel.org/linus/adc5b3cb48a049563dc673f348eab7b6beba8a9b
      
        Also see commit dd06e72e for more details.
      
        Summary:
      
         - Fix KMSAN vs FORTIFY in strlcpy/strlcat (Alexander Potapenko)
      
         - Convert strreplace() to return string start (Andy Shevchenko)
      
         - Flexible array conversions (Arnd Bergmann, Wyes Karny, Kees Cook)
      
         - Add missing function prototypes seen with W=1 (Arnd Bergmann)
      
         - Fix strscpy() kerndoc typo (Arne Welzel)
      
         - Replace strlcpy() with strscpy() across many subsystems which were
           either Acked by respective maintainers or were trivial changes that
           went ignored for multiple weeks (Azeem Shaikh)
      
         - Remove unneeded cc-option test for UBSAN_TRAP (Nick Desaulniers)
      
         - Add KUnit tests for strcat()-family
      
         - Enable KUnit tests of FORTIFY wrappers under UML
      
         - Add more complete FORTIFY protections for strlcat()
      
         - Add missed disabling of FORTIFY for all arch purgatories.
      
         - Enable -fstrict-flex-arrays=3 globally
      
         - Tightening UBSAN_BOUNDS when using GCC
      
         - Improve checkpatch to check for strcpy, strncpy, and fake flex
           arrays
      
         - Improve use of const variables in FORTIFY
      
         - Add requested struct_size_t() helper for types not pointers
      
         - Add __counted_by macro for annotating flexible array size members"
      
      * tag 'hardening-v6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: (54 commits)
        netfilter: ipset: Replace strlcpy with strscpy
        uml: Replace strlcpy with strscpy
        um: Use HOST_DIR for mrproper
        kallsyms: Replace all non-returning strlcpy with strscpy
        sh: Replace all non-returning strlcpy with strscpy
        of/flattree: Replace all non-returning strlcpy with strscpy
        sparc64: Replace all non-returning strlcpy with strscpy
        Hexagon: Replace all non-returning strlcpy with strscpy
        kobject: Use return value of strreplace()
        lib/string_helpers: Change returned value of the strreplace()
        jbd2: Avoid printing outside the boundary of the buffer
        checkpatch: Check for 0-length and 1-element arrays
        riscv/purgatory: Do not use fortified string functions
        s390/purgatory: Do not use fortified string functions
        x86/purgatory: Do not use fortified string functions
        acpi: Replace struct acpi_table_slit 1-element array with flex-array
        clocksource: Replace all non-returning strlcpy with strscpy
        string: use __builtin_memcpy() in strlcpy/strlcat
        staging: most: Replace all non-returning strlcpy with strscpy
        drm/i2c: tda998x: Replace all non-returning strlcpy with strscpy
        ...
      582c161c
    • Linus Torvalds's avatar
      Merge tag 'pstore-v6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux · 8ad78685
      Linus Torvalds authored
      Pull pstore updates from Kees Cook:
      
       - Check for out-of-memory condition (Jiasheng Jiang)
      
       - Convert to platform remove callback returning void (Uwe Kleine-König)
      
      * tag 'pstore-v6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
        pstore/ram: Add check for kstrdup
        pstore/ram: Convert to platform remove callback returning void
      8ad78685
    • Linus Torvalds's avatar
      Merge tag 'execve-v6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux · d416a46c
      Linus Torvalds authored
      Pull execve updates from Kees Cook:
      
       - Fix a few comments for correctness and typos (Baruch Siach)
      
       - Small simplifications for binfmt (Christophe JAILLET)
      
       - Set p_align to 4 for PT_NOTE in core dump (Fangrui Song)
      
      * tag 'execve-v6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
        binfmt_elf: fix comment typo s/reset/regset/
        elf: correct note name comment
        binfmt: Slightly simplify elf_fdpic_map_file()
        binfmt: Use struct_size()
        coredump, vmcore: Set p_align to 4 for PT_NOTE
      d416a46c
    • Linus Torvalds's avatar
      Merge tag 'Smack-for-6.5' of https://github.com/cschaufler/smack-next · 98be618a
      Linus Torvalds authored
      Pull smack updates from Casey Schaufler:
       "There are two patches, both of which change how Smack initializes the
        SMACK64TRANSMUTE extended attribute.
      
        The first corrects the behavior of overlayfs, which creates inodes
        differently from other filesystems. The second ensures that transmute
        attributes specified by mount options are correctly assigned"
      
      * tag 'Smack-for-6.5' of https://github.com/cschaufler/smack-next:
        smack: Record transmuting in smk_transmuted
        smack: Retrieve transmuting information in smack_inode_getsecurity()
      98be618a
    • Linus Torvalds's avatar
      Merge tag 'integrity-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity · b4c7f2e6
      Linus Torvalds authored
      Pull integrity subsystem updates from Mimi Zohar:
       "An i_version change, one bug fix, and three kernel doc fixes:
      
         - instead of IMA detecting file change by directly accesssing
           i_version, it now calls vfs_getattr_nosec().
      
         - fix a race condition when inserting a new node in the iint rb-tree"
      
      * tag 'integrity-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity:
        ima: Fix build warnings
        evm: Fix build warnings
        evm: Complete description of evm_inode_setattr()
        integrity: Fix possible multiple allocation in integrity_inode_get()
        IMA: use vfs_getattr_nosec to get the i_version
      b4c7f2e6
    • Linus Torvalds's avatar
      Merge tag 'lsm-pr-20230626' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/lsm · 21953eb1
      Linus Torvalds authored
      Pull lsm updates from Paul Moore:
      
       - A SafeSetID patch to correct what appears to be a cut-n-paste typo in
         the code causing a UID to be printed where a GID was desired.
      
         This is coming via the LSM tree because we haven't been able to get a
         response from the SafeSetID maintainer (Micah Morton) in several
         months. Hopefully we are able to get in touch with Micah, but until
         we do I'm going to pick them up in the LSM tree.
      
       - A small fix to the reiserfs LSM xattr code.
      
         We're continuing to work through some issues with the reiserfs code
         as we try to fixup the LSM xattr handling, but in the process we're
         uncovering some ugly problems in reiserfs and we may just end up
         removing the LSM xattr support in reiserfs prior to reiserfs'
         removal.
      
         For better or worse, this shouldn't impact any of the reiserfs users,
         as we discovered that LSM xattrs on reiserfs were completely broken,
         meaning no one is currently using the combo of reiserfs and a file
         labeling LSM.
      
       - A tweak to how the cap_user_data_t struct/typedef is declared in the
         header file to appease the Sparse gods.
      
       - In the process of trying to sort out the SafeSetID lost-maintainer
         problem I realized that I needed to update the labeled networking
         entry to "Supported".
      
       - Minor comment/documentation and spelling fixes.
      
      * tag 'lsm-pr-20230626' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/lsm:
        device_cgroup: Fix kernel-doc warnings in device_cgroup
        SafeSetID: fix UID printed instead of GID
        MAINTAINERS: move labeled networking to "supported"
        capability: erase checker warnings about struct __user_cap_data_struct
        lsm: fix a number of misspellings
        reiserfs: Initialize sec->length in reiserfs_security_init().
        capability: fix kernel-doc warnings in capability.c
      21953eb1
    • Linus Torvalds's avatar
      Merge tag 'selinux-pr-20230626' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux · 729b39ec
      Linus Torvalds authored
      Pull selinux updates from Paul Moore:
      
       - Thanks to help from the MPTCP folks, it looks like we have finally
         sorted out a proper solution to the MPTCP socket labeling issue, see
         the new security_mptcp_add_subflow() LSM hook.
      
       - Fix the labeled NFS handling such that a labeled NFS share mounted
         prior to the initial SELinux policy load is properly labeled once a
         policy is loaded; more information in the commit description.
      
       - Two patches to security/selinux/Makefile, the first took the cleanups
         in v6.4 a bit further and the second removed the grouped targets
         support as that functionality doesn't appear to be properly supported
         prior to make v4.3.
      
       - Deprecate the "fs" object context type in SELinux policies. The fs
         object context type was an old vestige that was introduced back in
         v2.6.12-rc2 but never really used.
      
       - A number of small changes that remove dead code, clean up some
         awkward bits, and generally improve the quality of the code. See the
         individual commit descriptions for more information.
      
      * tag 'selinux-pr-20230626' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux:
        selinux: avoid bool as identifier name
        selinux: fix Makefile for versions of make < v4.3
        selinux: make labeled NFS work when mounted before policy load
        selinux: cleanup exit_sel_fs() declaration
        selinux: deprecated fs ocon
        selinux: make header files self-including
        selinux: keep context struct members in sync
        selinux: Implement mptcp_add_subflow hook
        security, lsm: Introduce security_mptcp_add_subflow()
        selinux: small cleanups in selinux_audit_rule_init()
        selinux: declare read-only data arrays const
        selinux: retain const qualifier on string literal in avtab_hash_eval()
        selinux: drop return at end of void function avc_insert()
        selinux: avc: drop unused function avc_disable()
        selinux: adjust typos in comments
        selinux: do not leave dangling pointer behind
        selinux: more Makefile tweaks
      729b39ec
    • Linus Torvalds's avatar
      Merge tag 'audit-pr-20230626' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit · cae72026
      Linus Torvalds authored
      Pull audit update from Paul Moore:
       "A single audit patch that resolves two compiler warnings regarding
        missing function prototypes"
      
      * tag 'audit-pr-20230626' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit:
        audit: avoid missing-prototype warnings
      cae72026
    • Linus Torvalds's avatar
      Merge tag 'landlock-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mic/linux · 26642864
      Linus Torvalds authored
      Pull landlock updates from Mickaël Salaün:
       "Add support for Landlock to UML.
      
        To do this, this fixes the way hostfs manages inodes according to the
        underlying filesystem [1]. They are now properly handled as for other
        filesystems, which enables Landlock support (and probably other
        features).
      
        This also extends Landlock's tests with 6 pseudo filesystems,
        including hostfs"
      
      [1] https://lore.kernel.org/all/20230612191430.339153-1-mic@digikod.net/
      
      * tag 'landlock-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mic/linux:
        selftests/landlock: Add hostfs tests
        selftests/landlock: Add tests for pseudo filesystems
        selftests/landlock: Make mounts configurable
        selftests/landlock: Add supports_filesystem() helper
        selftests/landlock: Don't create useless file layouts
        hostfs: Fix ephemeral inodes
      26642864
  2. 27 Jun, 2023 20 commits
    • Linus Torvalds's avatar
      Merge tag 'cgroup-for-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup · 6e2332e0
      Linus Torvalds authored
      Pull cgroup updates from Tejun Heo:
      
       - Whenever cpuset needs to rebuild sched_domain, it walked all tasks
         looking for DEADLINE tasks as they need to be accounted on the new
         domain. Walking all tasks can be expensive and there may not be any
         DEADLINE tasks at all. Task iteration is now omitted if there are no
         DEADLINE tasks
      
       - Fixes DEADLINE bandwidth misaccounting after task migration failures
      
       - When no controller is enabled, -Wstringop-overflow warning is
         triggered. The fix patch added an early exit which is too eager and
         got reverted for now. Will fix later
      
       - Everything else is minor cleanups
      
      * tag 'cgroup-for-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup:
        Revert "cgroup: Avoid -Wstringop-overflow warnings"
        cgroup/misc: Expose misc.current on cgroup v2 root
        cgroup: Avoid -Wstringop-overflow warnings
        cgroup: remove obsolete comment on cgroup_on_dfl()
        cgroup: remove unused task_cgroup_path()
        cgroup/cpuset: remove unneeded header files
        cgroup: make cgroup_is_threaded() and cgroup_is_thread_root() static
        rdmacg: fix kernel-doc warnings in rdmacg
        cgroup: Replace the css_set call with cgroup_get
        cgroup: remove unused macro for_each_e_css()
        cgroup: Update out-of-date comment in cgroup_migrate()
        cgroup: Replace all non-returning strlcpy with strscpy
        cgroup/cpuset: remove unneeded header files
        cgroup/cpuset: Free DL BW in case can_attach() fails
        sched/deadline: Create DL BW alloc, free & check overflow interface
        cgroup/cpuset: Iterate only if DEADLINE tasks are present
        sched/cpuset: Keep track of SCHED_DEADLINE task in cpusets
        sched/cpuset: Bring back cpuset_mutex
        cgroup/cpuset: Rename functions dealing with DEADLINE accounting
      6e2332e0
    • Linus Torvalds's avatar
      Merge tag 'wq-for-6.5-cleanup-ordered' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq · 72dc6db7
      Linus Torvalds authored
      Pull ordered workqueue creation updates from Tejun Heo:
       "For historical reasons, unbound workqueues with max concurrency limit
        of 1 are considered ordered, even though the concurrency limit hasn't
        been system-wide for a long time.
      
        This creates ambiguity around whether ordered execution is actually
        required for correctness, which was actually confusing for e.g. btrfs
        (btrfs updates are being routed through the btrfs tree).
      
        There aren't that many users in the tree which use the combination and
        there are pending improvements to unbound workqueue affinity handling
        which will make inadvertent use of ordered workqueue a bigger loss.
      
        This clarifies the situation for most of them by updating the ones
        which require ordered execution to use alloc_ordered_workqueue().
      
        There are some conversions being routed through subsystem-specific
        trees and likely a few stragglers. Once they're all converted,
        workqueue can trigger a warning on unbound + @max_active==1 usages and
        eventually drop the implicit ordered behavior"
      
      * tag 'wq-for-6.5-cleanup-ordered' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq:
        rxrpc: Use alloc_ordered_workqueue() to create ordered workqueues
        net: qrtr: Use alloc_ordered_workqueue() to create ordered workqueues
        net: wwan: t7xx: Use alloc_ordered_workqueue() to create ordered workqueues
        dm integrity: Use alloc_ordered_workqueue() to create ordered workqueues
        media: amphion: Use alloc_ordered_workqueue() to create ordered workqueues
        scsi: NCR5380: Use default @max_active for hostdata->work_q
        media: coda: Use alloc_ordered_workqueue() to create ordered workqueues
        crypto: octeontx2: Use alloc_ordered_workqueue() to create ordered workqueues
        wifi: ath10/11/12k: Use alloc_ordered_workqueue() to create ordered workqueues
        wifi: mwifiex: Use default @max_active for workqueues
        wifi: iwlwifi: Use default @max_active for trans_pcie->rba.alloc_wq
        xen/pvcalls: Use alloc_ordered_workqueue() to create ordered workqueues
        virt: acrn: Use alloc_ordered_workqueue() to create ordered workqueues
        net: octeontx2: Use alloc_ordered_workqueue() to create ordered workqueues
        net: thunderx: Use alloc_ordered_workqueue() to create ordered workqueues
        greybus: Use alloc_ordered_workqueue() to create ordered workqueues
        powerpc, workqueue: Use alloc_ordered_workqueue() to create ordered workqueues
      72dc6db7
    • Linus Torvalds's avatar
      Merge tag 'wq-for-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq · 7ab044a4
      Linus Torvalds authored
      Pull workqueue updates from Tejun Heo:
      
       - Concurrency-managed per-cpu work items that hog CPUs and delay the
         execution of other work items are now automatically detected and
         excluded from concurrency management. Reporting on such work items
         can also be enabled through a config option.
      
       - Added tools/workqueue/wq_monitor.py which improves visibility into
         workqueue usages and behaviors.
      
       - Arnd's minimal fix for gcc-13 enum warning on 32bit compiles,
         superseded by commit afa4bb77 in mainline.
      
      * tag 'wq-for-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq:
        workqueue: Disable per-cpu CPU hog detection when wq_cpu_intensive_thresh_us is 0
        workqueue: Fix WARN_ON_ONCE() triggers in worker_enter_idle()
        workqueue: fix enum type for gcc-13
        workqueue: Track and monitor per-workqueue CPU time usage
        workqueue: Report work funcs that trigger automatic CPU_INTENSIVE mechanism
        workqueue: Automatically mark CPU-hogging work items CPU_INTENSIVE
        workqueue: Improve locking rule description for worker fields
        workqueue: Move worker_set/clr_flags() upwards
        workqueue: Re-order struct worker fields
        workqueue: Add pwq->stats[] and a monitoring script
        Further upgrade queue_work_on() comment
      7ab044a4
    • Linus Torvalds's avatar
      Merge tag 'for-linus-6.5-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip · 18eb3b6d
      Linus Torvalds authored
      Pull xen updates from Juergen Gross:
      
       - three patches adding missing prototypes
      
       - a fix for finding the iBFT in a Xen dom0 for supporting diskless
         iSCSI boot
      
      * tag 'for-linus-6.5-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
        x86: xen: add missing prototypes
        x86/xen: add prototypes for paravirt mmu functions
        iscsi_ibft: Fix finding the iBFT under Xen Dom 0
        xen: xen_debug_interrupt prototype to global header
      18eb3b6d
    • Linus Torvalds's avatar
      Merge tag 's390-6.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux · 6a466769
      Linus Torvalds authored
      Pull s390 updates from Alexander Gordeev:
      
       - Fix the style of protected key API driver source: use x-mas tree for
         all local variable declarations
      
       - Rework protected key API driver to not use the struct pkey_protkey
         and pkey_clrkey anymore. Both structures have a fixed size buffer,
         but with the support of ECC protected key these buffers are not big
         enough. Use dynamic buffers internally and transparently for
         userspace
      
       - Add support for a new 'non CCA clear key token' with ECC clear keys
         supported: ECC P256, ECC P384, ECC P521, ECC ED25519 and ECC ED448.
         This makes it possible to derive a protected key from the ECC clear
         key input via PKEY_KBLOB2PROTK3 ioctl, while currently the only way
         to derive is via PCKMO instruction
      
       - The s390 PMU of PAI crypto and extension 1 NNPA counters use atomic_t
         for reference counting. Replace this with the proper data type
         refcount_t
      
       - Select ARCH_SUPPORTS_INT128, but limit this to clang for now, since
         gcc generates inefficient code, which may lead to stack overflows
      
       - Replace one-element array with flexible-array member in struct
         vfio_ccw_parent and refactor the rest of the code accordingly. Also,
         prefer struct_size() over sizeof() open- coded versions
      
       - Introduce OS_INFO_FLAGS_ENTRY pointing to a flags field and
         OS_INFO_FLAG_REIPL_CLEAR flag that informs a dumper whether the
         system memory should be cleared or not once dumped
      
       - Fix a hang when a user attempts to remove a VFIO-AP mediated device
         attached to a guest: add VFIO_DEVICE_GET_IRQ_INFO and
         VFIO_DEVICE_SET_IRQS IOCTLs and wire up the VFIO bus driver callback
         to request a release of the device
      
       - Fix calculation for R_390_GOTENT relocations for modules
      
       - Allow any user space process with CAP_PERFMON capability read and
         display the CPU Measurement facility counter sets
      
       - Rework large statically-defined per-CPU cpu_cf_events data structure
         and replace it with dynamically allocated structures created when a
         perf_event_open() system call is invoked or /dev/hwctr device is
         accessed
      
      * tag 's390-6.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
        s390/cpum_cf: rework PER_CPU_DEFINE of struct cpu_cf_events
        s390/cpum_cf: open access to hwctr device for CAP_PERFMON privileged process
        s390/module: fix rela calculation for R_390_GOTENT
        s390/vfio-ap: wire in the vfio_device_ops request callback
        s390/vfio-ap: realize the VFIO_DEVICE_SET_IRQS ioctl
        s390/vfio-ap: realize the VFIO_DEVICE_GET_IRQ_INFO ioctl
        s390/pkey: add support for ecc clear key
        s390/pkey: do not use struct pkey_protkey
        s390/pkey: introduce reverse x-mas trees
        s390/zcore: conditionally clear memory on reipl
        s390/ipl: add REIPL_CLEAR flag to os_info
        vfio/ccw: use struct_size() helper
        vfio/ccw: replace one-element array with flexible-array member
        s390: select ARCH_SUPPORTS_INT128
        s390/pai_ext: replace atomic_t with refcount_t
        s390/pai_crypto: replace atomic_t with refcount_t
      6a466769
    • Linus Torvalds's avatar
      Merge tag 'xtensa-20230627' of https://github.com/jcmvbkbc/linux-xtensa · 8d8026f3
      Linus Torvalds authored
      Pull xtensa updates from Max Filippov:
      
       - clean up platform_* interface of the xtensa architecture
      
       - enable HAVE_ASM_MODVERSIONS
      
       - drop ARCH_WANT_FRAME_POINTERS
      
       - clean up unaligned access exception handler
      
       - provide handler for load/store exceptions
      
       - various small fixes and cleanups
      
      * tag 'xtensa-20230627' of https://github.com/jcmvbkbc/linux-xtensa:
        xtensa: dump userspace code around the exception PC
        xtensa: rearrange show_stack output
        xtensa: add load/store exception handler
        xtensa: rearrange unaligned exception handler
        xtensa: always install slow handler for unaligned access exception
        xtensa: move early_trap_init from kasan_early_init to init_arch
        xtensa: drop ARCH_WANT_FRAME_POINTERS
        xtensa: report trax and perf counters in cpuinfo
        xtensa: add asm-prototypes.h
        xtensa: only build __strncpy_user with CONFIG_ARCH_HAS_STRNCPY_FROM_USER
        xtensa: drop bcopy implementation
        xtensa: drop EXPORT_SYMBOL for common_exception_return
        xtensa: boot-redboot: clean up Makefile
        xtensa: clean up default platform functions
        xtensa: drop platform_halt and platform_power_off
        xtensa: drop platform_restart
        xtensa: drop platform_heartbeat
        xtensa: xt2000: drop empty platform_init
      8d8026f3
    • Dinh Nguyen's avatar
      Revert "nios2: Convert __pte_free_tlb() to use ptdescs" · 0ae61229
      Dinh Nguyen authored
      This reverts commit 6ebe94ba.
      
      The patch "nios2: Convert __pte_free_tlb() to use ptdescs" was supposed
      to go together with a patchset that Vishal Moola had planned taking it
      through the mm tree. By just having this patch, all NIOS2 builds are
      broken.
      Signed-off-by: default avatarDinh Nguyen <dinguyen@kernel.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      0ae61229
    • Linus Torvalds's avatar
      Merge tag 'objtool-core-2023-06-27' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 6f612579
      Linus Torvalds authored
      Pull objtool updates from Ingo Molar:
       "Build footprint & performance improvements:
      
         - Reduce memory usage with CONFIG_DEBUG_INFO=y
      
           In the worst case of an allyesconfig+CONFIG_DEBUG_INFO=y kernel,
           DWARF creates almost 200 million relocations, ballooning objtool's
           peak heap usage to 53GB. These patches reduce that to 25GB.
      
           On a distro-type kernel with kernel IBT enabled, they reduce
           objtool's peak heap usage from 4.2GB to 2.8GB.
      
           These changes also improve the runtime significantly.
      
        Debuggability improvements:
      
         - Add the unwind_debug command-line option, for more extend unwinding
           debugging output
         - Limit unreachable warnings to once per function
         - Add verbose option for disassembling affected functions
         - Include backtrace in verbose mode
         - Detect missing __noreturn annotations
         - Ignore exc_double_fault() __noreturn warnings
         - Remove superfluous global_noreturns entries
         - Move noreturn function list to separate file
         - Add __kunit_abort() to noreturns
      
        Unwinder improvements:
      
         - Allow stack operations in UNWIND_HINT_UNDEFINED regions
         - drm/vmwgfx: Add unwind hints around RBP clobber
      
        Cleanups:
      
         - Move the x86 entry thunk restore code into thunk functions
         - x86/unwind/orc: Use swap() instead of open coding it
         - Remove unnecessary/unused variables
      
        Fixes for modern stack canary handling"
      
      * tag 'objtool-core-2023-06-27' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (42 commits)
        x86/orc: Make the is_callthunk() definition depend on CONFIG_BPF_JIT=y
        objtool: Skip reading DWARF section data
        objtool: Free insns when done
        objtool: Get rid of reloc->rel[a]
        objtool: Shrink elf hash nodes
        objtool: Shrink reloc->sym_reloc_entry
        objtool: Get rid of reloc->jump_table_start
        objtool: Get rid of reloc->addend
        objtool: Get rid of reloc->type
        objtool: Get rid of reloc->offset
        objtool: Get rid of reloc->idx
        objtool: Get rid of reloc->list
        objtool: Allocate relocs in advance for new rela sections
        objtool: Add for_each_reloc()
        objtool: Don't free memory in elf_close()
        objtool: Keep GElf_Rel[a] structs synced
        objtool: Add elf_create_section_pair()
        objtool: Add mark_sec_changed()
        objtool: Fix reloc_hash size
        objtool: Consolidate rel/rela handling
        ...
      6f612579
    • Linus Torvalds's avatar
      Merge tag 'x86-mm-2023-06-27' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 4d675181
      Linus Torvalds authored
      Pull x86 mm updates from Ingo Molnar:
      
       - Remove Xen-PV leftovers from init_32.c
      
       - Fix __swp_entry_to_pte() warning splat for Xen PV guests, triggered
         on CONFIG_DEBUG_VM_PGTABLE=y
      
      * tag 'x86-mm-2023-06-27' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/mm: Remove Xen-PV leftovers from init_32.c
        x86/mm: Fix __swp_entry_to_pte() for Xen PV guests
      4d675181
    • Linus Torvalds's avatar
      Merge tag 'perf-core-2023-06-27' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · a193cc75
      Linus Torvalds authored
      Pull perf events updates from Ingo Molnar:
      
       - Rework & fix the event forwarding logic by extending the core
         interface.
      
         This fixes AMD PMU events that have to be forwarded from the
         core PMU to the IBS PMU.
      
       - Add self-tests to test AMD IBS invocation via core PMU events
      
       - Clean up Intel FixCntrCtl MSR encoding & handling
      
      * tag 'perf-core-2023-06-27' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        perf: Re-instate the linear PMU search
        perf/x86/intel: Define bit macros for FixCntrCtl MSR
        perf test: Add selftest to test IBS invocation via core pmu events
        perf/core: Remove pmu linear searching code
        perf/ibs: Fix interface via core pmu events
        perf/core: Rework forwarding of {task|cpu}-clock events
      a193cc75
    • Linus Torvalds's avatar
      Merge tag 'locking-core-2023-06-27' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · bc6cb4d5
      Linus Torvalds authored
      Pull locking updates from Ingo Molnar:
      
       - Introduce cmpxchg128() -- aka. the demise of cmpxchg_double()
      
         The cmpxchg128() family of functions is basically & functionally the
         same as cmpxchg_double(), but with a saner interface.
      
         Instead of a 6-parameter horror that forced u128 - u64/u64-halves
         layout details on the interface and exposed users to complexity,
         fragility & bugs, use a natural 3-parameter interface with u128
         types.
      
       - Restructure the generated atomic headers, and add kerneldoc comments
         for all of the generic atomic{,64,_long}_t operations.
      
         The generated definitions are much cleaner now, and come with
         documentation.
      
       - Implement lock_set_cmp_fn() on lockdep, for defining an ordering when
         taking multiple locks of the same type.
      
         This gets rid of one use of lockdep_set_novalidate_class() in the
         bcache code.
      
       - Fix raw_cpu_generic_try_cmpxchg() bug due to an unintended variable
         shadowing generating garbage code on Clang on certain ARM builds.
      
      * tag 'locking-core-2023-06-27' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (43 commits)
        locking/atomic: scripts: fix ${atomic}_dec_if_positive() kerneldoc
        percpu: Fix self-assignment of __old in raw_cpu_generic_try_cmpxchg()
        locking/atomic: treewide: delete arch_atomic_*() kerneldoc
        locking/atomic: docs: Add atomic operations to the driver basic API documentation
        locking/atomic: scripts: generate kerneldoc comments
        docs: scripts: kernel-doc: accept bitwise negation like ~@var
        locking/atomic: scripts: simplify raw_atomic*() definitions
        locking/atomic: scripts: simplify raw_atomic_long*() definitions
        locking/atomic: scripts: split pfx/name/sfx/order
        locking/atomic: scripts: restructure fallback ifdeffery
        locking/atomic: scripts: build raw_atomic_long*() directly
        locking/atomic: treewide: use raw_atomic*_<op>()
        locking/atomic: scripts: add trivial raw_atomic*_<op>()
        locking/atomic: scripts: factor out order template generation
        locking/atomic: scripts: remove leftover "${mult}"
        locking/atomic: scripts: remove bogus order parameter
        locking/atomic: xtensa: add preprocessor symbols
        locking/atomic: x86: add preprocessor symbols
        locking/atomic: sparc: add preprocessor symbols
        locking/atomic: sh: add preprocessor symbols
        ...
      bc6cb4d5
    • Linus Torvalds's avatar
      Merge tag 'sched-core-2023-06-27' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · ed3b7923
      Linus Torvalds authored
      Pull scheduler updates from Ingo Molnar:
       "Scheduler SMP load-balancer improvements:
      
         - Avoid unnecessary migrations within SMT domains on hybrid systems.
      
           Problem:
      
              On hybrid CPU systems, (processors with a mixture of
              higher-frequency SMT cores and lower-frequency non-SMT cores),
              under the old code lower-priority CPUs pulled tasks from the
              higher-priority cores if more than one SMT sibling was busy -
              resulting in many unnecessary task migrations.
      
           Solution:
      
              The new code improves the load balancer to recognize SMT cores
              with more than one busy sibling and allows lower-priority CPUs
              to pull tasks, which avoids superfluous migrations and lets
              lower-priority cores inspect all SMT siblings for the busiest
              queue.
      
         - Implement the 'runnable boosting' feature in the EAS balancer:
           consider CPU contention in frequency, EAS max util & load-balance
           busiest CPU selection.
      
           This improves CPU utilization for certain workloads, while leaves
           other key workloads unchanged.
      
        Scheduler infrastructure improvements:
      
         - Rewrite the scheduler topology setup code by consolidating it into
           the build_sched_topology() helper function and building it
           dynamically on the fly.
      
         - Resolve the local_clock() vs. noinstr complications by rewriting
           the code: provide separate sched_clock_noinstr() and
           local_clock_noinstr() functions to be used in instrumentation code,
           and make sure it is all instrumentation-safe.
      
        Fixes:
      
         - Fix a kthread_park() race with wait_woken()
      
         - Fix misc wait_task_inactive() bugs unearthed by the -rt merge:
             - Fix UP PREEMPT bug by unifying the SMP and UP implementations
             - Fix task_struct::saved_state handling
      
         - Fix various rq clock update bugs, unearthed by turning on the rq
           clock debugging code.
      
         - Fix the PSI WINDOW_MIN_US trigger limit, which was easy to trigger
           by creating enough cgroups, by removing the warnign and restricting
           window size triggers to PSI file write-permission or
           CAP_SYS_RESOURCE.
      
         - Propagate SMT flags in the topology when removing degenerate domain
      
         - Fix grub_reclaim() calculation bug in the deadline scheduler code
      
         - Avoid resetting the min update period when it is unnecessary, in
           psi_trigger_destroy().
      
         - Don't balance a task to its current running CPU in load_balance(),
           which was possible on certain NUMA topologies with overlapping
           groups.
      
         - Fix the sched-debug printing of rq->nr_uninterruptible
      
        Cleanups:
      
         - Address various -Wmissing-prototype warnings, as a preparation to
           (maybe) enable this warning in the future.
      
         - Remove unused code
      
         - Mark more functions __init
      
         - Fix shadow-variable warnings"
      
      * tag 'sched-core-2023-06-27' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (50 commits)
        sched/core: Avoid multiple calling update_rq_clock() in __cfsb_csd_unthrottle()
        sched/core: Avoid double calling update_rq_clock() in __balance_push_cpu_stop()
        sched/core: Fixed missing rq clock update before calling set_rq_offline()
        sched/deadline: Update GRUB description in the documentation
        sched/deadline: Fix bandwidth reclaim equation in GRUB
        sched/wait: Fix a kthread_park race with wait_woken()
        sched/topology: Mark set_sched_topology() __init
        sched/fair: Rename variable cpu_util eff_util
        arm64/arch_timer: Fix MMIO byteswap
        sched/fair, cpufreq: Introduce 'runnable boosting'
        sched/fair: Refactor CPU utilization functions
        cpuidle: Use local_clock_noinstr()
        sched/clock: Provide local_clock_noinstr()
        x86/tsc: Provide sched_clock_noinstr()
        clocksource: hyper-v: Provide noinstr sched_clock()
        clocksource: hyper-v: Adjust hv_read_tsc_page_tsc() to avoid special casing U64_MAX
        x86/vdso: Fix gettimeofday masking
        math64: Always inline u128 version of mul_u64_u64_shr()
        s390/time: Provide sched_clock_noinstr()
        loongarch: Provide noinstr sched_clock_read()
        ...
      ed3b7923
    • Linus Torvalds's avatar
      Merge tag 'x86_sgx_for_v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · e8f75c02
      Linus Torvalds authored
      Pull SGX update from Borislav Petkov:
      
       - A fix to avoid using a list iterator variable after the loop it is
         used in
      
      * tag 'x86_sgx_for_v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/sgx: Avoid using iterator after loop in sgx_mmu_notifier_release()
      e8f75c02
    • Linus Torvalds's avatar
      Merge tag 'x86_sev_for_v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 12dc0100
      Linus Torvalds authored
      Pull x86 SEV updates from Borislav Petkov:
      
       - Some SEV and CC platform helpers cleanup and simplifications now that
         the usage patterns are becoming apparent
      
      [ I'm sure I'm the only one that has gets confused by all the TLAs, but
        in case there are others: here SEV is AMD's "Secure Encrypted
        Virtualization" and CC is generic "Confidential Computing".
      
        There's also Intel SGX (Software Guard Extensions) and TDX (Trust
        Domain Extensions), along with all the vendor memory encryption
        extensions (SME, TSME, TME, and WTF).
      
        And then we have arm64 with RMA and CCA, and I probably forgot another
        dozen or so related acronyms    - Linus ]
      
      * tag 'x86_sev_for_v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/coco: Get rid of accessor functions
        x86/sev: Get rid of special sev_es_enable_key
        x86/coco: Mark cc_platform_has() and descendants noinstr
      12dc0100
    • Linus Torvalds's avatar
      Merge tag 'x86_mtrr_for_v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · dc43fc75
      Linus Torvalds authored
      Pull x86 mtrr updates from Borislav Petkov:
       "A serious scrubbing of the MTRR code including adding a new map
        mechanism in order to look up the memory type of a region easily.
      
        Also address memory range lookup issues like returning an invalid
        memory type. Furthermore, this handles the decoupling of PAT from MTRR
        more naturally.
      
        All work by Juergen Gross"
      
      * tag 'x86_mtrr_for_v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/xen: Set default memory type for PV guests to WB
        x86/mtrr: Unify debugging printing
        x86/mtrr: Remove unused code
        x86/mm: Only check uniform after calling mtrr_type_lookup()
        x86/mtrr: Don't let mtrr_type_lookup() return MTRR_TYPE_INVALID
        x86/mtrr: Use new cache_map in mtrr_type_lookup()
        x86/mtrr: Add mtrr=debug command line option
        x86/mtrr: Construct a memory map with cache modes
        x86/mtrr: Add get_effective_type() service function
        x86/mtrr: Allocate mtrr_value array dynamically
        x86/mtrr: Move 32-bit code from mtrr.c to legacy.c
        x86/mtrr: Have only one set_mtrr() variant
        x86/mtrr: Replace vendor tests in MTRR code
        x86/xen: Set MTRR state when running as Xen PV initial domain
        x86/hyperv: Set MTRR state when running as SEV-SNP Hyper-V guest
        x86/mtrr: Support setting MTRR state for software defined MTRRs
        x86/mtrr: Replace size_or_mask and size_and_mask with a much easier concept
        x86/mtrr: Remove physical address size calculation
      dc43fc75
    • Linus Torvalds's avatar
      Merge tag 'x86_misc_for_v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 4baa098a
      Linus Torvalds authored
      Pull misc x86 updates from Borislav Petkov:
      
       - Remove the local symbols prefix of the get/put_user() exception
         handling symbols so that tools do not get confused by the presence of
         code belonging to the wrong symbol/not belonging to any symbol
      
       - Improve csum_partial()'s performance
      
       - Some improvements to the kcpuid tool
      
      * tag 'x86_misc_for_v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/lib: Make get/put_user() exception handling a visible symbol
        x86/csum: Fix clang -Wuninitialized in csum_partial()
        x86/csum: Improve performance of `csum_partial`
        tools/x86/kcpuid: Add .gitignore
        tools/x86/kcpuid: Dump the correct CPUID function in error
      4baa098a
    • Linus Torvalds's avatar
      Merge tag 'x86_microcode_for_v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 4aacacee
      Linus Torvalds authored
      Pull x86 microcode loader updates from Borislav Petkov:
      
       - Load late on both SMT threads on AMD, just like it is being done in
         the early loading procedure
      
        - Cleanups
      
      * tag 'x86_microcode_for_v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/microcode/AMD: Load late on both threads too
        x86/microcode/amd: Remove unneeded pointer arithmetic
        x86/microcode/AMD: Get rid of __find_equiv_id()
      4aacacee
    • Linus Torvalds's avatar
      Merge tag 'docs-arm-move' of git://git.lwn.net/linux · 04fc8904
      Linus Torvalds authored
      Pull arm documentation move from Jonathan Corbet:
       "Move the Arm architecture documentation under Documentation/arch/.
      
        This brings some order to the documentation directory, declutters the
        top-level directory, and makes the documentation organization more
        closely match that of the source"
      
      * tag 'docs-arm-move' of git://git.lwn.net/linux:
        dt-bindings: Update Documentation/arm references
        docs: update some straggling Documentation/arm references
        crypto: update some Arm documentation references
        mips: update a reference to a moved Arm Document
        arm64: Update Documentation/arm references
        arm: update in-source documentation references
        arm: docs: Move Arm documentation to Documentation/arch/
      04fc8904
    • Linus Torvalds's avatar
      Merge tag 'docs-6.5' of git://git.lwn.net/linux · a3540495
      Linus Torvalds authored
      Pull documentation updates from Jonathan Corbet:
       "It's been a relatively calm cycle in docsland. We do have:
      
         - Some initial page-table documentation from Linus (the other Linus)
      
         - Regression-handling documentation improvements from Thorsten
      
         - Addition of kerneldoc documentation for the ERR_PTR() and related
           macros from James Seo
      
        ... and the usual collection of fixes and updates"
      
      * tag 'docs-6.5' of git://git.lwn.net/linux:
        docs: consolidate storage interfaces
        Documentation: update git configuration for Link: tag
        Documentation: KVM: make corrections to vcpu-requests.rst
        Documentation: KVM: make corrections to ppc-pv.rst
        Documentation: KVM: make corrections to locking.rst
        Documentation: KVM: make corrections to halt-polling.rst
        Documentation: virt: correct location of haltpoll module params
        Documentation/mm: Initial page table documentation
        docs: crypto: async-tx-api: fix typo in struct name
        docs/doc-guide: Clarify how to write tables
        docs: handling-regressions: rework section about fixing procedures
        docs: process: fix a typoed cross-reference
        docs: submitting-patches: Discuss interleaved replies
        MAINTAINERS: direct process doc changes to a dedicated ML
        Documentation: core-api: Add error pointer functions to kernel-api
        err.h: Add missing kerneldocs for error pointer functions
        Documentation: conf.py: Add __force to c_id_attributes
        docs: clarify KVM related kernel parameters' descriptions
        docs: consolidate human interface subsystems
        docs: admin-guide: Add information about intel_pstate active mode
      a3540495
    • Linus Torvalds's avatar
      Merge tag 'linux-kselftest-next-6.5-rc1' of... · dedbf31a
      Linus Torvalds authored
      Merge tag 'linux-kselftest-next-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest
      
      Pull kselftest updates from Shuah Khan:
      
       - allow runners to override the timeout
      
         This change is made to avoid future increases of long timeouts
      
       - several other spelling and cleanups
      
       - a new subtest to video_device_test
      
       - enhancements to test coverage in clone3 test
      
       - other fixes to ftrace and cpufreq tests
      
      * tag 'linux-kselftest-next-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
        selftests/ftace: Fix KTAP output ordering
        selftests/cpufreq: Don't enable generic lock debugging options
        kselftests: Sort the collections list to avoid duplicate tests
        selftest: pidfd: Omit long and repeating outputs
        selftests: allow runners to override the timeout
        selftests/ftrace: Add new test case which checks for optimized probes
        selftests/clone3: test clone3 with exit signal in flags
        kselftest: vDSO: Fix accumulation of uninitialized ret when CLOCK_REALTIME is undefined
        selftests: prctl: Fix spelling mistake "anonynous" -> "anonymous"
        selftests: media_tests: Add new subtest to video_device_test
      dedbf31a