Re: [PATCH v2 11/20] objtool: Detect code coverage instrumentation in noinstr code
From: Josh Poimboeuf
Date: Thu Nov 12 2026 - 01:23:58 EST
On Mon, Nov 02, 2026 at 08:52:29PM -0500, Sasha Levin wrote:
> gcov and Clang's source-based code coverage update their counters
> inline, rather than by calling into a runtime like KCOV does, so
> coverage instrumentation in noinstr code goes unnoticed by the noinstr
> validation of call destinations.
>
> Flag instructions in noinstr code, outside of instrumentation_begin()
> and instrumentation_end() sections, that reference coverage counters:
> GCC's __gcov<N>.* counters (including the MC/DC counters), Clang's gcov
> __llvm_gcov_ctr* counters, and the __llvm_prf_cnts and __llvm_prf_bits
> sections of Clang's source-based code coverage.
What exactly is the problem with noinstr code incrementing counters
inline?
--
Josh