1. 09 May, 2024 3 commits
    • Will Deacon's avatar
      Merge branch 'for-next/misc' into for-next/core · 7a7f6045
      Will Deacon authored
      * for-next/misc:
        arm64: simplify arch_static_branch/_jump function
        arm64: Add the arm64.no32bit_el0 command line option
        arm64: defer clearing DAIF.D
        arm64: assembler: update stale comment for disable_step_tsk
        arm64/sysreg: Update PIE permission encodings
        arm64: Add Neoverse-V2 part
        arm64: Remove unnecessary irqflags alternative.h include
      7a7f6045
    • Will Deacon's avatar
      Merge branch 'for-next/kbuild' into for-next/core · d4ea881f
      Will Deacon authored
      * for-next/kbuild:
        arm64: boot: Support Flat Image Tree
        arm64: Add BOOT_TARGETS variable
      d4ea881f
    • Will Deacon's avatar
      Merge branch 'for-next/acpi' into for-next/core · b2b7cc6d
      Will Deacon authored
      * for-next/acpi:
        arm64: acpi: Honour firmware_signature field of FACS, if it exists
        ACPICA: Detect FACS even for hardware reduced platforms
      b2b7cc6d
  2. 03 May, 2024 2 commits
  3. 28 Apr, 2024 3 commits
    • Mark Rutland's avatar
      arm64: defer clearing DAIF.D · 080297be
      Mark Rutland authored
      For historical reasons we unmask debug exceptions in __cpu_setup(), but
      it's not necessary to unmask debug exceptions this early in the
      boot/idle entry paths. It would be better to unmask debug exceptions
      later in C code as this simplifies the current code and will make it
      easier to rework exception masking logic to handle non-DAIF bits in
      future (e.g. PSTATE.{ALLINT,PM}).
      
      We started clearing DAIF.D in __cpu_setup() in commit:
      
        2ce39ad1 ("arm64: debug: unmask PSTATE.D earlier")
      
      At the time, we needed to ensure that DAIF.D was clear on the primary
      CPU before scheduling and preemption were possible, and chose to do this
      in __cpu_setup() so that this occurred in the same place for primary and
      secondary CPUs. As we cannot handle debug exceptions this early, we
      placed an ISB between initializing MDSCR_EL1 and clearing DAIF.D so that
      no exceptions should be triggered.
      
      Subsequently we rewrote the return-from-{idle,suspend} paths to use
      __cpu_setup() in commit:
      
        cabe1c81 ("arm64: Change cpu_resume() to enable mmu early then access sleep_sp by va")
      
      ... which allowed for earlier use of the MMU and had the desirable
      property of using the same code to reset the CPU in the cold and warm
      boot paths. This introduced a bug: DAIF.D was clear while
      cpu_do_resume() restored MDSCR_EL1 and other control registers (e.g.
      breakpoint/watchpoint control/value registers), and so we could
      unexpectedly take debug exceptions.
      
      We fixed that in commit:
      
        744c6c37 ("arm64: kernel: Fix unmasked debug exceptions when restoring mdscr_el1")
      
      ... by having cpu_do_resume() use the `disable_dbg` macro to set DAIF.D
      before restoring MDSCR_EL1 and other control registers. This relies on
      DAIF.D being subsequently cleared again in cpu_resume().
      
      Subsequently we reworked DAIF masking in commit:
      
        0fbeb318 ("arm64: explicitly mask all exceptions")
      
      ... where we began enforcing a policy that DAIF.D being set implies all
      other DAIF bits are set, and so e.g. we cannot take an IRQ while DAIF.D
      is set. As part of this the use of `disable_dbg` in cpu_resume() was
      replaced with `disable_daif` for consistency with the rest of the
      kernel.
      
      These days, there's no need to clear DAIF.D early within __cpu_setup():
      
      * setup_arch() clears DAIF.DA before scheduling and preemption are
        possible on the primary CPU, avoiding the problem we we originally
        trying to work around.
      
        Note: DAIF.IF get cleared later when interrupts are enabled for the
        first time.
      
      * secondary_start_kernel() clears all DAIF bits before scheduling and
        preemption are possible on secondary CPUs.
      
        Note: with pseudo-NMI, the PMR is initialized here before any DAIF
        bits are cleared. Similar will be necessary for the architectural NMI.
      
      * cpu_suspend() restores all DAIF bits when returning from idle,
        ensuring that we don't unexpectedly leave DAIF.D clear or set.
      
        Note: with pseudo-NMI, the PMR is initialized here before DAIF is
        cleared. Similar will be necessary for the architectural NMI.
      
      This patch removes the unmasking of debug exceptions from __cpu_setup(),
      relying on the above locations to initialize DAIF. This allows some
      other cleanups:
      
      * It is no longer necessary for cpu_resume() to explicitly mask debug
        (or other) exceptions, as it is always called with all DAIF bits set.
        Thus we drop the use of `disable_daif`.
      
      * The `enable_dbg` macro is no longer used, and so is dropped.
      
      * It is no longer necessary to have an ISB immediately after
        initializing MDSCR_EL1 in __cpu_setup(), and we can revert to relying
        on the context synchronization that occurs when the MMU is enabled
        between __cpu_setup() and code which clears DAIF.D
      
      Comments are added to setup_arch() and secondary_start_kernel() to
      explain the initial unmasking of the DAIF bits.
      Signed-off-by: default avatarMark Rutland <mark.rutland@arm.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Mark Brown <broonie@kernel.org>
      Cc: Will Deacon <will@kernel.org>
      Link: https://lore.kernel.org/r/20240422113523.4070414-3-mark.rutland@arm.comSigned-off-by: default avatarWill Deacon <will@kernel.org>
      080297be
    • Mark Rutland's avatar
      arm64: assembler: update stale comment for disable_step_tsk · 3a2d2ca4
      Mark Rutland authored
      A comment in the disable_step_tsk macro refers to synchronising with
      enable_dbg, as historically the entry used enable_dbg to unmask debug
      exceptions after disabling single-stepping.
      
      These days the unmasking happens in entry-common.c via
      local_daif_restore() or local_daif_inherit(), so the comment is stale.
      This logic is likely to chang in future, so it would be best to avoid
      referring to those macros specifically.
      
      Update the comment to take this into account, and describe it in terms
      of clearing DAIF.D so that it doesn't macro where this logic lives nor
      what it is called.
      
      There should be no functional change as a result of this patch.
      Signed-off-by: default avatarMark Rutland <mark.rutland@arm.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Mark Brown <broonie@kernel.org>
      Cc: Will Deacon <will@kernel.org>
      Reviewed-by: default avatarMark Brown <broonie@kernel.org>
      Link: https://lore.kernel.org/r/20240422113523.4070414-2-mark.rutland@arm.comSigned-off-by: default avatarWill Deacon <will@kernel.org>
      3a2d2ca4
    • Shiqi Liu's avatar
      arm64/sysreg: Update PIE permission encodings · 12d712dc
      Shiqi Liu authored
      Fix left shift overflow issue when the parameter idx is greater than or
      equal to 8 in the calculation of perm in PIRx_ELx_PERM macro.
      
      Fix this by modifying the encoding to use a long integer type.
      Signed-off-by: default avatarShiqi Liu <shiqiliu@hust.edu.cn>
      Acked-by: default avatarMarc Zyngier <maz@kernel.org>
      Reviewed-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      Link: https://lore.kernel.org/r/20240421063328.29710-1-shiqiliu@hust.edu.cnSigned-off-by: default avatarWill Deacon <will@kernel.org>
      12d712dc
  4. 19 Apr, 2024 1 commit
  5. 18 Apr, 2024 2 commits
  6. 12 Apr, 2024 2 commits
  7. 10 Apr, 2024 1 commit
  8. 07 Apr, 2024 4 commits
  9. 06 Apr, 2024 13 commits
  10. 05 Apr, 2024 9 commits
    • Linus Torvalds's avatar
      Merge tag 'io_uring-6.9-20240405' of git://git.kernel.dk/linux · 4f72ed49
      Linus Torvalds authored
      Pull io_uring fixes from Jens Axboe:
      
       - Backport of some fixes that came up during development of the 6.10
         io_uring patches. This includes some kbuf cleanups and reference
         fixes.
      
       - Disable multishot read if we don't have NOWAIT support on the target
      
       - Fix for a dependency issue with workqueue flushing
      
      * tag 'io_uring-6.9-20240405' of git://git.kernel.dk/linux:
        io_uring/kbuf: hold io_buffer_list reference over mmap
        io_uring/kbuf: protect io_buffer_list teardown with a reference
        io_uring/kbuf: get rid of bl->is_ready
        io_uring/kbuf: get rid of lower BGID lists
        io_uring: use private workqueue for exit work
        io_uring: disable io-wq execution of multishot NOWAIT requests
        io_uring/rw: don't allow multishot reads without NOWAIT support
      4f72ed49
    • Linus Torvalds's avatar
      Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · 4de2ff26
      Linus Torvalds authored
      Pull SCSI fixes from James Bottomley:
       "The most important is the libsas fix, which is a problem for DMA to a
        kmalloc'd structure too small causing cache line interference. The
        other fixes (all in drivers) are mostly for allocation length fixes,
        error leg unwinding, suspend races and a missing retry"
      
      * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
        scsi: ufs: core: Fix MCQ mode dev command timeout
        scsi: libsas: Align SMP request allocation to ARCH_DMA_MINALIGN
        scsi: sd: Unregister device if device_add_disk() failed in sd_probe()
        scsi: ufs: core: WLUN suspend dev/link state error recovery
        scsi: mylex: Fix sysfs buffer lengths
      4de2ff26
    • Linus Torvalds's avatar
      Merge tag 'devicetree-fixes-for-6.9-1' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux · 84985eb2
      Linus Torvalds authored
      Pull devicetree fixes from Rob Herring:
      
       - Fix NIOS2 boot with external DTB
      
       - Add missing synchronization needed between fw_devlink and DT overlay
         removals
      
       - Fix some unit-address regex's to be hex only
      
       - Drop some 10+ year old "unstable binding" statements
      
       - Add new SoCs to QCom UFS binding
      
       - Add TPM bindings to TPM maintainers
      
      * tag 'devicetree-fixes-for-6.9-1' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux:
        nios2: Only use built-in devicetree blob if configured to do so
        dt-bindings: timer: narrow regex for unit address to hex numbers
        dt-bindings: soc: fsl: narrow regex for unit address to hex numbers
        dt-bindings: remoteproc: ti,davinci: remove unstable remark
        dt-bindings: clock: ti: remove unstable remark
        dt-bindings: clock: keystone: remove unstable remark
        of: module: prevent NULL pointer dereference in vsnprintf()
        dt-bindings: ufs: qcom: document SM6125 UFS
        dt-bindings: ufs: qcom: document SC7180 UFS
        dt-bindings: ufs: qcom: document SC8180X UFS
        of: dynamic: Synchronize of_changeset_destroy() with the devlink removals
        driver core: Introduce device_link_wait_removal()
        docs: dt-bindings: add missing address/size-cells to example
        MAINTAINERS: Add TPM DT bindings to TPM maintainers
      84985eb2
    • Linus Torvalds's avatar
      Merge tag 'mm-hotfixes-stable-2024-04-05-11-30' of... · af709adf
      Linus Torvalds authored
      Merge tag 'mm-hotfixes-stable-2024-04-05-11-30' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
      
      Pull misc fixes from Andrew Morton:
       "8 hotfixes, 3 are cc:stable
      
        There are a couple of fixups for this cycle's vmalloc changes and one
        for the stackdepot changes. And a fix for a very old x86 PAT issue
        which can cause a warning splat"
      
      * tag 'mm-hotfixes-stable-2024-04-05-11-30' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm:
        stackdepot: rename pool_index to pool_index_plus_1
        x86/mm/pat: fix VM_PAT handling in COW mappings
        MAINTAINERS: change vmware.com addresses to broadcom.com
        selftests/mm: include strings.h for ffsl
        mm: vmalloc: fix lockdep warning
        mm: vmalloc: bail out early in find_vmap_area() if vmap is not init
        init: open output files from cpio unpacking with O_LARGEFILE
        mm/secretmem: fix GUP-fast succeeding on secretmem folios
      af709adf
    • Linus Torvalds's avatar
      Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux · c7830236
      Linus Torvalds authored
      Pull arm64 fix from Catalin Marinas:
       "arm64/ptrace fix to use the correct SVE layout based on the saved
        floating point state rather than the TIF_SVE flag. The latter may be
        left on during syscalls even if the SVE state is discarded"
      
      * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
        arm64/ptrace: Use saved floating point state type to determine SVE layout
      c7830236
    • Linus Torvalds's avatar
      Merge tag 'riscv-for-linus-6.9-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux · 261b8e89
      Linus Torvalds authored
      Pull RISC-V fixes from Palmer Dabbelt:
      
       - A fix for an __{get,put}_kernel_nofault to avoid an uninitialized
         value causing spurious failures
      
       - compat_vdso.so.dbg is now installed to the standard install location
      
       - A fix to avoid initializing PERF_SAMPLE_BRANCH_*-related events, as
         they aren't supported and will just later fail
      
       - A fix to make AT_VECTOR_SIZE_ARCH correct now that we're providing
         AT_MINSIGSTKSZ
      
       - pgprot_nx() is now implemented, which fixes vmap W^X protection
      
       - A fix for the vector save/restore code, which at least manifests as
         corrupted vector state when a signal is taken
      
       - A fix for a race condition in instruction patching
      
       - A fix to avoid leaking the kernel-mode GP to userspace, which is a
         kernel pointer leak that can be used to defeat KASLR in various ways
      
       - A handful of smaller fixes to build warnings, an overzealous printk,
         and some missing tracing annotations
      
      * tag 'riscv-for-linus-6.9-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
        riscv: process: Fix kernel gp leakage
        riscv: Disable preemption when using patch_map()
        riscv: Fix warning by declaring arch_cpu_idle() as noinstr
        riscv: use KERN_INFO in do_trap
        riscv: Fix vector state restore in rt_sigreturn()
        riscv: mm: implement pgprot_nx
        riscv: compat_vdso: align VDSOAS build log
        RISC-V: Update AT_VECTOR_SIZE_ARCH for new AT_MINSIGSTKSZ
        riscv: Mark __se_sys_* functions __used
        drivers/perf: riscv: Disable PERF_SAMPLE_BRANCH_* while not supported
        riscv: compat_vdso: install compat_vdso.so.dbg to /lib/modules/*/vdso/
        riscv: hwprobe: do not produce frtace relocation
        riscv: Fix spurious errors from __get/put_kernel_nofault
        riscv: mm: Fix prototype to avoid discarding const
      261b8e89
    • Linus Torvalds's avatar
      Merge tag 's390-6.9-3' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux · 50094473
      Linus Torvalds authored
      Pull s390 fixes from Alexander Gordeev:
      
       - Fix missing NULL pointer check when determining guest/host fault
      
       - Mark all functions in asm/atomic_ops.h, asm/atomic.h and
         asm/preempt.h as __always_inline to avoid unwanted instrumentation
      
       - Fix removal of a Processor Activity Instrumentation (PAI) sampling
         event in PMU device driver
      
       - Align system call table on 8 bytes
      
      * tag 's390-6.9-3' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
        s390/entry: align system call table on 8 bytes
        s390/pai: fix sampling event removal for PMU device driver
        s390/preempt: mark all functions __always_inline
        s390/atomic: mark all functions __always_inline
        s390/mm: fix NULL pointer dereference
      50094473
    • Linus Torvalds's avatar
      Merge tag 'pm-6.9-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 2f9fd9e4
      Linus Torvalds authored
      Pull power management fix from Rafael Wysocki:
       "Fix a recent Energy Model change that went against a recent scheduler
        change made independently (Vincent Guittot)"
      
      * tag 'pm-6.9-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        PM: EM: fix wrong utilization estimation in em_cpu_energy()
      2f9fd9e4
    • Linus Torvalds's avatar
      Merge tag 'thermal-6.9-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · b21defcb
      Linus Torvalds authored
      Pull thermal control fixes from Rafael Wysocki:
       "These fix two power allocator thermal governor issues and an ACPI
        thermal driver regression that all were introduced during the 6.8
        development cycle.
      
        Specifics:
      
         - Allow the power allocator thermal governor to bind to a thermal
           zone without cooling devices and/or without trip points (Nikita
           Travkin)
      
         - Make the ACPI thermal driver register a tripless thermal zone when
           it cannot find any usable trip points instead of returning an error
           from acpi_thermal_add() (Stephen Horvath)"
      
      * tag 'thermal-6.9-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        thermal: gov_power_allocator: Allow binding without trip points
        thermal: gov_power_allocator: Allow binding without cooling devices
        ACPI: thermal: Register thermal zones without valid trip points
      b21defcb