From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0A72AC4727E for ; Wed, 30 Sep 2020 09:59:34 +0000 (UTC) Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.kernel.org (Postfix) with SMTP id 21C2C2075F for ; Wed, 30 Sep 2020 09:59:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 21C2C2075F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kernel-hardening-return-20065-kernel-hardening=archiver.kernel.org@lists.openwall.com Received: (qmail 20432 invoked by uid 550); 30 Sep 2020 09:59:26 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Received: (qmail 20397 invoked from network); 30 Sep 2020 09:59:25 -0000 Date: Wed, 30 Sep 2020 10:58:50 +0100 From: Mark Rutland To: Sami Tolvanen Cc: Masahiro Yamada , Will Deacon , Steven Rostedt , Peter Zijlstra , Greg Kroah-Hartman , "Paul E. McKenney" , Kees Cook , Nick Desaulniers , clang-built-linux@googlegroups.com, kernel-hardening@lists.openwall.com, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, x86@kernel.org Subject: Re: [PATCH v4 09/29] arm64: disable recordmcount with DYNAMIC_FTRACE_WITH_REGS Message-ID: <20200930095850.GA68612@C02TD0UTHF1T.local> References: <20200929214631.3516445-1-samitolvanen@google.com> <20200929214631.3516445-10-samitolvanen@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200929214631.3516445-10-samitolvanen@google.com> Hi Sami, On Tue, Sep 29, 2020 at 02:46:11PM -0700, Sami Tolvanen wrote: > Select FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY to disable > recordmcount when DYNAMIC_FTRACE_WITH_REGS is selected. Could you please add an explanation as to /why/ this is necessary in the commit message? I couldn't figure this out form the commit message alone, and reading the cover letter also didn't help. If the minimum required GCC version supports patchable-function-entry I'd be happy to make that a requirement for dynamic ftrace on arm64, as then we'd only need to support one mechanism, and can get rid of some redundant code. We already default to it when present anyhow. > > Signed-off-by: Sami Tolvanen > --- > arch/arm64/Kconfig | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig > index 6d232837cbee..ad522b021f35 100644 > --- a/arch/arm64/Kconfig > +++ b/arch/arm64/Kconfig > @@ -155,6 +155,8 @@ config ARM64 > select HAVE_DYNAMIC_FTRACE > select HAVE_DYNAMIC_FTRACE_WITH_REGS \ > if $(cc-option,-fpatchable-function-entry=2) > + select FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY \ > + if DYNAMIC_FTRACE_WITH_REGS This doesn't look quite right to me. Presumably we shouldn't allow DYNAMIC_FTRACE_WITH_REGS to be selected if HAVE_DYNAMIC_FTRACE_WITH_REGS isn't. Thanks, Mark.