seL4/include
Hesham Almatary d40bad3a9a aarch64,fpu,hyp: do not trap CPACR_EL1 acceses
The AArch64 FPU trap helpers were modifying both CPTR_EL2.TFP and
CPTR_EL2.TCPAC when enabling or disabling FPU trapping. However, only
TFP controls trapping of FP/SIMD instructions from EL0/EL1 to EL2.

TCPAC traps accesses to CPACR_EL1 and is unrelated to FPU instruction
execution. Trapping CPACR_EL1 is unnecessary for seL4’s FPU handling
and can interfere with other architectural features that are
controlled via CPACR_EL1.

In particular, CPACR_EL1 is an Architectural Feature Access Control
Register and is not limited to FP/SIMD. For example, Morello uses
CPACR_EL1.CEN to enable CHERI instructions. Trapping CPACR_EL1 via
TCPAC would therefore require special handling or could break guests
that legitimately modify CPACR_EL1 for non-FPU features.

Since seL4 only needs to trap FP/SIMD instructions if FPU is disabled
per TCB/VM, it is sufficient to control CPTR_EL2.TFP alone. Remove the
modification of TCPAC from enableTrapFpu()/disableTrapFpu() and leave
CPACR_EL1 accesses untrapped.

This aligns the implementation with the architectural intent of the
AArch64 FP/SIMD trapping model and avoids assuming that CPACR_EL1 is
used solely for FPU control.

See Issue #1601 for more context and discussion.

Signed-off-by: Hesham Almatary <hesham.almatary@cl.cam.ac.uk>
2026-03-10 12:19:42 +00:00
..
32/mode Bump minimum CMake version 2025-02-26 17:11:57 +11:00
64/mode Bump minimum CMake version 2025-02-26 17:11:57 +11:00
api treewide: typo fixes 2025-04-14 12:05:16 +10:00
arch aarch64,fpu,hyp: do not trap CPACR_EL1 acceses 2026-03-10 12:19:42 +00:00
benchmark benchmark: config opt. name to enable log buffer 2022-03-31 08:56:06 +11:00
drivers Add support for the Banana Pi BPI-F3 2025-11-27 20:01:07 +01:00
fastpath reply: do not assume replyObject NULL invariant 2025-02-10 15:53:08 +11:00
kernel Disable clock sync test on QEMU RISC-V 2025-11-20 16:24:55 +11:00
machine machine: move setIRQTrigger into interrupt.h 2025-10-10 14:36:43 +11:00
model FPU: ksCurFPUOwner instead of ksActiveFPUState 2025-07-24 16:44:08 +10:00
object mcs: refactor finaliseCap to ease verification 2026-02-16 14:13:14 +11:00
plat treewide: typo fixes 2025-04-14 12:05:16 +10:00
smp arm: Add new APIs for generating SGIs 2025-07-07 08:50:47 +10:00
api.h replacing all ifndef with pargma once 2020-03-23 11:04:46 +11:00
assert.h debug: use c99 standard instead of gcc extensions 2023-11-16 12:09:52 +00:00
basic_types.h boot: document region types 2023-04-12 15:07:02 +10:00
bootinfo.h boot: Remove constant BI_FRAME_SIZE_BITS 2023-08-23 15:10:32 +02:00
compound_types.h trivial: remove superfluous empty lines 2021-09-27 23:09:09 +10:00
config.h libsel4: Fix name for AARCH64_VSPACE_S2_START_L1 2021-09-06 08:08:54 +10:00
hardware.h boot: simplify boot code recycling 2023-08-13 09:04:26 +10:00
linker.h replacing all ifndef with pargma once 2020-03-23 11:04:46 +11:00
machine.h re-use existing functions to avoid redundancy 2022-09-15 11:25:04 +02:00
object.h trivial: remove duplicate headers 2022-02-05 15:30:25 +11:00
stdarg.h trivial: remove superfluous empty lines 2021-09-27 23:09:09 +10:00
stdint.h print 64-bit integers on 32-bits systems fully 2021-11-26 06:01:11 +01:00
string.h trivial: remove superfluous empty lines 2021-09-27 23:09:09 +10:00
types.h trivial: remove superfluous empty lines 2021-09-27 23:09:09 +10:00
util.h util: provide FNSPEC for __unreachable 2025-10-10 14:36:43 +11:00