[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANpmjNN2Jv=2AqH0ZbwrVwSG9XMzkyHGdhM6tYhoK5DokYbnig@mail.gmail.com>
Date: Mon, 14 Jun 2021 12:31:27 +0200
From: Marco Elver <elver@...gle.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: "the arch/x86 maintainers" <x86@...nel.org>,
Peter Oberparleiter <oberpar@...ux.ibm.com>,
LKML <linux-kernel@...r.kernel.org>, johannes.berg@...el.com,
Nick Desaulniers <ndesaulniers@...gle.com>,
Nathan Chancellor <nathan@...nel.org>,
Kees Cook <keescook@...omium.org>,
Mark Rutland <mark.rutland@....com>
Subject: Re: [PATCH] gcov,x86: Mark GCOV broken for x86
On Mon, 14 Jun 2021 at 12:17, Peter Zijlstra <peterz@...radead.org> wrote:
> As recently discovered, there is no function attribute to disable the
> -fprofile-generate instrumentation. As such, GCOV is fundamentally
> incompatible with architectures that rely on 'noinstr' for correctness.
GCOV today uses only -fprofile-arcs -ftest-coverage. But the problem
is the same: https://godbolt.org/z/fr9cs4sar
> Until such time as that compilers have added a function attribute to
> disable this instrumentation, mark GCOV as broken.
>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
> ---
> arch/x86/Kconfig | 2 +-
> kernel/gcov/Kconfig | 4 ++++
> 2 files changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> index 86dae426798b..c0f8c9d4c31a 100644
> --- a/arch/x86/Kconfig
> +++ b/arch/x86/Kconfig
> @@ -75,7 +75,7 @@ config X86
> select ARCH_HAS_FAST_MULTIPLIER
> select ARCH_HAS_FILTER_PGPROT
> select ARCH_HAS_FORTIFY_SOURCE
> - select ARCH_HAS_GCOV_PROFILE_ALL
> + select ARCH_HAS_GCOV_BROKEN
> select ARCH_HAS_KCOV if X86_64 && STACK_VALIDATION
> select ARCH_HAS_MEM_ENCRYPT
> select ARCH_HAS_MEMBARRIER_SYNC_CORE
> diff --git a/kernel/gcov/Kconfig b/kernel/gcov/Kconfig
> index 58f87a3092f3..74b028a66ebe 100644
> --- a/kernel/gcov/Kconfig
> +++ b/kernel/gcov/Kconfig
> @@ -1,10 +1,14 @@
> # SPDX-License-Identifier: GPL-2.0-only
> menu "GCOV-based kernel profiling"
>
> +config ARCH_HAS_GCOV_BROKEN
> + def_bool n
> +
> config GCOV_KERNEL
> bool "Enable gcov-based kernel profiling"
> depends on DEBUG_FS
> depends on !CC_IS_CLANG || CLANG_VERSION >= 110000
> + depends on !ARCH_HAS_GCOV_BROKEN
> select CONSTRUCTORS
> default n
> help
Powered by blists - more mailing lists