Re: [PATCH] kcov: add __no_sanitize_coverage to fix noinstr for all architectures

From: Peter Zijlstra
Date: Wed May 26 2021 - 04:19:42 EST


On Tue, May 25, 2021 at 07:58:19PM +0200, Marco Elver wrote:
> Until now no compiler supported an attribute to disable coverage
> instrumentation as used by KCOV.
>
> To work around this limitation on x86, noinstr functions have their
> coverage instrumentation turned into nops by objtool. However, this
> solution doesn't scale automatically to other architectures, such as
> arm64, which are migrating to use the generic entry code.
>
> Clang [1] and GCC [2] have added support for the attribute recently.
> [1] https://github.com/llvm/llvm-project/commit/280333021e9550d80f5c1152a34e33e81df1e178
> [2] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=cec4d4a6782c9bd8d071839c50a239c49caca689
>
> Add __no_sanitize_coverage for both compilers, and add it to noinstr.
>
> Signed-off-by: Marco Elver <elver@xxxxxxxxxx>

W00t! Thanks guys!

Acked-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>