Page MenuHomeFreeBSD

pt: Switch to swi(9)
ClosedPublic

Authored by bnovkov on Sep 11 2025, 5:08 PM.
Tags
None
Referenced Files
F156504815: D52491.id.diff
Thu, May 14, 5:29 AM
Unknown Object (File)
Mon, May 11, 10:51 AM
Unknown Object (File)
Tue, May 5, 5:33 AM
Unknown Object (File)
Mon, May 4, 12:25 PM
Unknown Object (File)
Tue, Apr 28, 11:11 PM
Unknown Object (File)
Tue, Apr 28, 11:05 PM
Unknown Object (File)
Mon, Apr 27, 1:32 PM
Unknown Object (File)
Mon, Apr 27, 9:23 AM
Subscribers

Details

Summary

The pt hwt(4) backend uses NMIs to receive updates about the latest t
racing buffer offsets from the tracing hardware. However, it uses
taskqueue(9) to schedule the bottom-half handler. This can lead to
a panic since the taskqueue(9) code isn't aware it's being called
from an NMI context and uses the regular scheduling interfaces.

Fix this by scheduling the bottom-half handler using swi(9) and the
SWI_FROMNMI flag.

Fixes: 310162ea218a

Test Plan

Tested by tracing a full buildkernel run on an Intel i3-7100 CPU.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable