From: Marco Elver Date: Wed, 2 Jun 2021 03:53:15 +0000 (+1000) Subject: kcov: add __no_sanitize_coverage to fix noinstr for all architectures X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=37991d08f860577c79624e8cb0bf4272924ad19c;p=users%2Fjedix%2Flinux-maple.git kcov: add __no_sanitize_coverage to fix noinstr for all architectures add comment explaining __has_feature() in Clang Link: https://lkml.kernel.org/r/20210527194448.3470080-1-elver@google.com Signed-off-by: Marco Elver Acked-by: Peter Zijlstra (Intel) Reviewed-by: Miguel Ojeda Signed-off-by: Andrew Morton Signed-off-by: Stephen Rothwell --- diff --git a/include/linux/compiler-clang.h b/include/linux/compiler-clang.h index e15eebfa8e5d4..49b0ac8b6fd32 100644 --- a/include/linux/compiler-clang.h +++ b/include/linux/compiler-clang.h @@ -13,6 +13,12 @@ /* all clang versions usable with the kernel support KASAN ABI version 5 */ #define KASAN_ABI_VERSION 5 +/* + * Note: Checking __has_feature(*_sanitizer) is only true if the feature is + * enabled. Therefore it is not required to additionally check defined(CONFIG_*) + * to avoid adding redundant attributes in other configurations. + */ + #if __has_feature(address_sanitizer) || __has_feature(hwaddress_sanitizer) /* Emulate GCC's __SANITIZE_ADDRESS__ flag */ #define __SANITIZE_ADDRESS__