Page MenuHomeFreeBSD

kmsan: avoid false reports while processing NMIs
Needs ReviewPublic

Authored by chs on Thu, Sep 24, 12:09 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Oct 14, 2:07 AM
Unknown Object (File)
Tue, Oct 13, 10:55 PM
Unknown Object (File)
Sun, Oct 11, 9:31 AM
Unknown Object (File)
Mon, Oct 5, 1:40 AM
Unknown Object (File)
Sun, Oct 4, 8:55 PM
Unknown Object (File)
Sat, Oct 3, 7:49 AM
Unknown Object (File)
Fri, Oct 2, 10:57 AM
Unknown Object (File)
Thu, Oct 1, 10:06 AM
Subscribers
None

Details

Reviewers
imp
kib
markj
jhb
Summary

The NMI asm path needs two KMSAN hooks to avoid false reports:

  • KMSAN_INIT_ARG clears the parameter shadow for calling an instrumented C function from asm code
  • KMSAN_MARK_TRAPFRAME marks a trapframe that was initialized in asm code as initialized.

Sponsored by: Netflix
Assisted-By: Claude Code - Opus 5 (1M context)

Diff Detail

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

Event Timeline

chs requested review of this revision.Thu, Sep 24, 12:09 AM
chs created this revision.
sys/amd64/amd64/exception.S
879

Why are we doing this here? We're either about to return back to the interrupted context via iret, or we're going to call pmc_hook. In the latter case, the trapframe has already been marked by the trap() call above.