Page MenuHomeFreeBSD

pt: Switch to swi(9)
ClosedPublic

Authored by bnovkov on Sep 11 2025, 5:08 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Oct 14, 2:52 AM
Unknown Object (File)
Tue, Oct 14, 2:52 AM
Unknown Object (File)
Mon, Oct 13, 1:30 PM
Unknown Object (File)
Thu, Oct 2, 6:31 PM
Unknown Object (File)
Sun, Sep 21, 2:05 PM
Unknown Object (File)
Sep 18 2025, 10:02 AM
Unknown Object (File)
Sep 11 2025, 7:58 PM
Unknown Object (File)
Sep 11 2025, 7:45 PM
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

Event Timeline

This revision was not accepted when it landed; it landed in state Needs Review.Fri, Oct 17, 9:23 PM
Closed by commit rG96d82d2d133a: pt: Switch to swi(9) (authored by bnovkov). · Explain Why
This revision was automatically updated to reflect the committed changes.