Skip to content

Commit 5a43320

Browse files
committed
Merge branches 'for-next/gcs', 'for-next/probes', 'for-next/asm-offsets', 'for-next/tlb', 'for-next/misc', 'for-next/mte', 'for-next/sysreg', 'for-next/stacktrace', 'for-next/hwcap3', 'for-next/kselftest', 'for-next/crc32', 'for-next/guest-cca', 'for-next/haft' and 'for-next/scs', remote-tracking branch 'arm64/for-next/perf' into for-next/core
* arm64/for-next/perf: perf: Switch back to struct platform_driver::remove() perf: arm_pmuv3: Add support for Samsung Mongoose PMU dt-bindings: arm: pmu: Add Samsung Mongoose core compatible perf/dwc_pcie: Fix typos in event names perf/dwc_pcie: Add support for Ampere SoCs ARM: pmuv3: Add missing write_pmuacr() perf/marvell: Marvell PEM performance monitor support perf/arm_pmuv3: Add PMUv3.9 per counter EL0 access control perf/dwc_pcie: Convert the events with mixed case to lowercase perf/cxlpmu: Support missing events in 3.1 spec perf: imx_perf: add support for i.MX91 platform dt-bindings: perf: fsl-imx-ddr: Add i.MX91 compatible drivers perf: remove unused field pmu_node * for-next/gcs: (42 commits) : arm64 Guarded Control Stack user-space support kselftest/arm64: Fix missing printf() argument in gcs/gcs-stress.c arm64/gcs: Fix outdated ptrace documentation kselftest/arm64: Ensure stable names for GCS stress test results kselftest/arm64: Validate that GCS push and write permissions work kselftest/arm64: Enable GCS for the FP stress tests kselftest/arm64: Add a GCS stress test kselftest/arm64: Add GCS signal tests kselftest/arm64: Add test coverage for GCS mode locking kselftest/arm64: Add a GCS test program built with the system libc kselftest/arm64: Add very basic GCS test program kselftest/arm64: Always run signals tests with GCS enabled kselftest/arm64: Allow signals tests to specify an expected si_code kselftest/arm64: Add framework support for GCS to signal handling tests kselftest/arm64: Add GCS as a detected feature in the signal tests kselftest/arm64: Verify the GCS hwcap arm64: Add Kconfig for Guarded Control Stack (GCS) arm64/ptrace: Expose GCS via ptrace and core files arm64/signal: Expose GCS state in signal frames arm64/signal: Set up and restore the GCS context for signal handlers arm64/mm: Implement map_shadow_stack() ... * for-next/probes: : Various arm64 uprobes/kprobes cleanups arm64: insn: Simulate nop instruction for better uprobe performance arm64: probes: Remove probe_opcode_t arm64: probes: Cleanup kprobes endianness conversions arm64: probes: Move kprobes-specific fields arm64: probes: Fix uprobes for big-endian kernels arm64: probes: Fix simulate_ldr*_literal() arm64: probes: Remove broken LDR (literal) uprobe support * for-next/asm-offsets: : arm64 asm-offsets.c cleanup (remove unused offsets) arm64: asm-offsets: remove PREEMPT_DISABLE_OFFSET arm64: asm-offsets: remove DMA_{TO,FROM}_DEVICE arm64: asm-offsets: remove VM_EXEC and PAGE_SZ arm64: asm-offsets: remove MM_CONTEXT_ID arm64: asm-offsets: remove COMPAT_{RT_,SIGFRAME_REGS_OFFSET arm64: asm-offsets: remove VMA_VM_* arm64: asm-offsets: remove TSK_ACTIVE_MM * for-next/tlb: : TLB flushing optimisations arm64: optimize flush tlb kernel range arm64: tlbflush: add __flush_tlb_range_limit_excess() * for-next/misc: : Miscellaneous patches arm64: tls: Fix context-switching of tpidrro_el0 when kpti is enabled arm64/ptrace: Clarify documentation of VL configuration via ptrace acpi/arm64: remove unnecessary cast arm64/mm: Change protval as 'pteval_t' in map_range() arm64: uprobes: Optimize cache flushes for xol slot acpi/arm64: Adjust error handling procedure in gtdt_parse_timer_block() arm64: fix .data.rel.ro size assertion when CONFIG_LTO_CLANG arm64/ptdump: Test both PTE_TABLE_BIT and PTE_VALID for block mappings arm64/mm: Sanity check PTE address before runtime P4D/PUD folding arm64/mm: Drop setting PTE_TYPE_PAGE in pte_mkcont() ACPI: GTDT: Tighten the check for the array of platform timer structures arm64/fpsimd: Fix a typo arm64: Expose ID_AA64ISAR1_EL1.XS to sanitised feature consumers arm64: Return early when break handler is found on linked-list arm64/mm: Re-organize arch_make_huge_pte() arm64/mm: Drop _PROT_SECT_DEFAULT arm64: Add command-line override for ID_AA64MMFR0_EL1.ECV arm64: head: Drop SWAPPER_TABLE_SHIFT arm64: cpufeature: add POE to cpucap_is_possible() arm64/mm: Change pgattr_change_is_safe() arguments as pteval_t * for-next/mte: : Various MTE improvements selftests: arm64: add hugetlb mte tests hugetlb: arm64: add mte support * for-next/sysreg: : arm64 sysreg updates arm64/sysreg: Update ID_AA64MMFR1_EL1 to DDI0601 2024-09 * for-next/stacktrace: : arm64 stacktrace improvements arm64: preserve pt_regs::stackframe during exec*() arm64: stacktrace: unwind exception boundaries arm64: stacktrace: split unwind_consume_stack() arm64: stacktrace: report recovered PCs arm64: stacktrace: report source of unwind data arm64: stacktrace: move dump_backtrace() to kunwind_stack_walk() arm64: use a common struct frame_record arm64: pt_regs: swap 'unused' and 'pmr' fields arm64: pt_regs: rename "pmr_save" -> "pmr" arm64: pt_regs: remove stale big-endian layout arm64: pt_regs: assert pt_regs is a multiple of 16 bytes * for-next/hwcap3: : Add AT_HWCAP3 support for arm64 (also wire up AT_HWCAP4) arm64: Support AT_HWCAP3 binfmt_elf: Wire up AT_HWCAP3 at AT_HWCAP4 * for-next/kselftest: (30 commits) : arm64 kselftest fixes/cleanups kselftest/arm64: Try harder to generate different keys during PAC tests kselftest/arm64: Don't leak pipe fds in pac.exec_sign_all() kselftest/arm64: Corrupt P0 in the irritator when testing SSVE 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 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 kselftest/arm64: Test signal handler state modification in fp-stress kselftest/arm64: Provide a SIGUSR1 handler in the kernel mode FP stress test kselftest/arm64: Implement irritators for ZA and ZT kselftest/arm64: Remove unused ADRs from irritator handlers kselftest/arm64: Correct misleading comments on fp-stress irritators kselftest/arm64: Poll less often while waiting for fp-stress children kselftest/arm64: Increase frequency of signal delivery in fp-stress kselftest/arm64: Fix encoding for SVE B16B16 test ... * for-next/crc32: : Optimise CRC32 using PMULL instructions arm64/crc32: Implement 4-way interleave using PMULL arm64/crc32: Reorganize bit/byte ordering macros arm64/lib: Handle CRC-32 alternative in C code * for-next/guest-cca: : Support for running Linux as a guest in Arm CCA arm64: Document Arm Confidential Compute virt: arm-cca-guest: TSM_REPORT support for realms arm64: Enable memory encrypt for Realms arm64: mm: Avoid TLBI when marking pages as valid arm64: Enforce bounce buffers for realm DMA efi: arm64: Map Device with Prot Shared arm64: rsi: Map unprotected MMIO as decrypted arm64: rsi: Add support for checking whether an MMIO is protected arm64: realm: Query IPA size from the RMM arm64: Detect if in a realm and set RIPAS RAM arm64: rsi: Add RSI definitions * for-next/haft: : Support for arm64 FEAT_HAFT arm64: pgtable: Warn unexpected pmdp_test_and_clear_young() arm64: Enable ARCH_HAS_NONLEAF_PMD_YOUNG arm64: Add support for FEAT_HAFT arm64: setup: name 'tcr2' register arm64/sysreg: Update ID_AA64MMFR1_EL1 register * for-next/scs: : Dynamic shadow call stack fixes arm64/scs: Drop unused prototype __pi_scs_patch_vmlinux() arm64/scs: Deal with 64-bit relative offsets in FDE frames arm64/scs: Fix handling of DWARF augmentation data in CIE/FDE frames
15 parents 845fd2c + 016d659 + ac4ad5c + 7bb32dc + a923705 + 67ab51c + 27879e8 + 0349934 + f260c44 + ddadbcd + 91a6533 + a6478d6 + 972d755 + b349a5a + 47965a4 commit 5a43320

File tree

166 files changed

+7089
-525
lines changed

Some content is hidden

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

166 files changed

+7089
-525
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/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: 35 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
-------------------------
@@ -411,6 +414,38 @@ Before jumping into the kernel, the following conditions must be met:
411414

412415
- HFGRWR_EL2.nPIRE0_EL1 (bit 57) must be initialised to 0b1.
413416

417+
- For CPUs with Guarded Control Stacks (FEAT_GCS):
418+
419+
- GCSCR_EL1 must be initialised to 0.
420+
421+
- GCSCRE0_EL1 must be initialised to 0.
422+
423+
- If EL3 is present:
424+
425+
- SCR_EL3.GCSEn (bit 39) must be initialised to 0b1.
426+
427+
- If EL2 is present:
428+
429+
- GCSCR_EL2 must be initialised to 0.
430+
431+
- If the kernel is entered at EL1 and EL2 is present:
432+
433+
- HCRX_EL2.GCSEn must be initialised to 0b1.
434+
435+
- HFGITR_EL2.nGCSEPP (bit 59) must be initialised to 0b1.
436+
437+
- HFGITR_EL2.nGCSSTR_EL1 (bit 58) must be initialised to 0b1.
438+
439+
- HFGITR_EL2.nGCSPUSHM_EL1 (bit 57) must be initialised to 0b1.
440+
441+
- HFGRTR_EL2.nGCS_EL1 (bit 53) must be initialised to 0b1.
442+
443+
- HFGRTR_EL2.nGCS_EL0 (bit 52) must be initialised to 0b1.
444+
445+
- HFGWTR_EL2.nGCS_EL1 (bit 53) must be initialised to 0b1.
446+
447+
- HFGWTR_EL2.nGCS_EL0 (bit 52) must be initialised to 0b1.
448+
414449
The requirements described above for CPU mode, caches, MMUs, architected
415450
timers, coherency and system registers apply to all CPUs. All CPUs must
416451
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

Documentation/arch/arm64/gcs.rst

Lines changed: 227 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,227 @@
1+
===============================================
2+
Guarded Control Stack support for AArch64 Linux
3+
===============================================
4+
5+
This document outlines briefly the interface provided to userspace by Linux in
6+
order to support use of the ARM Guarded Control Stack (GCS) feature.
7+
8+
This is an outline of the most important features and issues only and not
9+
intended to be exhaustive.
10+
11+
12+
13+
1. General
14+
-----------
15+
16+
* GCS is an architecture feature intended to provide greater protection
17+
against return oriented programming (ROP) attacks and to simplify the
18+
implementation of features that need to collect stack traces such as
19+
profiling.
20+
21+
* When GCS is enabled a separate guarded control stack is maintained by the
22+
PE which is writeable only through specific GCS operations. This
23+
stores the call stack only, when a procedure call instruction is
24+
performed the current PC is pushed onto the GCS and on RET the
25+
address in the LR is verified against that on the top of the GCS.
26+
27+
* When active the current GCS pointer is stored in the system register
28+
GCSPR_EL0. This is readable by userspace but can only be updated
29+
via specific GCS instructions.
30+
31+
* The architecture provides instructions for switching between guarded
32+
control stacks with checks to ensure that the new stack is a valid
33+
target for switching.
34+
35+
* The functionality of GCS is similar to that provided by the x86 Shadow
36+
Stack feature, due to sharing of userspace interfaces the ABI refers to
37+
shadow stacks rather than GCS.
38+
39+
* Support for GCS is reported to userspace via HWCAP_GCS in the aux vector
40+
AT_HWCAP2 entry.
41+
42+
* GCS is enabled per thread. While there is support for disabling GCS
43+
at runtime this should be done with great care.
44+
45+
* GCS memory access faults are reported as normal memory access faults.
46+
47+
* GCS specific errors (those reported with EC 0x2d) will be reported as
48+
SIGSEGV with a si_code of SEGV_CPERR (control protection error).
49+
50+
* GCS is supported only for AArch64.
51+
52+
* On systems where GCS is supported GCSPR_EL0 is always readable by EL0
53+
regardless of the GCS configuration for the thread.
54+
55+
* The architecture supports enabling GCS without verifying that return values
56+
in LR match those in the GCS, the LR will be ignored. This is not supported
57+
by Linux.
58+
59+
60+
61+
2. Enabling and disabling Guarded Control Stacks
62+
-------------------------------------------------
63+
64+
* GCS is enabled and disabled for a thread via the PR_SET_SHADOW_STACK_STATUS
65+
prctl(), this takes a single flags argument specifying which GCS features
66+
should be used.
67+
68+
* When set PR_SHADOW_STACK_ENABLE flag allocates a Guarded Control Stack
69+
and enables GCS for the thread, enabling the functionality controlled by
70+
GCSCRE0_EL1.{nTR, RVCHKEN, PCRSEL}.
71+
72+
* When set the PR_SHADOW_STACK_PUSH flag enables the functionality controlled
73+
by GCSCRE0_EL1.PUSHMEn, allowing explicit GCS pushes.
74+
75+
* When set the PR_SHADOW_STACK_WRITE flag enables the functionality controlled
76+
by GCSCRE0_EL1.STREn, allowing explicit stores to the Guarded Control Stack.
77+
78+
* Any unknown flags will cause PR_SET_SHADOW_STACK_STATUS to return -EINVAL.
79+
80+
* PR_LOCK_SHADOW_STACK_STATUS is passed a bitmask of features with the same
81+
values as used for PR_SET_SHADOW_STACK_STATUS. Any future changes to the
82+
status of the specified GCS mode bits will be rejected.
83+
84+
* PR_LOCK_SHADOW_STACK_STATUS allows any bit to be locked, this allows
85+
userspace to prevent changes to any future features.
86+
87+
* There is no support for a process to remove a lock that has been set for
88+
it.
89+
90+
* PR_SET_SHADOW_STACK_STATUS and PR_LOCK_SHADOW_STACK_STATUS affect only the
91+
thread that called them, any other running threads will be unaffected.
92+
93+
* New threads inherit the GCS configuration of the thread that created them.
94+
95+
* GCS is disabled on exec().
96+
97+
* The current GCS configuration for a thread may be read with the
98+
PR_GET_SHADOW_STACK_STATUS prctl(), this returns the same flags that
99+
are passed to PR_SET_SHADOW_STACK_STATUS.
100+
101+
* If GCS is disabled for a thread after having previously been enabled then
102+
the stack will remain allocated for the lifetime of the thread. At present
103+
any attempt to reenable GCS for the thread will be rejected, this may be
104+
revisited in future.
105+
106+
* It should be noted that since enabling GCS will result in GCS becoming
107+
active immediately it is not normally possible to return from the function
108+
that invoked the prctl() that enabled GCS. It is expected that the normal
109+
usage will be that GCS is enabled very early in execution of a program.
110+
111+
112+
113+
3. Allocation of Guarded Control Stacks
114+
----------------------------------------
115+
116+
* When GCS is enabled for a thread a new Guarded Control Stack will be
117+
allocated for it of half the standard stack size or 2 gigabytes,
118+
whichever is smaller.
119+
120+
* When a new thread is created by a thread which has GCS enabled then a
121+
new Guarded Control Stack will be allocated for the new thread with
122+
half the size of the standard stack.
123+
124+
* When a stack is allocated by enabling GCS or during thread creation then
125+
the top 8 bytes of the stack will be initialised to 0 and GCSPR_EL0 will
126+
be set to point to the address of this 0 value, this can be used to
127+
detect the top of the stack.
128+
129+
* Additional Guarded Control Stacks can be allocated using the
130+
map_shadow_stack() system call.
131+
132+
* Stacks allocated using map_shadow_stack() can optionally have an end of
133+
stack marker and cap placed at the top of the stack. If the flag
134+
SHADOW_STACK_SET_TOKEN is specified a cap will be placed on the stack,
135+
if SHADOW_STACK_SET_MARKER is not specified the cap will be the top 8
136+
bytes of the stack and if it is specified then the cap will be the next
137+
8 bytes. While specifying just SHADOW_STACK_SET_MARKER by itself is
138+
valid since the marker is all bits 0 it has no observable effect.
139+
140+
* Stacks allocated using map_shadow_stack() must have a size which is a
141+
multiple of 8 bytes larger than 8 bytes and must be 8 bytes aligned.
142+
143+
* An address can be specified to map_shadow_stack(), if one is provided then
144+
it must be aligned to a page boundary.
145+
146+
* When a thread is freed the Guarded Control Stack initially allocated for
147+
that thread will be freed. Note carefully that if the stack has been
148+
switched this may not be the stack currently in use by the thread.
149+
150+
151+
4. Signal handling
152+
--------------------
153+
154+
* A new signal frame record gcs_context encodes the current GCS mode and
155+
pointer for the interrupted context on signal delivery. This will always
156+
be present on systems that support GCS.
157+
158+
* The record contains a flag field which reports the current GCS configuration
159+
for the interrupted context as PR_GET_SHADOW_STACK_STATUS would.
160+
161+
* The signal handler is run with the same GCS configuration as the interrupted
162+
context.
163+
164+
* When GCS is enabled for the interrupted thread a signal handling specific
165+
GCS cap token will be written to the GCS, this is an architectural GCS cap
166+
with the token type (bits 0..11) all clear. The GCSPR_EL0 reported in the
167+
signal frame will point to this cap token.
168+
169+
* The signal handler will use the same GCS as the interrupted context.
170+
171+
* When GCS is enabled on signal entry a frame with the address of the signal
172+
return handler will be pushed onto the GCS, allowing return from the signal
173+
handler via RET as normal. This will not be reported in the gcs_context in
174+
the signal frame.
175+
176+
177+
5. Signal return
178+
-----------------
179+
180+
When returning from a signal handler:
181+
182+
* If there is a gcs_context record in the signal frame then the GCS flags
183+
and GCSPR_EL0 will be restored from that context prior to further
184+
validation.
185+
186+
* If there is no gcs_context record in the signal frame then the GCS
187+
configuration will be unchanged.
188+
189+
* If GCS is enabled on return from a signal handler then GCSPR_EL0 must
190+
point to a valid GCS signal cap record, this will be popped from the
191+
GCS prior to signal return.
192+
193+
* If the GCS configuration is locked when returning from a signal then any
194+
attempt to change the GCS configuration will be treated as an error. This
195+
is true even if GCS was not enabled prior to signal entry.
196+
197+
* GCS may be disabled via signal return but any attempt to enable GCS via
198+
signal return will be rejected.
199+
200+
201+
6. ptrace extensions
202+
---------------------
203+
204+
* A new regset NT_ARM_GCS is defined for use with PTRACE_GETREGSET and
205+
PTRACE_SETREGSET.
206+
207+
* The GCS mode, including enable and disable, may be configured via ptrace.
208+
If GCS is enabled via ptrace no new GCS will be allocated for the thread.
209+
210+
* Configuration via ptrace ignores locking of GCS mode bits.
211+
212+
213+
7. ELF coredump extensions
214+
---------------------------
215+
216+
* NT_ARM_GCS notes will be added to each coredump for each thread of the
217+
dumped process. The contents will be equivalent to the data that would
218+
have been read if a PTRACE_GETREGSET of the corresponding type were
219+
executed for each thread when the coredump was generated.
220+
221+
222+
223+
8. /proc extensions
224+
--------------------
225+
226+
* Guarded Control Stack pages will include "ss" in their VmFlags in
227+
/proc/<pid>/smaps.

Documentation/arch/arm64/index.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@ ARM64 Architecture
1010
acpi_object_usage
1111
amu
1212
arm-acpi
13+
arm-cca
1314
asymmetric-32bit
1415
booting
1516
cpu-feature-registers
1617
cpu-hotplug
1718
elf_hwcaps
19+
gcs
1820
hugetlbpage
1921
kdump
2022
legacy_instructions

0 commit comments

Comments
 (0)