Skip to content

Commit 6734e20

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 quite a lot of code here, but much of it is due to the addition of a new PMU driver as well as some arm64-specific selftests which is an area where we've traditionally been lagging a bit. In terms of exciting features, this includes support for the Memory Tagging Extension which narrowly missed 5.9, hopefully allowing userspace to run with use-after-free detection in production on CPUs that support it. Work is ongoing to integrate the feature with KASAN for 5.11. Another change that I'm excited about (assuming they get the hardware right) is preparing the ASID allocator for sharing the CPU page-table with the SMMU. Those changes will also come in via Joerg with the IOMMU pull. We do stray outside of our usual directories in a few places, mostly due to core changes required by MTE. Although much of this has been Acked, there were a couple of places where we unfortunately didn't get any review feedback. Other than that, we ran into a handful of minor conflicts in -next, but nothing that should post any issues. Summary: - Userspace support for the Memory Tagging Extension introduced by Armv8.5. Kernel support (via KASAN) is likely to follow in 5.11. - Selftests for MTE, Pointer Authentication and FPSIMD/SVE context switching. - Fix and subsequent rewrite of our Spectre mitigations, including the addition of support for PR_SPEC_DISABLE_NOEXEC. - Support for the Armv8.3 Pointer Authentication enhancements. - Support for ASID pinning, which is required when sharing page-tables with the SMMU. - MM updates, including treating flush_tlb_fix_spurious_fault() as a no-op. - Perf/PMU driver updates, including addition of the ARM CMN PMU driver and also support to handle CPU PMU IRQs as NMIs. - Allow prefetchable PCI BARs to be exposed to userspace using normal non-cacheable mappings. - Implementation of ARCH_STACKWALK for unwinding. - Improve reporting of unexpected kernel traps due to BPF JIT failure. - Improve robustness of user-visible HWCAP strings and their corresponding numerical constants. - Removal of TEXT_OFFSET. - Removal of some unused functions, parameters and prototypes. - Removal of MPIDR-based topology detection in favour of firmware description. - Cleanups to handling of SVE and FPSIMD register state in preparation for potential future optimisation of handling across syscalls. - Cleanups to the SDEI driver in preparation for support in KVM. - Miscellaneous cleanups and refactoring work" * tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: (148 commits) Revert "arm64: initialize per-cpu offsets earlier" arm64: random: Remove no longer needed prototypes arm64: initialize per-cpu offsets earlier kselftest/arm64: Check mte tagged user address in kernel kselftest/arm64: Verify KSM page merge for MTE pages kselftest/arm64: Verify all different mmap MTE options kselftest/arm64: Check forked child mte memory accessibility kselftest/arm64: Verify mte tag inclusion via prctl kselftest/arm64: Add utilities and a test to validate mte memory perf: arm-cmn: Fix conversion specifiers for node type perf: arm-cmn: Fix unsigned comparison to less than zero arm64: dbm: Invalidate local TLB when setting TCR_EL1.HD arm64: mm: Make flush_tlb_fix_spurious_fault() a no-op arm64: Add support for PR_SPEC_DISABLE_NOEXEC prctl() option arm64: Pull in task_stack_page() to Spectre-v4 mitigation code KVM: arm64: Allow patching EL2 vectors even with KASLR is not enabled arm64: Get rid of arm64_ssbd_state KVM: arm64: Convert ARCH_WORKAROUND_2 to arm64_get_spectre_v4_state() KVM: arm64: Get rid of kvm_arm_have_ssbd() KVM: arm64: Simplify handling of ARCH_WORKAROUND_2 ...
2 parents d04a248 + d13027b commit 6734e20

184 files changed

Lines changed: 10378 additions & 1896 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
=============================
2+
Arm Coherent Mesh Network PMU
3+
=============================
4+
5+
CMN-600 is a configurable mesh interconnect consisting of a rectangular
6+
grid of crosspoints (XPs), with each crosspoint supporting up to two
7+
device ports to which various AMBA CHI agents are attached.
8+
9+
CMN implements a distributed PMU design as part of its debug and trace
10+
functionality. This consists of a local monitor (DTM) at every XP, which
11+
counts up to 4 event signals from the connected device nodes and/or the
12+
XP itself. Overflow from these local counters is accumulated in up to 8
13+
global counters implemented by the main controller (DTC), which provides
14+
overall PMU control and interrupts for global counter overflow.
15+
16+
PMU events
17+
----------
18+
19+
The PMU driver registers a single PMU device for the whole interconnect,
20+
see /sys/bus/event_source/devices/arm_cmn. Multi-chip systems may link
21+
more than one CMN together via external CCIX links - in this situation,
22+
each mesh counts its own events entirely independently, and additional
23+
PMU devices will be named arm_cmn_{1..n}.
24+
25+
Most events are specified in a format based directly on the TRM
26+
definitions - "type" selects the respective node type, and "eventid" the
27+
event number. Some events require an additional occupancy ID, which is
28+
specified by "occupid".
29+
30+
* Since RN-D nodes do not have any distinct events from RN-I nodes, they
31+
are treated as the same type (0xa), and the common event templates are
32+
named "rnid_*".
33+
34+
* The cycle counter is treated as a synthetic event belonging to the DTC
35+
node ("type" == 0x3, "eventid" is ignored).
36+
37+
* XP events also encode the port and channel in the "eventid" field, to
38+
match the underlying pmu_event0_id encoding for the pmu_event_sel
39+
register. The event templates are named with prefixes to cover all
40+
permutations.
41+
42+
By default each event provides an aggregate count over all nodes of the
43+
given type. To target a specific node, "bynodeid" must be set to 1 and
44+
"nodeid" to the appropriate value derived from the CMN configuration
45+
(as defined in the "Node ID Mapping" section of the TRM).
46+
47+
Watchpoints
48+
-----------
49+
50+
The PMU can also count watchpoint events to monitor specific flit
51+
traffic. Watchpoints are treated as a synthetic event type, and like PMU
52+
events can be global or targeted with a particular XP's "nodeid" value.
53+
Since the watchpoint direction is otherwise implicit in the underlying
54+
register selection, separate events are provided for flit uploads and
55+
downloads.
56+
57+
The flit match value and mask are passed in config1 and config2 ("val"
58+
and "mask" respectively). "wp_dev_sel", "wp_chn_sel", "wp_grp" and
59+
"wp_exclusive" are specified per the TRM definitions for dtm_wp_config0.
60+
Where a watchpoint needs to match fields from both match groups on the
61+
REQ or SNP channel, it can be specified as two events - one for each
62+
group - with the same nonzero "combine" value. The count for such a
63+
pair of combined events will be attributed to the primary match.
64+
Watchpoint events with a "combine" value of 0 are considered independent
65+
and will count individually.

Documentation/admin-guide/perf/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Performance monitor support
1212
qcom_l2_pmu
1313
qcom_l3_pmu
1414
arm-ccn
15+
arm-cmn
1516
xgene-pmu
1617
arm_dsu_pmu
1718
thunderx2-pmu

Documentation/arm64/cpu-feature-registers.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,8 @@ infrastructure:
175175
+------------------------------+---------+---------+
176176
| Name | bits | visible |
177177
+------------------------------+---------+---------+
178+
| MTE | [11-8] | y |
179+
+------------------------------+---------+---------+
178180
| SSBS | [7-4] | y |
179181
+------------------------------+---------+---------+
180182
| BT | [3-0] | y |

Documentation/arm64/elf_hwcaps.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,10 @@ HWCAP2_BTI
240240

241241
Functionality implied by ID_AA64PFR0_EL1.BT == 0b0001.
242242

243+
HWCAP2_MTE
244+
245+
Functionality implied by ID_AA64PFR1_EL1.MTE == 0b0010, as described
246+
by Documentation/arm64/memory-tagging-extension.rst.
243247

244248
4. Unused AT_HWCAP bits
245249
-----------------------

Documentation/arm64/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ ARM64 Architecture
1414
hugetlbpage
1515
legacy_instructions
1616
memory
17+
memory-tagging-extension
1718
perf
1819
pointer-authentication
1920
silicon-errata

0 commit comments

Comments
 (0)