Page MenuHomeFreeBSD

hwpmc: add regression tests for counting-PMC counter wraparound
ClosedPublic

Authored by netchild on Sun, Jul 19, 12:15 PM.
Tags
Referenced Files
F165246678: D58341.id182210.diff
Fri, Aug 7, 3:48 AM
Unknown Object (File)
Sun, Aug 2, 6:28 AM
Unknown Object (File)
Sun, Aug 2, 5:00 AM
Unknown Object (File)
Sun, Aug 2, 2:48 AM
Unknown Object (File)
Sat, Aug 1, 6:11 AM
Unknown Object (File)
Thu, Jul 30, 10:46 PM
Unknown Object (File)
Tue, Jul 28, 3:54 PM
Unknown Object (File)
Mon, Jul 27, 10:42 PM
Subscribers

Details

Summary

Exercise a process-mode counting PMC whose accumulated count crosses,
or already exceeds, the range of the underlying hardware counter.
Before the previous commit, the first context switch after the
hardware counter wrapped panicked INVARIANTS kernels with "negative
increment" and silently corrupted the accumulated count on other
kernels.

The tests need a hardware counting event backed by a counter narrower
than 64 bits and skip where none is available (hwpmc(4) not loaded,
or a VM without a vPMU).

MFC after: 2 weeks
Assisted-by: Claude Code (Fable 5)

Diff Detail

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