Skip to content

Commit ba1f9c8

Browse files
committed
Merge tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
Pull arm64 updates from Catalin Marinas: - Support for running Linux in a protected VM under the Arm Confidential Compute Architecture (CCA) - Guarded Control Stack user-space support. Current patches follow the x86 ABI of implicitly creating a shadow stack on clone(). Subsequent patches (already on the list) will add support for clone3() allowing finer-grained control of the shadow stack size and placement from libc - AT_HWCAP3 support (not running out of HWCAP2 bits yet but we are getting close with the upcoming dpISA support) - Other arch features: - In-kernel use of the memcpy instructions, FEAT_MOPS (previously only exposed to user; uaccess support not merged yet) - MTE: hugetlbfs support and the corresponding kselftests - Optimise CRC32 using the PMULL instructions - Support for FEAT_HAFT enabling ARCH_HAS_NONLEAF_PMD_YOUNG - Optimise the kernel TLB flushing to use the range operations - POE/pkey (permission overlays): further cleanups after bringing the signal handler in line with the x86 behaviour for 6.12 - arm64 perf updates: - Support for the NXP i.MX91 PMU in the existing IMX driver - Support for Ampere SoCs in the Designware PCIe PMU driver - Support for Marvell's 'PEM' PCIe PMU present in the 'Odyssey' SoC - Support for Samsung's 'Mongoose' CPU PMU - Support for PMUv3.9 finer-grained userspace counter access control - Switch back to platform_driver::remove() now that it returns 'void' - Add some missing events for the CXL PMU driver - Miscellaneous arm64 fixes/cleanups: - Page table accessors cleanup: type updates, drop unused macros, reorganise arch_make_huge_pte() and clean up pte_mkcont(), sanity check addresses before runtime P4D/PUD folding - Command line override for ID_AA64MMFR0_EL1.ECV (advertising the FEAT_ECV for the generic timers) allowing Linux to boot with firmware deployments that don't set SCTLR_EL3.ECVEn - ACPI/arm64: tighten the check for the array of platform timer structures and adjust the error handling procedure in gtdt_parse_timer_block() - Optimise the cache flush for the uprobes xol slot (skip if no change) and other uprobes/kprobes cleanups - Fix the context switching of tpidrro_el0 when kpti is enabled - Dynamic shadow call stack fixes - Sysreg updates - Various arm64 kselftest improvements * tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: (168 commits) arm64: tls: Fix context-switching of tpidrro_el0 when kpti is enabled kselftest/arm64: Try harder to generate different keys during PAC tests kselftest/arm64: Don't leak pipe fds in pac.exec_sign_all() arm64/ptrace: Clarify documentation of VL configuration via ptrace kselftest/arm64: Corrupt P0 in the irritator when testing SSVE acpi/arm64: remove unnecessary cast arm64/mm: Change protval as 'pteval_t' in map_range() kselftest/arm64: Fix missing printf() argument in gcs/gcs-stress.c kselftest/arm64: Add FPMR coverage to fp-ptrace kselftest/arm64: Expand the set of ZA writes fp-ptrace does kselftets/arm64: Use flag bits for features in fp-ptrace assembler code kselftest/arm64: Enable build of PAC tests with LLVM=1 kselftest/arm64: Check that SVCR is 0 in signal handlers selftests/mm: Fix unused function warning for aarch64_write_signal_pkey() kselftest/arm64: Fix printf() compiler warnings in the arm64 syscall-abi.c tests kselftest/arm64: Fix printf() warning in the arm64 MTE prctl() test kselftest/arm64: Fix printf() compiler warnings in the arm64 fp tests kselftest/arm64: Fix build with stricter assemblers arm64/scs: Drop unused prototype __pi_scs_patch_vmlinux() arm64/scs: Deal with 64-bit relative offsets in FDE frames ...
2 parents 9aa4c37 + 83ef4a3 commit ba1f9c8

File tree

214 files changed

+7914
-585
lines changed

Some content is hidden

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

214 files changed

+7914
-585
lines changed

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,9 @@
446446
arm64.nobti [ARM64] Unconditionally disable Branch Target
447447
Identification support
448448

449+
arm64.nogcs [ARM64] Unconditionally disable Guarded Control Stack
450+
support
451+
449452
arm64.nomops [ARM64] Unconditionally disable Memory Copy and Memory
450453
Set instructions support
451454

Documentation/admin-guide/perf/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,4 @@ Performance monitor support
2626
meson-ddr-pmu
2727
cxl
2828
ampere_cspmu
29+
mrvl-pem-pmu
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
=================================================================
2+
Marvell Odyssey PEM Performance Monitoring Unit (PMU UNCORE)
3+
=================================================================
4+
5+
The PCI Express Interface Units(PEM) are associated with a corresponding
6+
monitoring unit. This includes performance counters to track various
7+
characteristics of the data that is transmitted over the PCIe link.
8+
9+
The counters track inbound and outbound transactions which
10+
includes separate counters for posted/non-posted/completion TLPs.
11+
Also, inbound and outbound memory read requests along with their
12+
latencies can also be monitored. Address Translation Services(ATS)events
13+
such as ATS Translation, ATS Page Request, ATS Invalidation along with
14+
their corresponding latencies are also tracked.
15+
16+
There are separate 64 bit counters to measure posted/non-posted/completion
17+
tlps in inbound and outbound transactions. ATS events are measured by
18+
different counters.
19+
20+
The PMU driver exposes the available events and format options under sysfs,
21+
/sys/bus/event_source/devices/mrvl_pcie_rc_pmu_<>/events/
22+
/sys/bus/event_source/devices/mrvl_pcie_rc_pmu_<>/format/
23+
24+
Examples::
25+
26+
# perf list | grep mrvl_pcie_rc_pmu
27+
mrvl_pcie_rc_pmu_<>/ats_inv/ [Kernel PMU event]
28+
mrvl_pcie_rc_pmu_<>/ats_inv_latency/ [Kernel PMU event]
29+
mrvl_pcie_rc_pmu_<>/ats_pri/ [Kernel PMU event]
30+
mrvl_pcie_rc_pmu_<>/ats_pri_latency/ [Kernel PMU event]
31+
mrvl_pcie_rc_pmu_<>/ats_trans/ [Kernel PMU event]
32+
mrvl_pcie_rc_pmu_<>/ats_trans_latency/ [Kernel PMU event]
33+
mrvl_pcie_rc_pmu_<>/ib_inflight/ [Kernel PMU event]
34+
mrvl_pcie_rc_pmu_<>/ib_reads/ [Kernel PMU event]
35+
mrvl_pcie_rc_pmu_<>/ib_req_no_ro_ebus/ [Kernel PMU event]
36+
mrvl_pcie_rc_pmu_<>/ib_req_no_ro_ncb/ [Kernel PMU event]
37+
mrvl_pcie_rc_pmu_<>/ib_tlp_cpl_partid/ [Kernel PMU event]
38+
mrvl_pcie_rc_pmu_<>/ib_tlp_dwords_cpl_partid/ [Kernel PMU event]
39+
mrvl_pcie_rc_pmu_<>/ib_tlp_dwords_npr/ [Kernel PMU event]
40+
mrvl_pcie_rc_pmu_<>/ib_tlp_dwords_pr/ [Kernel PMU event]
41+
mrvl_pcie_rc_pmu_<>/ib_tlp_npr/ [Kernel PMU event]
42+
mrvl_pcie_rc_pmu_<>/ib_tlp_pr/ [Kernel PMU event]
43+
mrvl_pcie_rc_pmu_<>/ob_inflight_partid/ [Kernel PMU event]
44+
mrvl_pcie_rc_pmu_<>/ob_merges_cpl_partid/ [Kernel PMU event]
45+
mrvl_pcie_rc_pmu_<>/ob_merges_npr_partid/ [Kernel PMU event]
46+
mrvl_pcie_rc_pmu_<>/ob_merges_pr_partid/ [Kernel PMU event]
47+
mrvl_pcie_rc_pmu_<>/ob_reads_partid/ [Kernel PMU event]
48+
mrvl_pcie_rc_pmu_<>/ob_tlp_cpl_partid/ [Kernel PMU event]
49+
mrvl_pcie_rc_pmu_<>/ob_tlp_dwords_cpl_partid/ [Kernel PMU event]
50+
mrvl_pcie_rc_pmu_<>/ob_tlp_dwords_npr_partid/ [Kernel PMU event]
51+
mrvl_pcie_rc_pmu_<>/ob_tlp_dwords_pr_partid/ [Kernel PMU event]
52+
mrvl_pcie_rc_pmu_<>/ob_tlp_npr_partid/ [Kernel PMU event]
53+
mrvl_pcie_rc_pmu_<>/ob_tlp_pr_partid/ [Kernel PMU event]
54+
55+
56+
# perf stat -e ib_inflight,ib_reads,ib_req_no_ro_ebus,ib_req_no_ro_ncb <workload>

Documentation/arch/arm64/arm-cca.rst

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
.. SPDX-License-Identifier: GPL-2.0
2+
3+
=====================================
4+
Arm Confidential Compute Architecture
5+
=====================================
6+
7+
Arm systems that support the Realm Management Extension (RME) contain
8+
hardware to allow a VM guest to be run in a way which protects the code
9+
and data of the guest from the hypervisor. It extends the older "two
10+
world" model (Normal and Secure World) into four worlds: Normal, Secure,
11+
Root and Realm. Linux can then also be run as a guest to a monitor
12+
running in the Realm world.
13+
14+
The monitor running in the Realm world is known as the Realm Management
15+
Monitor (RMM) and implements the Realm Management Monitor
16+
specification[1]. The monitor acts a bit like a hypervisor (e.g. it runs
17+
in EL2 and manages the stage 2 page tables etc of the guests running in
18+
Realm world), however much of the control is handled by a hypervisor
19+
running in the Normal World. The Normal World hypervisor uses the Realm
20+
Management Interface (RMI) defined by the RMM specification to request
21+
the RMM to perform operations (e.g. mapping memory or executing a vCPU).
22+
23+
The RMM defines an environment for guests where the address space (IPA)
24+
is split into two. The lower half is protected - any memory that is
25+
mapped in this half cannot be seen by the Normal World and the RMM
26+
restricts what operations the Normal World can perform on this memory
27+
(e.g. the Normal World cannot replace pages in this region without the
28+
guest's cooperation). The upper half is shared, the Normal World is free
29+
to make changes to the pages in this region, and is able to emulate MMIO
30+
devices in this region too.
31+
32+
A guest running in a Realm may also communicate with the RMM using the
33+
Realm Services Interface (RSI) to request changes in its environment or
34+
to perform attestation about its environment. In particular it may
35+
request that areas of the protected address space are transitioned
36+
between 'RAM' and 'EMPTY' (in either direction). This allows a Realm
37+
guest to give up memory to be returned to the Normal World, or to
38+
request new memory from the Normal World. Without an explicit request
39+
from the Realm guest the RMM will otherwise prevent the Normal World
40+
from making these changes.
41+
42+
Linux as a Realm Guest
43+
----------------------
44+
45+
To run Linux as a guest within a Realm, the following must be provided
46+
either by the VMM or by a `boot loader` run in the Realm before Linux:
47+
48+
* All protected RAM described to Linux (by DT or ACPI) must be marked
49+
RIPAS RAM before handing control over to Linux.
50+
51+
* MMIO devices must be either unprotected (e.g. emulated by the Normal
52+
World) or marked RIPAS DEV.
53+
54+
* MMIO devices emulated by the Normal World and used very early in boot
55+
(specifically earlycon) must be specified in the upper half of IPA.
56+
For earlycon this can be done by specifying the address on the
57+
command line, e.g. with an IPA size of 33 bits and the base address
58+
of the emulated UART at 0x1000000: ``earlycon=uart,mmio,0x101000000``
59+
60+
* Linux will use bounce buffers for communicating with unprotected
61+
devices. It will transition some protected memory to RIPAS EMPTY and
62+
expect to be able to access unprotected pages at the same IPA address
63+
but with the highest valid IPA bit set. The expectation is that the
64+
VMM will remove the physical pages from the protected mapping and
65+
provide those pages as unprotected pages.
66+
67+
References
68+
----------
69+
[1] https://developer.arm.com/documentation/den0137/

Documentation/arch/arm64/booting.rst

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ to automatically locate and size all RAM, or it may use knowledge of
4141
the RAM in the machine, or any other method the boot loader designer
4242
sees fit.)
4343

44+
For Arm Confidential Compute Realms this includes ensuring that all
45+
protected RAM has a Realm IPA state (RIPAS) of "RAM".
46+
4447

4548
2. Setup the device tree
4649
-------------------------
@@ -385,6 +388,9 @@ Before jumping into the kernel, the following conditions must be met:
385388

386389
- HCRX_EL2.MSCEn (bit 11) must be initialised to 0b1.
387390

391+
- HCRX_EL2.MCE2 (bit 10) must be initialised to 0b1 and the hypervisor
392+
must handle MOPS exceptions as described in :ref:`arm64_mops_hyp`.
393+
388394
For CPUs with the Extended Translation Control Register feature (FEAT_TCR2):
389395

390396
- If EL3 is present:
@@ -411,6 +417,38 @@ Before jumping into the kernel, the following conditions must be met:
411417

412418
- HFGRWR_EL2.nPIRE0_EL1 (bit 57) must be initialised to 0b1.
413419

420+
- For CPUs with Guarded Control Stacks (FEAT_GCS):
421+
422+
- GCSCR_EL1 must be initialised to 0.
423+
424+
- GCSCRE0_EL1 must be initialised to 0.
425+
426+
- If EL3 is present:
427+
428+
- SCR_EL3.GCSEn (bit 39) must be initialised to 0b1.
429+
430+
- If EL2 is present:
431+
432+
- GCSCR_EL2 must be initialised to 0.
433+
434+
- If the kernel is entered at EL1 and EL2 is present:
435+
436+
- HCRX_EL2.GCSEn must be initialised to 0b1.
437+
438+
- HFGITR_EL2.nGCSEPP (bit 59) must be initialised to 0b1.
439+
440+
- HFGITR_EL2.nGCSSTR_EL1 (bit 58) must be initialised to 0b1.
441+
442+
- HFGITR_EL2.nGCSPUSHM_EL1 (bit 57) must be initialised to 0b1.
443+
444+
- HFGRTR_EL2.nGCS_EL1 (bit 53) must be initialised to 0b1.
445+
446+
- HFGRTR_EL2.nGCS_EL0 (bit 52) must be initialised to 0b1.
447+
448+
- HFGWTR_EL2.nGCS_EL1 (bit 53) must be initialised to 0b1.
449+
450+
- HFGWTR_EL2.nGCS_EL0 (bit 52) must be initialised to 0b1.
451+
414452
The requirements described above for CPU mode, caches, MMUs, architected
415453
timers, coherency and system registers apply to all CPUs. All CPUs must
416454
enter the kernel in the same exception level. Where the values documented

Documentation/arch/arm64/elf_hwcaps.rst

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ architected discovery mechanism available to userspace code at EL0. The
1616
kernel exposes the presence of these features to userspace through a set
1717
of flags called hwcaps, exposed in the auxiliary vector.
1818

19-
Userspace software can test for features by acquiring the AT_HWCAP or
20-
AT_HWCAP2 entry of the auxiliary vector, and testing whether the relevant
21-
flags are set, e.g.::
19+
Userspace software can test for features by acquiring the AT_HWCAP,
20+
AT_HWCAP2 or AT_HWCAP3 entry of the auxiliary vector, and testing
21+
whether the relevant flags are set, e.g.::
2222

2323
bool floating_point_is_present(void)
2424
{
@@ -170,6 +170,10 @@ HWCAP_PACG
170170
ID_AA64ISAR1_EL1.GPI == 0b0001, as described by
171171
Documentation/arch/arm64/pointer-authentication.rst.
172172

173+
HWCAP_GCS
174+
Functionality implied by ID_AA64PFR1_EL1.GCS == 0b1, as
175+
described by Documentation/arch/arm64/gcs.rst.
176+
173177
HWCAP2_DCPODP
174178
Functionality implied by ID_AA64ISAR1_EL1.DPB == 0b0010.
175179

0 commit comments

Comments
 (0)