Page MenuHomeFreeBSD

arm64: write PID in CONTEXTIDR_EL1 on ctx switch
AcceptedPublic

Authored by zachary.leaf_arm.com on Jul 31 2024, 10:11 AM.
Tags
None
Referenced Files
F93339103: D46192.id141589.diff
Mon, Sep 9, 1:02 AM
F93308115: D46192.id.diff
Sun, Sep 8, 8:20 PM
Unknown Object (File)
Sat, Sep 7, 12:45 AM
Unknown Object (File)
Fri, Sep 6, 11:26 AM
Unknown Object (File)
Sun, Sep 1, 11:43 PM
Unknown Object (File)
Thu, Aug 29, 5:13 PM
Unknown Object (File)
Aug 4 2024, 5:42 PM
Unknown Object (File)
Aug 3 2024, 6:27 PM
Subscribers

Details

Reviewers
andrew
manu
Group Reviewers
arm64
Summary

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

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 59140
Build 56027: arc lint + arc unit