Skip to content

Commit 480a9e5

Browse files
committed
Merge branches 'for-next/misc', 'for-next/tlbflush', 'for-next/ttbr-macros-cleanup', 'for-next/kselftest', 'for-next/feat_lsui', 'for-next/mpam', 'for-next/hotplug-batched-tlbi', 'for-next/bbml2-fixes', 'for-next/sysreg', 'for-next/generic-entry' and 'for-next/acpi', remote-tracking branches 'arm64/for-next/perf' and 'arm64/for-next/read-once' into for-next/core
* arm64/for-next/perf: : Perf updates perf/arm-cmn: Fix resource_size_t printk specifier in arm_cmn_init_dtc() perf/arm-cmn: Fix incorrect error check for devm_ioremap() perf: add NVIDIA Tegra410 C2C PMU perf: add NVIDIA Tegra410 CPU Memory Latency PMU perf/arm_cspmu: nvidia: Add Tegra410 PCIE-TGT PMU perf/arm_cspmu: nvidia: Add Tegra410 PCIE PMU perf/arm_cspmu: Add arm_cspmu_acpi_dev_get perf/arm_cspmu: nvidia: Add Tegra410 UCF PMU perf/arm_cspmu: nvidia: Rename doc to Tegra241 perf/arm-cmn: Stop claiming entire iomem region arm64: cpufeature: Use pmuv3_implemented() function arm64: cpufeature: Make PMUVer and PerfMon unsigned KVM: arm64: Read PMUVer as unsigned * arm64/for-next/read-once: : Fixes for __READ_ONCE() with CONFIG_LTO=y arm64, compiler-context-analysis: Permit alias analysis through __READ_ONCE() with CONFIG_LTO=y arm64: Optimize __READ_ONCE() with CONFIG_LTO=y * for-next/misc: : Miscellaneous cleanups/fixes arm64: rsi: use linear-map alias for realm config buffer arm64: Kconfig: fix duplicate word in CMDLINE help text arm64: mte: Skip TFSR_EL1 checks and barriers in synchronous tag check mode arm64/hwcap: Generate the KERNEL_HWCAP_ definitions for the hwcaps arm64: kexec: Remove duplicate allocation for trans_pgd arm64: mm: Use generic enum pgtable_level arm64: scs: Remove redundant save/restore of SCS SP on entry to/from EL0 arm64: remove ARCH_INLINE_* * for-next/tlbflush: : Refactor the arm64 TLB invalidation API and implementation arm64: mm: __ptep_set_access_flags must hint correct TTL arm64: mm: Provide level hint for flush_tlb_page() arm64: mm: Wrap flush_tlb_page() around __do_flush_tlb_range() arm64: mm: More flags for __flush_tlb_range() arm64: mm: Refactor __flush_tlb_range() to take flags arm64: mm: Refactor flush_tlb_page() to use __tlbi_level_asid() arm64: mm: Simplify __flush_tlb_range_limit_excess() arm64: mm: Simplify __TLBI_RANGE_NUM() macro arm64: mm: Re-implement the __flush_tlb_range_op macro in C arm64: mm: Inline __TLBI_VADDR_RANGE() into __tlbi_range() arm64: mm: Push __TLBI_VADDR() into __tlbi_level() arm64: mm: Implicitly invalidate user ASID based on TLBI operation arm64: mm: Introduce a C wrapper for by-range TLB invalidation arm64: mm: Re-implement the __tlbi_level macro as a C function * for-next/ttbr-macros-cleanup: : Cleanups of the TTBR1_* macros arm64/mm: Directly use TTBRx_EL1_CnP arm64/mm: Directly use TTBRx_EL1_ASID_MASK arm64/mm: Describe TTBR1_BADDR_4852_OFFSET * for-next/kselftest: : arm64 kselftest updates selftests/arm64: Implement cmpbr_sigill() to hwcap test * for-next/feat_lsui: : Futex support using FEAT_LSUI instructions to avoid toggling PAN arm64: armv8_deprecated: Disable swp emulation when FEAT_LSUI present arm64: Kconfig: Add support for LSUI KVM: arm64: Use CAST instruction for swapping guest descriptor arm64: futex: Support futex with FEAT_LSUI arm64: futex: Refactor futex atomic operation KVM: arm64: kselftest: set_id_regs: Add test for FEAT_LSUI KVM: arm64: Expose FEAT_LSUI to guests arm64: cpufeature: Add FEAT_LSUI * for-next/mpam: (40 commits) : Expose MPAM to user-space via resctrl: : - Add architecture context-switch and hiding of the feature from KVM. : - Add interface to allow MPAM to be exposed to user-space using resctrl. : - Add errata workaoround for some existing platforms. : - Add documentation for using MPAM and what shape of platforms can use resctrl arm64: mpam: Add initial MPAM documentation arm_mpam: Quirk CMN-650's CSU NRDY behaviour arm_mpam: Add workaround for T241-MPAM-6 arm_mpam: Add workaround for T241-MPAM-4 arm_mpam: Add workaround for T241-MPAM-1 arm_mpam: Add quirk framework arm_mpam: resctrl: Call resctrl_init() on platforms that can support resctrl arm64: mpam: Select ARCH_HAS_CPU_RESCTRL arm_mpam: resctrl: Add empty definitions for assorted resctrl functions arm_mpam: resctrl: Update the rmid reallocation limit arm_mpam: resctrl: Add resctrl_arch_rmid_read() arm_mpam: resctrl: Allow resctrl to allocate monitors arm_mpam: resctrl: Add support for csu counters arm_mpam: resctrl: Add monitor initialisation and domain boilerplate arm_mpam: resctrl: Add kunit test for control format conversions arm_mpam: resctrl: Add support for 'MB' resource arm_mpam: resctrl: Wait for cacheinfo to be ready arm_mpam: resctrl: Add rmid index helpers arm_mpam: resctrl: Convert to/from MPAMs fixed-point formats arm_mpam: resctrl: Hide CDP emulation behind CONFIG_EXPERT ... * for-next/hotplug-batched-tlbi: : arm64/mm: Enable batched TLB flush in unmap_hotplug_range() arm64/mm: Reject memory removal that splits a kernel leaf mapping arm64/mm: Enable batched TLB flush in unmap_hotplug_range() * for-next/bbml2-fixes: : Fixes for realm guest and BBML2_NOABORT arm64: mm: Remove pmd_sect() and pud_sect() arm64: mm: Handle invalid large leaf mappings correctly arm64: mm: Fix rodata=full block mapping support for realm guests * for-next/sysreg: : arm64 sysreg updates arm64/sysreg: Update ID_AA64SMFR0_EL1 description to DDI0601 2025-12 arm64/sysreg: Update ID_AA64ZFR0_EL1 description to DDI0601 2025-12 arm64/sysreg: Update ID_AA64FPFR0_EL1 description to DDI0601 2025-12 arm64/sysreg: Update ID_AA64ISAR2_EL1 description to DDI0601 2025-12 arm64/sysreg: Update ID_AA64ISAR0_EL1 description to DDI0601 2025-12 arm64/sysreg: Update SMIDR_EL1 to DDI0601 2025-06 * for-next/generic-entry: : More arm64 refactoring towards using the generic entry code arm64: Check DAIF (and PMR) at task-switch time arm64: entry: Use split preemption logic arm64: entry: Use irqentry_{enter_from,exit_to}_kernel_mode() arm64: entry: Consistently prefix arm64-specific wrappers arm64: entry: Don't preempt with SError or Debug masked entry: Split preemption from irqentry_exit_to_kernel_mode() entry: Split kernel mode logic from irqentry_{enter,exit}() entry: Move irqentry_enter() prototype later entry: Remove local_irq_{enable,disable}_exit_to_user() entry: Fix stale comment for irqentry_enter() * for-next/acpi: : arm64 ACPI updates ACPI: AGDI: fix missing newline in error message
13 parents 47f06eb + 773b24b + 34e5639 + b7d9d2e + be6e9de + 74cd4e0 + e223258 + 4ce0a2c + 95a5885 + 1d37713 + 306736f + 8d13386 + b178330 commit 480a9e5

70 files changed

Lines changed: 4088 additions & 875 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/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ ARM64 Architecture
2323
memory
2424
memory-tagging-extension
2525
mops
26+
mpam
2627
perf
2728
pointer-authentication
2829
ptdump

Documentation/arch/arm64/mpam.rst

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
.. SPDX-License-Identifier: GPL-2.0
2+
3+
====
4+
MPAM
5+
====
6+
7+
What is MPAM
8+
============
9+
MPAM (Memory Partitioning and Monitoring) is a feature in the CPUs and memory
10+
system components such as the caches or memory controllers that allow memory
11+
traffic to be labelled, partitioned and monitored.
12+
13+
Traffic is labelled by the CPU, based on the control or monitor group the
14+
current task is assigned to using resctrl. Partitioning policy can be set
15+
using the schemata file in resctrl, and monitor values read via resctrl.
16+
See Documentation/filesystems/resctrl.rst for more details.
17+
18+
This allows tasks that share memory system resources, such as caches, to be
19+
isolated from each other according to the partitioning policy (so called noisy
20+
neighbours).
21+
22+
Supported Platforms
23+
===================
24+
Use of this feature requires CPU support, support in the memory system
25+
components, and a description from firmware of where the MPAM device controls
26+
are in the MMIO address space. (e.g. the 'MPAM' ACPI table).
27+
28+
The MMIO device that provides MPAM controls/monitors for a memory system
29+
component is called a memory system component. (MSC).
30+
31+
Because the user interface to MPAM is via resctrl, only MPAM features that are
32+
compatible with resctrl can be exposed to user-space.
33+
34+
MSC are considered as a group based on the topology. MSC that correspond with
35+
the L3 cache are considered together, it is not possible to mix MSC between L2
36+
and L3 to 'cover' a resctrl schema.
37+
38+
The supported features are:
39+
40+
* Cache portion bitmap controls (CPOR) on the L2 or L3 caches. To expose
41+
CPOR at L2 or L3, every CPU must have a corresponding CPU cache at this
42+
level that also supports the feature. Mismatched big/little platforms are
43+
not supported as resctrl's controls would then also depend on task
44+
placement.
45+
46+
* Memory bandwidth maximum controls (MBW_MAX) on or after the L3 cache.
47+
resctrl uses the L3 cache-id to identify where the memory bandwidth
48+
control is applied. For this reason the platform must have an L3 cache
49+
with cache-id's supplied by firmware. (It doesn't need to support MPAM.)
50+
51+
To be exported as the 'MB' schema, the topology of the group of MSC chosen
52+
must match the topology of the L3 cache so that the cache-id's can be
53+
repainted. For example: Platforms with Memory bandwidth maximum controls
54+
on CPU-less NUMA nodes cannot expose the 'MB' schema to resctrl as these
55+
nodes do not have a corresponding L3 cache. If the memory bandwidth
56+
control is on the memory rather than the L3 then there must be a single
57+
global L3 as otherwise it is unknown which L3 the traffic came from. There
58+
must be no caches between the L3 and the memory so that the two ends of
59+
the path have equivalent traffic.
60+
61+
When the MPAM driver finds multiple groups of MSC it can use for the 'MB'
62+
schema, it prefers the group closest to the L3 cache.
63+
64+
* Cache Storage Usage (CSU) counters can expose the 'llc_occupancy' provided
65+
there is at least one CSU monitor on each MSC that makes up the L3 group.
66+
Exposing CSU counters from other caches or devices is not supported.
67+
68+
Reporting Bugs
69+
==============
70+
If you are not seeing the counters or controls you expect please share the
71+
debug messages produced when enabling dynamic debug and booting with:
72+
dyndbg="file mpam_resctrl.c +pl"

Documentation/arch/arm64/silicon-errata.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,9 @@ stable kernels.
214214
+----------------+-----------------+-----------------+-----------------------------+
215215
| ARM | SI L1 | #4311569 | ARM64_ERRATUM_4311569 |
216216
+----------------+-----------------+-----------------+-----------------------------+
217+
| ARM | CMN-650 | #3642720 | N/A |
218+
+----------------+-----------------+-----------------+-----------------------------+
219+
+----------------+-----------------+-----------------+-----------------------------+
217220
| Broadcom | Brahma-B53 | N/A | ARM64_ERRATUM_845719 |
218221
+----------------+-----------------+-----------------+-----------------------------+
219222
| Broadcom | Brahma-B53 | N/A | ARM64_ERRATUM_843419 |
@@ -247,6 +250,12 @@ stable kernels.
247250
+----------------+-----------------+-----------------+-----------------------------+
248251
| NVIDIA | T241 GICv3/4.x | T241-FABRIC-4 | N/A |
249252
+----------------+-----------------+-----------------+-----------------------------+
253+
| NVIDIA | T241 MPAM | T241-MPAM-1 | N/A |
254+
+----------------+-----------------+-----------------+-----------------------------+
255+
| NVIDIA | T241 MPAM | T241-MPAM-4 | N/A |
256+
+----------------+-----------------+-----------------+-----------------------------+
257+
| NVIDIA | T241 MPAM | T241-MPAM-6 | N/A |
258+
+----------------+-----------------+-----------------+-----------------------------+
250259
+----------------+-----------------+-----------------+-----------------------------+
251260
| Freescale/NXP | LS2080A/LS1043A | A-008585 | FSL_ERRATUM_A008585 |
252261
+----------------+-----------------+-----------------+-----------------------------+

arch/arm64/Kconfig

Lines changed: 25 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -61,32 +61,6 @@ config ARM64
6161
select ARCH_HAVE_ELF_PROT
6262
select ARCH_HAVE_NMI_SAFE_CMPXCHG
6363
select ARCH_HAVE_TRACE_MMIO_ACCESS
64-
select ARCH_INLINE_READ_LOCK if !PREEMPTION
65-
select ARCH_INLINE_READ_LOCK_BH if !PREEMPTION
66-
select ARCH_INLINE_READ_LOCK_IRQ if !PREEMPTION
67-
select ARCH_INLINE_READ_LOCK_IRQSAVE if !PREEMPTION
68-
select ARCH_INLINE_READ_UNLOCK if !PREEMPTION
69-
select ARCH_INLINE_READ_UNLOCK_BH if !PREEMPTION
70-
select ARCH_INLINE_READ_UNLOCK_IRQ if !PREEMPTION
71-
select ARCH_INLINE_READ_UNLOCK_IRQRESTORE if !PREEMPTION
72-
select ARCH_INLINE_WRITE_LOCK if !PREEMPTION
73-
select ARCH_INLINE_WRITE_LOCK_BH if !PREEMPTION
74-
select ARCH_INLINE_WRITE_LOCK_IRQ if !PREEMPTION
75-
select ARCH_INLINE_WRITE_LOCK_IRQSAVE if !PREEMPTION
76-
select ARCH_INLINE_WRITE_UNLOCK if !PREEMPTION
77-
select ARCH_INLINE_WRITE_UNLOCK_BH if !PREEMPTION
78-
select ARCH_INLINE_WRITE_UNLOCK_IRQ if !PREEMPTION
79-
select ARCH_INLINE_WRITE_UNLOCK_IRQRESTORE if !PREEMPTION
80-
select ARCH_INLINE_SPIN_TRYLOCK if !PREEMPTION
81-
select ARCH_INLINE_SPIN_TRYLOCK_BH if !PREEMPTION
82-
select ARCH_INLINE_SPIN_LOCK if !PREEMPTION
83-
select ARCH_INLINE_SPIN_LOCK_BH if !PREEMPTION
84-
select ARCH_INLINE_SPIN_LOCK_IRQ if !PREEMPTION
85-
select ARCH_INLINE_SPIN_LOCK_IRQSAVE if !PREEMPTION
86-
select ARCH_INLINE_SPIN_UNLOCK if !PREEMPTION
87-
select ARCH_INLINE_SPIN_UNLOCK_BH if !PREEMPTION
88-
select ARCH_INLINE_SPIN_UNLOCK_IRQ if !PREEMPTION
89-
select ARCH_INLINE_SPIN_UNLOCK_IRQRESTORE if !PREEMPTION
9064
select ARCH_KEEP_MEMBLOCK
9165
select ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE
9266
select ARCH_USE_CMPXCHG_LOCKREF
@@ -2016,8 +1990,8 @@ config ARM64_TLB_RANGE
20161990

20171991
config ARM64_MPAM
20181992
bool "Enable support for MPAM"
2019-
select ARM64_MPAM_DRIVER if EXPERT # does nothing yet
2020-
select ACPI_MPAM if ACPI
1993+
select ARM64_MPAM_DRIVER
1994+
select ARCH_HAS_CPU_RESCTRL
20211995
help
20221996
Memory System Resource Partitioning and Monitoring (MPAM) is an
20231997
optional extension to the Arm architecture that allows each
@@ -2039,6 +2013,8 @@ config ARM64_MPAM
20392013

20402014
MPAM is exposed to user-space via the resctrl pseudo filesystem.
20412015

2016+
This option enables the extra context switch code.
2017+
20422018
endmenu # "ARMv8.4 architectural features"
20432019

20442020
menu "ARMv8.5 architectural features"
@@ -2215,6 +2191,26 @@ config ARM64_GCS
22152191

22162192
endmenu # "ARMv9.4 architectural features"
22172193

2194+
config AS_HAS_LSUI
2195+
def_bool $(as-instr,.arch_extension lsui)
2196+
help
2197+
Supported by LLVM 20+ and binutils 2.45+.
2198+
2199+
menu "ARMv9.6 architectural features"
2200+
2201+
config ARM64_LSUI
2202+
bool "Support Unprivileged Load Store Instructions (LSUI)"
2203+
default y
2204+
depends on AS_HAS_LSUI && !CPU_BIG_ENDIAN
2205+
help
2206+
The Unprivileged Load Store Instructions (LSUI) provides
2207+
variants load/store instructions that access user-space memory
2208+
from the kernel without clearing PSTATE.PAN bit.
2209+
2210+
This feature is supported by LLVM 20+ and binutils 2.45+.
2211+
2212+
endmenu # "ARMv9.6 architectural feature"
2213+
22182214
config ARM64_SVE
22192215
bool "ARM Scalable Vector Extension support"
22202216
default y
@@ -2372,7 +2368,7 @@ config CMDLINE
23722368
default ""
23732369
help
23742370
Provide a set of default command-line options at build time by
2375-
entering them here. As a minimum, you should specify the the
2371+
entering them here. As a minimum, you should specify the
23762372
root device (e.g. root=/dev/nfs).
23772373

23782374
choice

arch/arm64/include/asm/asm-uaccess.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#ifdef CONFIG_ARM64_SW_TTBR0_PAN
1616
.macro __uaccess_ttbr0_disable, tmp1
1717
mrs \tmp1, ttbr1_el1 // swapper_pg_dir
18-
bic \tmp1, \tmp1, #TTBR_ASID_MASK
18+
bic \tmp1, \tmp1, #TTBRx_EL1_ASID_MASK
1919
sub \tmp1, \tmp1, #RESERVED_SWAPPER_OFFSET // reserved_pg_dir
2020
msr ttbr0_el1, \tmp1 // set reserved TTBR0_EL1
2121
add \tmp1, \tmp1, #RESERVED_SWAPPER_OFFSET

arch/arm64/include/asm/cpucaps.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ cpucap_is_possible(const unsigned int cap)
7171
return true;
7272
case ARM64_HAS_PMUV3:
7373
return IS_ENABLED(CONFIG_HW_PERF_EVENTS);
74+
case ARM64_HAS_LSUI:
75+
return IS_ENABLED(CONFIG_ARM64_LSUI);
7476
}
7577

7678
return true;

arch/arm64/include/asm/el2_setup.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,8 @@
513513
check_override id_aa64pfr0, ID_AA64PFR0_EL1_MPAM_SHIFT, .Linit_mpam_\@, .Lskip_mpam_\@, x1, x2
514514

515515
.Linit_mpam_\@:
516-
msr_s SYS_MPAM2_EL2, xzr // use the default partition
516+
mov x0, #MPAM2_EL2_EnMPAMSM_MASK
517+
msr_s SYS_MPAM2_EL2, x0 // use the default partition,
517518
// and disable lower traps
518519
mrs_s x0, SYS_MPAMIDR_EL1
519520
tbz x0, #MPAMIDR_EL1_HAS_HCR_SHIFT, .Lskip_mpam_\@ // skip if no MPAMHCR reg

0 commit comments

Comments
 (0)