]> Git Repo - linux.git/commitdiff
Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
authorLinus Torvalds <[email protected]>
Fri, 19 Jan 2024 21:36:15 +0000 (13:36 -0800)
committerLinus Torvalds <[email protected]>
Fri, 19 Jan 2024 21:36:15 +0000 (13:36 -0800)
Pull arm64 fixes from Will Deacon:
 "I think the main one is fixing the dynamic SCS patching when full LTO
  is enabled (clang was silently getting this horribly wrong), but it's
  all good stuff.

  Rob just pointed out that the fix to the workaround for erratum
  #2966298 might not be necessary, but in the worst case it's harmless
  and since the official description leaves a little to be desired here,
  I've left it in.

  Summary:

   - Fix shadow call stack patching with LTO=full

   - Fix voluntary preemption of the FPSIMD registers from assembly code

   - Fix workaround for A520 CPU erratum #2966298 and extend to A510

   - Fix SME issues that resulted in corruption of the register state

   - Minor fixes (missing includes, formatting)"

* tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
  arm64: Fix silcon-errata.rst formatting
  arm64/sme: Always exit sme_alloc() early with existing storage
  arm64/fpsimd: Remove spurious check for SVE support
  arm64/ptrace: Don't flush ZA/ZT storage when writing ZA via ptrace
  arm64: entry: simplify kernel_exit logic
  arm64: entry: fix ARM64_WORKAROUND_SPECULATIVE_UNPRIV_LOAD
  arm64: errata: Add Cortex-A510 speculative unprivileged load workaround
  arm64: Rename ARM64_WORKAROUND_2966298
  arm64: fpsimd: Bring cond_yield asm macro in line with new rules
  arm64: scs: Work around full LTO issue with dynamic SCS
  arm64: irq: include <linux/cpumask.h>

1  2 
Documentation/arch/arm64/silicon-errata.rst
arch/arm64/Kconfig
arch/arm64/kernel/ptrace.c

index bfdf236e2af3d4ca5dc3e6330ea6737704d43329,b30bd6abffbe958788768ea616c2c75d21d3ec7d..e8c2ce1f9df68df5976b7cc536d3f48c0501ba4b
@@@ -71,6 -71,8 +71,8 @@@ stable kernels
  +----------------+-----------------+-----------------+-----------------------------+
  | ARM            | Cortex-A510     | #2658417        | ARM64_ERRATUM_2658417       |
  +----------------+-----------------+-----------------+-----------------------------+
+ | ARM            | Cortex-A510     | #3117295        | ARM64_ERRATUM_3117295       |
+ +----------------+-----------------+-----------------+-----------------------------+
  | ARM            | Cortex-A520     | #2966298        | ARM64_ERRATUM_2966298       |
  +----------------+-----------------+-----------------+-----------------------------+
  | ARM            | Cortex-A53      | #826319         | ARM64_ERRATUM_826319        |
  +----------------+-----------------+-----------------+-----------------------------+
  | ARM            | Cortex-A76      | #1463225        | ARM64_ERRATUM_1463225       |
  +----------------+-----------------+-----------------+-----------------------------+
 +| ARM            | Cortex-A76      | #1490853        | N/A                         |
 ++----------------+-----------------+-----------------+-----------------------------+
 +| ARM            | Cortex-A77      | #1491015        | N/A                         |
 ++----------------+-----------------+-----------------+-----------------------------+
  | ARM            | Cortex-A77      | #1508412        | ARM64_ERRATUM_1508412       |
  +----------------+-----------------+-----------------+-----------------------------+
  | ARM            | Cortex-A710     | #2119858        | ARM64_ERRATUM_2119858       |
  +----------------+-----------------+-----------------+-----------------------------+
  | ARM            | Cortex-A715     | #2645198        | ARM64_ERRATUM_2645198       |
  +----------------+-----------------+-----------------+-----------------------------+
 +| ARM            | Cortex-X1       | #1502854        | N/A                         |
 ++----------------+-----------------+-----------------+-----------------------------+
  | ARM            | Cortex-X2       | #2119858        | ARM64_ERRATUM_2119858       |
  +----------------+-----------------+-----------------+-----------------------------+
  | ARM            | Cortex-X2       | #2224489        | ARM64_ERRATUM_2224489       |
  +----------------+-----------------+-----------------+-----------------------------+
  | ARM            | Neoverse-N1     | #1349291        | N/A                         |
  +----------------+-----------------+-----------------+-----------------------------+
 +| ARM            | Neoverse-N1     | #1490853        | N/A                         |
 ++----------------+-----------------+-----------------+-----------------------------+
  | ARM            | Neoverse-N1     | #1542419        | ARM64_ERRATUM_1542419       |
  +----------------+-----------------+-----------------+-----------------------------+
  | ARM            | Neoverse-N2     | #2139208        | ARM64_ERRATUM_2139208       |
  +----------------+-----------------+-----------------+-----------------------------+
  | ARM            | Neoverse-N2     | #2253138        | ARM64_ERRATUM_2253138       |
  +----------------+-----------------+-----------------+-----------------------------+
 +| ARM            | Neoverse-V1     | #1619801        | N/A                         |
 ++----------------+-----------------+-----------------+-----------------------------+
  | ARM            | MMU-500         | #841119,826419  | N/A                         |
  +----------------+-----------------+-----------------+-----------------------------+
  | ARM            | MMU-600         | #1076982,1209401| N/A                         |
  +----------------+-----------------+-----------------+-----------------------------+
  | Rockchip       | RK3588          | #3588001        | ROCKCHIP_ERRATUM_3588001    |
  +----------------+-----------------+-----------------+-----------------------------+
  +----------------+-----------------+-----------------+-----------------------------+
  | Fujitsu        | A64FX           | E#010001        | FUJITSU_ERRATUM_010001      |
  +----------------+-----------------+-----------------+-----------------------------+
  +----------------+-----------------+-----------------+-----------------------------+
  | ASR            | ASR8601         | #8601001        | N/A                         |
  +----------------+-----------------+-----------------+-----------------------------+
diff --combined arch/arm64/Kconfig
index ea01a2c43efaf6fd1fd1d19529d40279c4c91102,bfd275249366600e77b002d3b6f996dfaa53b1e9..aa7c1d435139684d7b56f96f3f93945d331d64d6
@@@ -36,7 -36,6 +36,7 @@@ config ARM6
        select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE
        select ARCH_HAS_PTE_DEVMAP
        select ARCH_HAS_PTE_SPECIAL
 +      select ARCH_HAS_HW_PTE_YOUNG
        select ARCH_HAS_SETUP_DMA_OPS
        select ARCH_HAS_SET_DIRECT_MAP
        select ARCH_HAS_SET_MEMORY
        select GENERIC_ARCH_TOPOLOGY
        select GENERIC_CLOCKEVENTS_BROADCAST
        select GENERIC_CPU_AUTOPROBE
 +      select GENERIC_CPU_DEVICES
        select GENERIC_CPU_VULNERABILITIES
        select GENERIC_EARLY_IOREMAP
        select GENERIC_IDLE_POLL_SETUP
        select HAVE_MOVE_PUD
        select HAVE_PCI
        select HAVE_ACPI_APEI if (ACPI && EFI)
 -      select HAVE_ALIGNED_STRUCT_PAGE if SLUB
 +      select HAVE_ALIGNED_STRUCT_PAGE
        select HAVE_ARCH_AUDITSYSCALL
        select HAVE_ARCH_BITREVERSE
        select HAVE_ARCH_COMPILER_H
@@@ -1039,8 -1037,12 +1039,12 @@@ config ARM64_ERRATUM_264519
  
          If unsure, say Y.
  
+ config ARM64_WORKAROUND_SPECULATIVE_UNPRIV_LOAD
+       bool
  config ARM64_ERRATUM_2966298
        bool "Cortex-A520: 2966298: workaround for speculatively executed unprivileged load"
+       select ARM64_WORKAROUND_SPECULATIVE_UNPRIV_LOAD
        default y
        help
          This option adds the workaround for ARM Cortex-A520 erratum 2966298.
  
          If unsure, say Y.
  
+ config ARM64_ERRATUM_3117295
+       bool "Cortex-A510: 3117295: workaround for speculatively executed unprivileged load"
+       select ARM64_WORKAROUND_SPECULATIVE_UNPRIV_LOAD
+       default y
+       help
+         This option adds the workaround for ARM Cortex-A510 erratum 3117295.
+         On an affected Cortex-A510 core, a speculatively executed unprivileged
+         load might leak data from a privileged level via a cache side channel.
+         Work around this problem by executing a TLBI before returning to EL0.
+         If unsure, say Y.
  config CAVIUM_ERRATUM_22375
        bool "Cavium erratum 22375, 24313"
        default y
@@@ -1521,15 -1537,15 +1539,15 @@@ config XE
  
  # include/linux/mmzone.h requires the following to be true:
  #
 -#   MAX_ORDER + PAGE_SHIFT <= SECTION_SIZE_BITS
 +#   MAX_PAGE_ORDER + PAGE_SHIFT <= SECTION_SIZE_BITS
  #
 -# so the maximum value of MAX_ORDER is SECTION_SIZE_BITS - PAGE_SHIFT:
 +# so the maximum value of MAX_PAGE_ORDER is SECTION_SIZE_BITS - PAGE_SHIFT:
  #
 -#     | SECTION_SIZE_BITS |  PAGE_SHIFT  |  max MAX_ORDER  |  default MAX_ORDER |
 -# ----+-------------------+--------------+-----------------+--------------------+
 -# 4K  |       27          |      12      |       15        |         10         |
 -# 16K |       27          |      14      |       13        |         11         |
 -# 64K |       29          |      16      |       13        |         13         |
 +#     | SECTION_SIZE_BITS |  PAGE_SHIFT  |  max MAX_PAGE_ORDER  |  default MAX_PAGE_ORDER |
 +# ----+-------------------+--------------+----------------------+-------------------------+
 +# 4K  |       27          |      12      |       15             |         10              |
 +# 16K |       27          |      14      |       13             |         11              |
 +# 64K |       29          |      16      |       13             |         13              |
  config ARCH_FORCE_MAX_ORDER
        int
        default "13" if ARM64_64K_PAGES
        default "10"
        help
          The kernel page allocator limits the size of maximal physically
 -        contiguous allocations. The limit is called MAX_ORDER and it
 +        contiguous allocations. The limit is called MAX_PAGE_ORDER and it
          defines the maximal power of two of number of pages that can be
          allocated as a single contiguous block. This option allows
          overriding the default setting when ability to allocate very
          large blocks of physically contiguous memory is required.
  
          The maximal size of allocation cannot exceed the size of the
 -        section, so the value of MAX_ORDER should satisfy
 +        section, so the value of MAX_PAGE_ORDER should satisfy
  
 -          MAX_ORDER + PAGE_SHIFT <= SECTION_SIZE_BITS
 +          MAX_PAGE_ORDER + PAGE_SHIFT <= SECTION_SIZE_BITS
  
          Don't change if unsure.
  
index 09bb7fc7d3c2513b3bc8cb2e5545f8c31935e30a,b3f64144b5cd9f436ad41bf940ae45dc8a52b9f4..dc6cf0e37194e428519d7d58524ad0f624f4bebb
@@@ -28,7 -28,6 +28,7 @@@
  #include <linux/hw_breakpoint.h>
  #include <linux/regset.h>
  #include <linux/elf.h>
 +#include <linux/rseq.h>
  
  #include <asm/compat.h>
  #include <asm/cpufeature.h>
@@@ -1108,12 -1107,13 +1108,13 @@@ static int za_set(struct task_struct *t
                }
        }
  
-       /* Allocate/reinit ZA storage */
-       sme_alloc(target, true);
-       if (!target->thread.sme_state) {
-               ret = -ENOMEM;
-               goto out;
-       }
+       /*
+        * Only flush the storage if PSTATE.ZA was not already set,
+        * otherwise preserve any existing data.
+        */
+       sme_alloc(target, !thread_za_enabled(&target->thread));
+       if (!target->thread.sme_state)
+               return -ENOMEM;
  
        /* If there is no data then disable ZA */
        if (!count) {
This page took 0.073855 seconds and 4 git commands to generate.