HomeFreeBSD

arm64: write PID in CONTEXTIDR_EL1 on ctx switch

Description

arm64: write PID in CONTEXTIDR_EL1 on ctx switch

Debug and trace features such as Statistical Profiling Extension (SPE)
use the CONTEXTIDR_EL1 register to get the PID of the current process.

Add a sysctl switch to toggle writing the current PID into this register
in the thread switcher.

To make use of the feature, the following sysctl switch must be set:

sysctl machdep.pid_in_contextidr=1

Kernel code can also toggle the sysctl by writing directly to the global
var behind the sysctl arm64_pid_in_contextidr:

extern bool arm64_pid_in_contextidr;

Sponsored by: Arm Ltd

Details

Provenance
zachary.leaf_arm.comAuthored on Jul 31 2024, 8:23 AM
andrewCommitted on Oct 21 2024, 12:23 PM
Parents
rG9707243a04ac: arm64: Remove a duplicated include
Branches
Unknown
Tags
Unknown