Skip to content

Commit 45bf4bc

Browse files
committed
Merge tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
Pull arm64 updates from Will Deacon: "There's a little less than normal, probably due to LPC & Christmas/New Year meaning that a few series weren't quite ready or reviewed in time. It's still useful across the board, despite the only real feature being support for the LS64 feature enabling 64-byte atomic accesses to endpoints that support it. ACPI: - Add interrupt signalling support to the AGDI handler - Add Catalin and myself to the arm64 ACPI MAINTAINERS entry CPU features: - Drop Kconfig options for PAN and LSE (these are detected at runtime) - Add support for 64-byte single-copy atomic instructions (LS64/LS64V) - Reduce MTE overhead when executing in the kernel on Ampere CPUs - Ensure POR_EL0 value exposed via ptrace is up-to-date - Fix error handling on GCS allocation failure CPU frequency: - Add CPU hotplug support to the FIE setup in the AMU driver Entry code: - Minor optimisations and cleanups to the syscall entry path - Preparatory rework for moving to the generic syscall entry code Hardware errata: - Work around Spectre-BHB on TSV110 processors - Work around broken CMO propagation on some systems with the SI-L1 interconnect Miscellaneous: - Disable branch profiling for arch/arm64/ to avoid issues with noinstr - Minor fixes and cleanups (kexec + ubsan, WARN_ONCE() instead of WARN_ON(), reduction of boolean expression) - Fix custom __READ_ONCE() implementation for LTO builds when operating on non-atomic types Perf and PMUs: - Support for CMN-600AE - Be stricter about supported hardware in the CMN driver - Support for DSU-110 and DSU-120 - Support for the cycles event in the DSU driver (alongside the dedicated cycles counter) - Use IRQF_NO_THREAD instead of IRQF_ONESHOT in the cxlpmu driver - Use !bitmap_empty() as a faster alternative to bitmap_weight() - Fix SPE error handling when failing to resume profiling Selftests: - Add support for the FORCE_TARGETS option to the arm64 kselftests - Avoid nolibc-specific my_syscall() function - Add basic test for the LS64 HWCAP - Extend fp-pidbench to cover additional workload patterns" * tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: (43 commits) perf/arm-cmn: Reject unsupported hardware configurations perf: arm_spe: Properly set hw.state on failures arm64/gcs: Fix error handling in arch_set_shadow_stack_status() arm64: Fix non-atomic __READ_ONCE() with CONFIG_LTO=y arm64: poe: fix stale POR_EL0 values for ptrace kselftest/arm64: Raise default number of loops in fp-pidbench kselftest/arm64: Add a no-SVE loop after SVE in fp-pidbench perf/cxlpmu: Replace IRQF_ONESHOT with IRQF_NO_THREAD arm64: mte: Set TCMA1 whenever MTE is present in the kernel arm64/ptrace: Return early for ptrace_report_syscall_entry() error arm64/ptrace: Split report_syscall() arm64: Remove unused _TIF_WORK_MASK kselftest/arm64: Add missing file in .gitignore arm64: errata: Workaround for SI L1 downstream coherency issue kselftest/arm64: Add HWCAP test for FEAT_LS64 arm64: Add support for FEAT_{LS64, LS64_V} KVM: arm64: Enable FEAT_{LS64, LS64_V} in the supported guest arm64: Provide basic EL2 setup for FEAT_{LS64, LS64_V} usage at EL0/1 KVM: arm64: Handle DABT caused by LS64* instructions on unsupported memory KVM: arm64: Add documentation for KVM_EXIT_ARM_LDST64B ...
2 parents 9f722cb + 36c0de0 commit 45bf4bc

58 files changed

Lines changed: 628 additions & 216 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Documentation/arch/arm64/booting.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,18 @@ Before jumping into the kernel, the following conditions must be met:
556556

557557
- MDCR_EL3.TPM (bit 6) must be initialized to 0b0
558558

559+
For CPUs with support for 64-byte loads and stores without status (FEAT_LS64):
560+
561+
- If the kernel is entered at EL1 and EL2 is present:
562+
563+
- HCRX_EL2.EnALS (bit 1) must be initialised to 0b1.
564+
565+
For CPUs with support for 64-byte stores with status (FEAT_LS64_V):
566+
567+
- If the kernel is entered at EL1 and EL2 is present:
568+
569+
- HCRX_EL2.EnASR (bit 2) must be initialised to 0b1.
570+
559571
The requirements described above for CPU mode, caches, MMUs, architected
560572
timers, coherency and system registers apply to all CPUs. All CPUs must
561573
enter the kernel in the same exception level. Where the values documented

Documentation/arch/arm64/elf_hwcaps.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,13 @@ HWCAP3_MTE_STORE_ONLY
444444
HWCAP3_LSFE
445445
Functionality implied by ID_AA64ISAR3_EL1.LSFE == 0b0001
446446

447+
HWCAP3_LS64
448+
Functionality implied by ID_AA64ISAR1_EL1.LS64 == 0b0001. Note that
449+
the function of instruction ld64b/st64b requires support by CPU, system
450+
and target (device) memory location and HWCAP3_LS64 implies the support
451+
of CPU. User should only use ld64b/st64b on supported target (device)
452+
memory location, otherwise fallback to the non-atomic alternatives.
453+
447454

448455
4. Unused AT_HWCAP bits
449456
-----------------------

Documentation/arch/arm64/silicon-errata.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ stable kernels.
212212
+----------------+-----------------+-----------------+-----------------------------+
213213
| ARM | GIC-700 | #2941627 | ARM64_ERRATUM_2941627 |
214214
+----------------+-----------------+-----------------+-----------------------------+
215+
| ARM | SI L1 | #4311569 | ARM64_ERRATUM_4311569 |
215216
+----------------+-----------------+-----------------+-----------------------------+
216217
| Broadcom | Brahma-B53 | N/A | ARM64_ERRATUM_845719 |
217218
+----------------+-----------------+-----------------+-----------------------------+

Documentation/virt/kvm/api.rst

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1303,12 +1303,13 @@ userspace, for example because of missing instruction syndrome decode
13031303
information or because there is no device mapped at the accessed IPA, then
13041304
userspace can ask the kernel to inject an external abort using the address
13051305
from the exiting fault on the VCPU. It is a programming error to set
1306-
ext_dabt_pending after an exit which was not either KVM_EXIT_MMIO or
1307-
KVM_EXIT_ARM_NISV. This feature is only available if the system supports
1308-
KVM_CAP_ARM_INJECT_EXT_DABT. This is a helper which provides commonality in
1309-
how userspace reports accesses for the above cases to guests, across different
1310-
userspace implementations. Nevertheless, userspace can still emulate all Arm
1311-
exceptions by manipulating individual registers using the KVM_SET_ONE_REG API.
1306+
ext_dabt_pending after an exit which was not either KVM_EXIT_MMIO,
1307+
KVM_EXIT_ARM_NISV, or KVM_EXIT_ARM_LDST64B. This feature is only available if
1308+
the system supports KVM_CAP_ARM_INJECT_EXT_DABT. This is a helper which
1309+
provides commonality in how userspace reports accesses for the above cases to
1310+
guests, across different userspace implementations. Nevertheless, userspace
1311+
can still emulate all Arm exceptions by manipulating individual registers
1312+
using the KVM_SET_ONE_REG API.
13121313

13131314
See KVM_GET_VCPU_EVENTS for the data structure.
13141315

@@ -7050,12 +7051,14 @@ in send_page or recv a buffer to recv_page).
70507051

70517052
::
70527053

7053-
/* KVM_EXIT_ARM_NISV */
7054+
/* KVM_EXIT_ARM_NISV / KVM_EXIT_ARM_LDST64B */
70547055
struct {
70557056
__u64 esr_iss;
70567057
__u64 fault_ipa;
70577058
} arm_nisv;
70587059

7060+
- KVM_EXIT_ARM_NISV:
7061+
70597062
Used on arm64 systems. If a guest accesses memory not in a memslot,
70607063
KVM will typically return to userspace and ask it to do MMIO emulation on its
70617064
behalf. However, for certain classes of instructions, no instruction decode
@@ -7089,6 +7092,32 @@ Note that although KVM_CAP_ARM_NISV_TO_USER will be reported if
70897092
queried outside of a protected VM context, the feature will not be
70907093
exposed if queried on a protected VM file descriptor.
70917094

7095+
- KVM_EXIT_ARM_LDST64B:
7096+
7097+
Used on arm64 systems. When a guest using a LD64B, ST64B, ST64BV, ST64BV0,
7098+
outside of a memslot, KVM will return to userspace with KVM_EXIT_ARM_LDST64B,
7099+
exposing the relevant ESR_EL2 information and faulting IPA, similarly to
7100+
KVM_EXIT_ARM_NISV.
7101+
7102+
Userspace is supposed to fully emulate the instructions, which includes:
7103+
7104+
- fetch of the operands for a store, including ACCDATA_EL1 in the case
7105+
of a ST64BV0 instruction
7106+
- deal with the endianness if the guest is big-endian
7107+
- emulate the access, including the delivery of an exception if the
7108+
access didn't succeed
7109+
- provide a return value in the case of ST64BV/ST64BV0
7110+
- return the data in the case of a load
7111+
- increment PC if the instruction was successfully executed
7112+
7113+
Note that there is no expectation of performance for this emulation, as it
7114+
involves a large number of interaction with the guest state. It is, however,
7115+
expected that the instruction's semantics are preserved, specially the
7116+
single-copy atomicity property of the 64 byte access.
7117+
7118+
This exit reason must be handled if userspace sets ID_AA64ISAR1_EL1.LS64 to a
7119+
non-zero value, indicating that FEAT_LS64* is enabled.
7120+
70927121
::
70937122

70947123
/* KVM_EXIT_X86_RDMSR / KVM_EXIT_X86_WRMSR */

MAINTAINERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,8 @@ ACPI FOR ARM64 (ACPI/arm64)
336336
M: Lorenzo Pieralisi <lpieralisi@kernel.org>
337337
M: Hanjun Guo <guohanjun@huawei.com>
338338
M: Sudeep Holla <sudeep.holla@kernel.org>
339+
M: Catalin Marinas <catalin.marinas@arm.com>
340+
M: Will Deacon <will@kernel.org>
339341
L: linux-acpi@vger.kernel.org
340342
L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
341343
S: Maintained

arch/arm/include/asm/syscall.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,6 @@ static inline void syscall_set_nr(struct task_struct *task,
9292
(nr & __NR_SYSCALL_MASK);
9393
}
9494

95-
#define SYSCALL_MAX_ARGS 7
96-
9795
static inline void syscall_get_arguments(struct task_struct *task,
9896
struct pt_regs *regs,
9997
unsigned long *args)

arch/arm64/Kbuild

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
# SPDX-License-Identifier: GPL-2.0-only
2+
3+
# Branch profiling isn't noinstr-safe
4+
subdir-ccflags-$(CONFIG_TRACE_BRANCH_PROFILING) += -DDISABLE_BRANCH_PROFILING
5+
26
obj-y += kernel/ mm/ net/
37
obj-$(CONFIG_KVM) += kvm/
48
obj-$(CONFIG_XEN) += xen/

arch/arm64/Kconfig

Lines changed: 19 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1155,6 +1155,25 @@ config ARM64_ERRATUM_3194386
11551155

11561156
If unsure, say Y.
11571157

1158+
config ARM64_ERRATUM_4311569
1159+
bool "SI L1: 4311569: workaround for premature CMO completion erratum"
1160+
default y
1161+
help
1162+
This option adds the workaround for ARM SI L1 erratum 4311569.
1163+
1164+
The erratum of SI L1 can cause an early response to a combined write
1165+
and cache maintenance operation (WR+CMO) before the operation is fully
1166+
completed to the Point of Serialization (POS).
1167+
This can result in a non-I/O coherent agent observing stale data,
1168+
potentially leading to system instability or incorrect behavior.
1169+
1170+
Enabling this option implements a software workaround by inserting a
1171+
second loop of Cache Maintenance Operation (CMO) immediately following the
1172+
end of function to do CMOs. This ensures that the data is correctly serialized
1173+
before the buffer is handed off to a non-coherent agent.
1174+
1175+
If unsure, say Y.
1176+
11581177
config CAVIUM_ERRATUM_22375
11591178
bool "Cavium erratum 22375, 24313"
11601179
default y
@@ -1680,7 +1699,6 @@ config MITIGATE_SPECTRE_BRANCH_HISTORY
16801699
config ARM64_SW_TTBR0_PAN
16811700
bool "Emulate Privileged Access Never using TTBR0_EL1 switching"
16821701
depends on !KCSAN
1683-
select ARM64_PAN
16841702
help
16851703
Enabling this option prevents the kernel from accessing
16861704
user-space memory directly by pointing TTBR0_EL1 to a reserved
@@ -1859,36 +1877,6 @@ config ARM64_HW_AFDBM
18591877
to work on pre-ARMv8.1 hardware and the performance impact is
18601878
minimal. If unsure, say Y.
18611879

1862-
config ARM64_PAN
1863-
bool "Enable support for Privileged Access Never (PAN)"
1864-
default y
1865-
help
1866-
Privileged Access Never (PAN; part of the ARMv8.1 Extensions)
1867-
prevents the kernel or hypervisor from accessing user-space (EL0)
1868-
memory directly.
1869-
1870-
Choosing this option will cause any unprotected (not using
1871-
copy_to_user et al) memory access to fail with a permission fault.
1872-
1873-
The feature is detected at runtime, and will remain as a 'nop'
1874-
instruction if the cpu does not implement the feature.
1875-
1876-
config ARM64_LSE_ATOMICS
1877-
bool
1878-
default ARM64_USE_LSE_ATOMICS
1879-
1880-
config ARM64_USE_LSE_ATOMICS
1881-
bool "Atomic instructions"
1882-
default y
1883-
help
1884-
As part of the Large System Extensions, ARMv8.1 introduces new
1885-
atomic instructions that are designed specifically to scale in
1886-
very large systems.
1887-
1888-
Say Y here to make use of these instructions for the in-kernel
1889-
atomic routines. This incurs a small overhead on CPUs that do
1890-
not support these instructions.
1891-
18921880
endmenu # "ARMv8.1 architectural features"
18931881

18941882
menu "ARMv8.2 architectural features"
@@ -2125,7 +2113,6 @@ config ARM64_MTE
21252113
depends on ARM64_AS_HAS_MTE && ARM64_TAGGED_ADDR_ABI
21262114
depends on AS_HAS_ARMV8_5
21272115
# Required for tag checking in the uaccess routines
2128-
select ARM64_PAN
21292116
select ARCH_HAS_SUBPAGE_FAULTS
21302117
select ARCH_USES_HIGH_VMA_FLAGS
21312118
select ARCH_USES_PG_ARCH_2
@@ -2157,7 +2144,6 @@ menu "ARMv8.7 architectural features"
21572144
config ARM64_EPAN
21582145
bool "Enable support for Enhanced Privileged Access Never (EPAN)"
21592146
default y
2160-
depends on ARM64_PAN
21612147
help
21622148
Enhanced Privileged Access Never (EPAN) allows Privileged
21632149
Access Never to be used with Execute-only mappings.

arch/arm64/include/asm/assembler.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,9 @@ alternative_endif
381381
.macro dcache_by_myline_op op, domain, start, end, linesz, tmp, fixup
382382
sub \tmp, \linesz, #1
383383
bic \start, \start, \tmp
384+
alternative_if ARM64_WORKAROUND_4311569
385+
mov \tmp, \start
386+
alternative_else_nop_endif
384387
.Ldcache_op\@:
385388
.ifc \op, cvau
386389
__dcache_op_workaround_clean_cache \op, \start
@@ -402,6 +405,13 @@ alternative_endif
402405
add \start, \start, \linesz
403406
cmp \start, \end
404407
b.lo .Ldcache_op\@
408+
alternative_if ARM64_WORKAROUND_4311569
409+
.ifnc \op, cvau
410+
mov \start, \tmp
411+
mov \tmp, xzr
412+
cbnz \start, .Ldcache_op\@
413+
.endif
414+
alternative_else_nop_endif
405415
dsb \domain
406416

407417
_cond_uaccess_extable .Ldcache_op\@, \fixup

arch/arm64/include/asm/cpucaps.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ cpucap_is_possible(const unsigned int cap)
1919
"cap must be < ARM64_NCAPS");
2020

2121
switch (cap) {
22-
case ARM64_HAS_PAN:
23-
return IS_ENABLED(CONFIG_ARM64_PAN);
2422
case ARM64_HAS_EPAN:
2523
return IS_ENABLED(CONFIG_ARM64_EPAN);
2624
case ARM64_SVE:

0 commit comments

Comments
 (0)