Skip to content

Commit 0c5ade7

Browse files
committed
Merge branches 'for-next/reorg-va-space', 'for-next/rust-for-arm64', 'for-next/misc', 'for-next/daif-cleanup', 'for-next/kselftest', 'for-next/documentation', 'for-next/sysreg' and 'for-next/dpisa', remote-tracking branch 'arm64/for-next/perf' into for-next/core
* arm64/for-next/perf: (39 commits) docs: perf: Fix build warning of hisi-pcie-pmu.rst perf: starfive: Only allow COMPILE_TEST for 64-bit architectures MAINTAINERS: Add entry for StarFive StarLink PMU docs: perf: Add description for StarFive's StarLink PMU dt-bindings: perf: starfive: Add JH8100 StarLink PMU perf: starfive: Add StarLink PMU support docs: perf: Update usage for target filter of hisi-pcie-pmu drivers/perf: hisi_pcie: Merge find_related_event() and get_event_idx() drivers/perf: hisi_pcie: Relax the check on related events drivers/perf: hisi_pcie: Check the target filter properly drivers/perf: hisi_pcie: Add more events for counting TLP bandwidth drivers/perf: hisi_pcie: Fix incorrect counting under metric mode drivers/perf: hisi_pcie: Introduce hisi_pcie_pmu_get_event_ctrl_val() drivers/perf: hisi_pcie: Rename hisi_pcie_pmu_{config,clear}_filter() drivers/perf: hisi: Enable HiSilicon Erratum 162700402 quirk for HIP09 perf/arm_cspmu: Add devicetree support dt-bindings/perf: Add Arm CoreSight PMU perf/arm_cspmu: Simplify counter reset perf/arm_cspmu: Simplify attribute groups perf/arm_cspmu: Simplify initialisation ... * for-next/reorg-va-space: : Reorganise the arm64 kernel VA space in preparation for LPA2 support : (52-bit VA/PA). arm64: kaslr: Adjust randomization range dynamically arm64: mm: Reclaim unused vmemmap region for vmalloc use arm64: vmemmap: Avoid base2 order of struct page size to dimension region arm64: ptdump: Discover start of vmemmap region at runtime arm64: ptdump: Allow all region boundaries to be defined at boot time arm64: mm: Move fixmap region above vmemmap region arm64: mm: Move PCI I/O emulation region above the vmemmap region * for-next/rust-for-arm64: : Enable Rust support for arm64 arm64: rust: Enable Rust support for AArch64 rust: Refactor the build target to allow the use of builtin targets * for-next/misc: : Miscellaneous arm64 patches ARM64: Dynamically allocate cpumasks and increase supported CPUs to 512 arm64: Remove enable_daif macro arm64/hw_breakpoint: Directly use ESR_ELx_WNR for an watchpoint exception arm64: cpufeatures: Clean up temporary variable to simplify code arm64: Update setup_arch() comment on interrupt masking arm64: remove unnecessary ifdefs around is_compat_task() arm64: ftrace: Don't forbid CALL_OPS+CC_OPTIMIZE_FOR_SIZE with Clang arm64/sme: Ensure that all fields in SMCR_EL1 are set to known values arm64/sve: Ensure that all fields in ZCR_EL1 are set to known values arm64/sve: Document that __SVE_VQ_MAX is much larger than needed arm64: make member of struct pt_regs and it's offset macro in the same order arm64: remove unneeded BUILD_BUG_ON assertion arm64: kretprobes: acquire the regs via a BRK exception arm64: io: permit offset addressing arm64: errata: Don't enable workarounds for "rare" errata by default * for-next/daif-cleanup: : Clean up DAIF handling for EL0 returns arm64: Unmask Debug + SError in do_notify_resume() arm64: Move do_notify_resume() to entry-common.c arm64: Simplify do_notify_resume() DAIF masking * for-next/kselftest: : Miscellaneous arm64 kselftest patches kselftest/arm64: Test that ptrace takes effect in the target process * for-next/documentation: : arm64 documentation patches arm64/sme: Remove spurious 'is' in SME documentation arm64/fp: Clarify effect of setting an unsupported system VL arm64/sme: Fix cut'n'paste in ABI document arm64/sve: Remove bitrotted comment about syscall behaviour * for-next/sysreg: : sysreg updates arm64/sysreg: Update ID_AA64DFR0_EL1 register arm64/sysreg: Update ID_DFR0_EL1 register fields arm64/sysreg: Add register fields for ID_AA64DFR1_EL1 * for-next/dpisa: : Support for 2023 dpISA extensions kselftest/arm64: Add 2023 DPISA hwcap test coverage kselftest/arm64: Add basic FPMR test kselftest/arm64: Handle FPMR context in generic signal frame parser arm64/hwcap: Define hwcaps for 2023 DPISA features arm64/ptrace: Expose FPMR via ptrace arm64/signal: Add FPMR signal handling arm64/fpsimd: Support FEAT_FPMR arm64/fpsimd: Enable host kernel access to FPMR arm64/cpufeature: Hook new identification registers up to cpufeature
9 parents b037e40 + 3567fa6 + 724a75a + 0499a78 + 97d935f + c745b15 + e47c18c + 358fee2 + 44d10c2 commit 0c5ade7

Some content is hidden

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

62 files changed

+2647
-241
lines changed

Documentation/arch/arm64/elf_hwcaps.rst

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,55 @@ HWCAP2_LRCPC3
317317
HWCAP2_LSE128
318318
Functionality implied by ID_AA64ISAR0_EL1.Atomic == 0b0011.
319319

320+
HWCAP2_FPMR
321+
Functionality implied by ID_AA64PFR2_EL1.FMR == 0b0001.
322+
323+
HWCAP2_LUT
324+
Functionality implied by ID_AA64ISAR2_EL1.LUT == 0b0001.
325+
326+
HWCAP2_FAMINMAX
327+
Functionality implied by ID_AA64ISAR3_EL1.FAMINMAX == 0b0001.
328+
329+
HWCAP2_F8CVT
330+
Functionality implied by ID_AA64FPFR0_EL1.F8CVT == 0b1.
331+
332+
HWCAP2_F8FMA
333+
Functionality implied by ID_AA64FPFR0_EL1.F8FMA == 0b1.
334+
335+
HWCAP2_F8DP4
336+
Functionality implied by ID_AA64FPFR0_EL1.F8DP4 == 0b1.
337+
338+
HWCAP2_F8DP2
339+
Functionality implied by ID_AA64FPFR0_EL1.F8DP2 == 0b1.
340+
341+
HWCAP2_F8E4M3
342+
Functionality implied by ID_AA64FPFR0_EL1.F8E4M3 == 0b1.
343+
344+
HWCAP2_F8E5M2
345+
Functionality implied by ID_AA64FPFR0_EL1.F8E5M2 == 0b1.
346+
347+
HWCAP2_SME_LUTV2
348+
Functionality implied by ID_AA64SMFR0_EL1.LUTv2 == 0b1.
349+
350+
HWCAP2_SME_F8F16
351+
Functionality implied by ID_AA64SMFR0_EL1.F8F16 == 0b1.
352+
353+
HWCAP2_SME_F8F32
354+
Functionality implied by ID_AA64SMFR0_EL1.F8F32 == 0b1.
355+
356+
HWCAP2_SME_SF8FMA
357+
Functionality implied by ID_AA64SMFR0_EL1.SF8FMA == 0b1.
358+
359+
HWCAP2_SME_SF8DP4
360+
Functionality implied by ID_AA64SMFR0_EL1.SF8DP4 == 0b1.
361+
362+
HWCAP2_SME_SF8DP2
363+
Functionality implied by ID_AA64SMFR0_EL1.SF8DP2 == 0b1.
364+
365+
HWCAP2_SME_SF8DP4
366+
Functionality implied by ID_AA64SMFR0_EL1.SF8DP4 == 0b1.
367+
368+
320369
4. Unused AT_HWCAP bits
321370
-----------------------
322371

Documentation/arch/arm64/silicon-errata.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ can be triggered by Linux).
3535
For software workarounds that may adversely impact systems unaffected by
3636
the erratum in question, a Kconfig entry is added under "Kernel
3737
Features" -> "ARM errata workarounds via the alternatives framework".
38-
These are enabled by default and patched in at runtime when an affected
39-
CPU is detected. For less-intrusive workarounds, a Kconfig option is not
38+
With the exception of workarounds for errata deemed "rare" by Arm, these
39+
are enabled by default and patched in at runtime when an affected CPU is
40+
detected. For less-intrusive workarounds, a Kconfig option is not
4041
available and the code is structured (preferably with a comment) in such
4142
a way that the erratum will not be hit.
4243

Documentation/arch/arm64/sme.rst

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ model features for SME is included in Appendix A.
7575
2. Vector lengths
7676
------------------
7777

78-
SME defines a second vector length similar to the SVE vector length which is
78+
SME defines a second vector length similar to the SVE vector length which
7979
controls the size of the streaming mode SVE vectors and the ZA matrix array.
8080
The ZA matrix is square with each side having as many bytes as a streaming
8181
mode SVE vector.
@@ -238,12 +238,12 @@ prctl(PR_SME_SET_VL, unsigned long arg)
238238
bits of Z0..Z31 except for Z0 bits [127:0] .. Z31 bits [127:0] to become
239239
unspecified, including both streaming and non-streaming SVE state.
240240
Calling PR_SME_SET_VL with vl equal to the thread's current vector
241-
length, or calling PR_SME_SET_VL with the PR_SVE_SET_VL_ONEXEC flag,
241+
length, or calling PR_SME_SET_VL with the PR_SME_SET_VL_ONEXEC flag,
242242
does not constitute a change to the vector length for this purpose.
243243

244244
* Changing the vector length causes PSTATE.ZA and PSTATE.SM to be cleared.
245245
Calling PR_SME_SET_VL with vl equal to the thread's current vector
246-
length, or calling PR_SME_SET_VL with the PR_SVE_SET_VL_ONEXEC flag,
246+
length, or calling PR_SME_SET_VL with the PR_SME_SET_VL_ONEXEC flag,
247247
does not constitute a change to the vector length for this purpose.
248248

249249

@@ -379,9 +379,8 @@ The regset data starts with struct user_za_header, containing:
379379
/proc/sys/abi/sme_default_vector_length
380380

381381
Writing the text representation of an integer to this file sets the system
382-
default vector length to the specified value, unless the value is greater
383-
than the maximum vector length supported by the system in which case the
384-
default vector length is set to that maximum.
382+
default vector length to the specified value rounded to a supported value
383+
using the same rules as for setting vector length via PR_SME_SET_VL.
385384

386385
The result can be determined by reopening the file and reading its
387386
contents.

Documentation/arch/arm64/sve.rst

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,6 @@ the SVE instruction set architecture.
117117
* The SVE registers are not used to pass arguments to or receive results from
118118
any syscall.
119119

120-
* In practice the affected registers/bits will be preserved or will be replaced
121-
with zeros on return from a syscall, but userspace should not make
122-
assumptions about this. The kernel behaviour may vary on a case-by-case
123-
basis.
124-
125120
* All other SVE state of a thread, including the currently configured vector
126121
length, the state of the PR_SVE_VL_INHERIT flag, and the deferred vector
127122
length (if any), is preserved across all syscalls, subject to the specific
@@ -428,9 +423,8 @@ The regset data starts with struct user_sve_header, containing:
428423
/proc/sys/abi/sve_default_vector_length
429424

430425
Writing the text representation of an integer to this file sets the system
431-
default vector length to the specified value, unless the value is greater
432-
than the maximum vector length supported by the system in which case the
433-
default vector length is set to that maximum.
426+
default vector length to the specified value rounded to a supported value
427+
using the same rules as for setting vector length via PR_SVE_SET_VL.
434428

435429
The result can be determined by reopening the file and reading its
436430
contents.

Documentation/rust/arch-support.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ support corresponds to ``S`` values in the ``MAINTAINERS`` file.
1515
============= ================ ==============================================
1616
Architecture Level of support Constraints
1717
============= ================ ==============================================
18+
``arm64`` Maintained Little Endian only.
1819
``loongarch`` Maintained -
1920
``um`` Maintained ``x86_64`` only.
2021
``x86`` Maintained ``x86_64`` only.

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,6 @@ KBUILD_CFLAGS += -fno-strict-aliasing
561561

562562
KBUILD_CPPFLAGS := -D__KERNEL__
563563
KBUILD_RUSTFLAGS := $(rust_common_flags) \
564-
--target=$(objtree)/scripts/target.json \
565564
-Cpanic=abort -Cembed-bitcode=n -Clto=n \
566565
-Cforce-unwind-tables=n -Ccodegen-units=1 \
567566
-Csymbol-mangling-version=v0 \

arch/arm64/Kconfig

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ config ARM64
120120
select CLONE_BACKWARDS
121121
select COMMON_CLK
122122
select CPU_PM if (SUSPEND || CPU_IDLE)
123+
select CPUMASK_OFFSTACK if NR_CPUS > 256
123124
select CRC32
124125
select DCACHE_WORD_ACCESS
125126
select DYNAMIC_FTRACE if FUNCTION_TRACER
@@ -198,7 +199,7 @@ config ARM64
198199
if DYNAMIC_FTRACE_WITH_ARGS && DYNAMIC_FTRACE_WITH_CALL_OPS
199200
select HAVE_DYNAMIC_FTRACE_WITH_CALL_OPS \
200201
if (DYNAMIC_FTRACE_WITH_ARGS && !CFI_CLANG && \
201-
!CC_OPTIMIZE_FOR_SIZE)
202+
(CC_IS_CLANG || !CC_OPTIMIZE_FOR_SIZE))
202203
select FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY \
203204
if DYNAMIC_FTRACE_WITH_ARGS
204205
select HAVE_SAMPLE_FTRACE_DIRECT
@@ -229,6 +230,7 @@ config ARM64
229230
select HAVE_FUNCTION_ARG_ACCESS_API
230231
select MMU_GATHER_RCU_TABLE_FREE
231232
select HAVE_RSEQ
233+
select HAVE_RUST if CPU_LITTLE_ENDIAN
232234
select HAVE_STACKPROTECTOR
233235
select HAVE_SYSCALL_TRACEPOINTS
234236
select HAVE_KPROBES
@@ -547,9 +549,8 @@ config ARM64_ERRATUM_832075
547549
If unsure, say Y.
548550

549551
config ARM64_ERRATUM_834220
550-
bool "Cortex-A57: 834220: Stage 2 translation fault might be incorrectly reported in presence of a Stage 1 fault"
552+
bool "Cortex-A57: 834220: Stage 2 translation fault might be incorrectly reported in presence of a Stage 1 fault (rare)"
551553
depends on KVM
552-
default y
553554
help
554555
This option adds an alternative code sequence to work around ARM
555556
erratum 834220 on Cortex-A57 parts up to r1p2.
@@ -565,7 +566,7 @@ config ARM64_ERRATUM_834220
565566
as it depends on the alternative framework, which will only patch
566567
the kernel if an affected CPU is detected.
567568

568-
If unsure, say Y.
569+
If unsure, say N.
569570

570571
config ARM64_ERRATUM_1742098
571572
bool "Cortex-A57/A72: 1742098: ELR recorded incorrectly on interrupt taken between cryptographic instructions in a sequence"
@@ -692,8 +693,7 @@ config ARM64_WORKAROUND_REPEAT_TLBI
692693
bool
693694

694695
config ARM64_ERRATUM_2441007
695-
bool "Cortex-A55: Completion of affected memory accesses might not be guaranteed by completion of a TLBI"
696-
default y
696+
bool "Cortex-A55: Completion of affected memory accesses might not be guaranteed by completion of a TLBI (rare)"
697697
select ARM64_WORKAROUND_REPEAT_TLBI
698698
help
699699
This option adds a workaround for ARM Cortex-A55 erratum #2441007.
@@ -706,11 +706,10 @@ config ARM64_ERRATUM_2441007
706706
Work around this by adding the affected CPUs to the list that needs
707707
TLB sequences to be done twice.
708708

709-
If unsure, say Y.
709+
If unsure, say N.
710710

711711
config ARM64_ERRATUM_1286807
712-
bool "Cortex-A76: Modification of the translation table for a virtual address might lead to read-after-read ordering violation"
713-
default y
712+
bool "Cortex-A76: Modification of the translation table for a virtual address might lead to read-after-read ordering violation (rare)"
714713
select ARM64_WORKAROUND_REPEAT_TLBI
715714
help
716715
This option adds a workaround for ARM Cortex-A76 erratum 1286807.
@@ -724,6 +723,8 @@ config ARM64_ERRATUM_1286807
724723
invalidated has been observed by other observers. The
725724
workaround repeats the TLBI+DSB operation.
726725

726+
If unsure, say N.
727+
727728
config ARM64_ERRATUM_1463225
728729
bool "Cortex-A76: Software Step might prevent interrupt recognition"
729730
default y
@@ -743,8 +744,7 @@ config ARM64_ERRATUM_1463225
743744
If unsure, say Y.
744745

745746
config ARM64_ERRATUM_1542419
746-
bool "Neoverse-N1: workaround mis-ordering of instruction fetches"
747-
default y
747+
bool "Neoverse-N1: workaround mis-ordering of instruction fetches (rare)"
748748
help
749749
This option adds a workaround for ARM Neoverse-N1 erratum
750750
1542419.
@@ -756,7 +756,7 @@ config ARM64_ERRATUM_1542419
756756
Workaround the issue by hiding the DIC feature from EL0. This
757757
forces user-space to perform cache maintenance.
758758

759-
If unsure, say Y.
759+
If unsure, say N.
760760

761761
config ARM64_ERRATUM_1508412
762762
bool "Cortex-A77: 1508412: workaround deadlock on sequence of NC/Device load and store exclusive or PAR read"
@@ -931,8 +931,7 @@ config ARM64_ERRATUM_2224489
931931
If unsure, say Y.
932932

933933
config ARM64_ERRATUM_2441009
934-
bool "Cortex-A510: Completion of affected memory accesses might not be guaranteed by completion of a TLBI"
935-
default y
934+
bool "Cortex-A510: Completion of affected memory accesses might not be guaranteed by completion of a TLBI (rare)"
936935
select ARM64_WORKAROUND_REPEAT_TLBI
937936
help
938937
This option adds a workaround for ARM Cortex-A510 erratum #2441009.
@@ -945,7 +944,7 @@ config ARM64_ERRATUM_2441009
945944
Work around this by adding the affected CPUs to the list that needs
946945
TLB sequences to be done twice.
947946

948-
If unsure, say Y.
947+
If unsure, say N.
949948

950949
config ARM64_ERRATUM_2064142
951950
bool "Cortex-A510: 2064142: workaround TRBE register writes while disabled"
@@ -1427,7 +1426,7 @@ config SCHED_SMT
14271426
config NR_CPUS
14281427
int "Maximum number of CPUs (2-4096)"
14291428
range 2 4096
1430-
default "256"
1429+
default "512"
14311430

14321431
config HOTPLUG_CPU
14331432
bool "Support for hot-pluggable CPUs"

arch/arm64/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ KBUILD_CFLAGS += -mgeneral-regs-only \
4141
KBUILD_CFLAGS += $(call cc-disable-warning, psabi)
4242
KBUILD_AFLAGS += $(compat_vdso)
4343

44+
KBUILD_RUSTFLAGS += --target=aarch64-unknown-none -Ctarget-feature="-neon"
45+
4446
KBUILD_CFLAGS += $(call cc-option,-mabi=lp64)
4547
KBUILD_AFLAGS += $(call cc-option,-mabi=lp64)
4648

@@ -65,7 +67,9 @@ endif
6567

6668
ifeq ($(CONFIG_ARM64_BTI_KERNEL),y)
6769
KBUILD_CFLAGS += -mbranch-protection=pac-ret+bti
70+
KBUILD_RUSTFLAGS += -Zbranch-protection=bti,pac-ret
6871
else ifeq ($(CONFIG_ARM64_PTR_AUTH_KERNEL),y)
72+
KBUILD_RUSTFLAGS += -Zbranch-protection=pac-ret
6973
ifeq ($(CONFIG_CC_HAS_BRANCH_PROT_PAC_RET),y)
7074
KBUILD_CFLAGS += -mbranch-protection=pac-ret
7175
else

arch/arm64/include/asm/assembler.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,6 @@
3838
msr daifset, #0xf
3939
.endm
4040

41-
.macro enable_daif
42-
msr daifclr, #0xf
43-
.endm
44-
4541
/*
4642
* Save/restore interrupts.
4743
*/

arch/arm64/include/asm/brk-imm.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* 0x004: for installing kprobes
1212
* 0x005: for installing uprobes
1313
* 0x006: for kprobe software single-step
14+
* 0x007: for kretprobe return
1415
* Allowed values for kgdb are 0x400 - 0x7ff
1516
* 0x100: for triggering a fault on purpose (reserved)
1617
* 0x400: for dynamic BRK instruction
@@ -23,6 +24,7 @@
2324
#define KPROBES_BRK_IMM 0x004
2425
#define UPROBES_BRK_IMM 0x005
2526
#define KPROBES_BRK_SS_IMM 0x006
27+
#define KRETPROBES_BRK_IMM 0x007
2628
#define FAULT_BRK_IMM 0x100
2729
#define KGDB_DYN_DBG_BRK_IMM 0x400
2830
#define KGDB_COMPILED_DBG_BRK_IMM 0x401

0 commit comments

Comments
 (0)