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 9B519C4727F for ; Wed, 30 Sep 2020 09:59:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6DBFC2076E for ; Wed, 30 Sep 2020 09:59:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729215AbgI3J7O (ORCPT ); Wed, 30 Sep 2020 05:59:14 -0400 Received: from foss.arm.com ([217.140.110.172]:33026 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728235AbgI3J7O (ORCPT ); Wed, 30 Sep 2020 05:59:14 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 47BA9D6E; Wed, 30 Sep 2020 02:59:13 -0700 (PDT) Received: from C02TD0UTHF1T.local (unknown [10.57.48.174]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C3E9A3F70D; Wed, 30 Sep 2020 02:59:09 -0700 (PDT) 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> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 EB5E8C4727F for ; Wed, 30 Sep 2020 10:00:44 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7045D2075F for ; Wed, 30 Sep 2020 10:00:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="gJkD5X5x" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7045D2075F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=NyeI0clptCqQpkvHuCU0d6hKbWmI83zRy+IEzBuA1Ro=; b=gJkD5X5xhUpbWHzSTaH4QqPB5 Op8h0qcosIQo7yclaav2c+bPLXGtWxpI3apelJfsJjp9Op2ZHeNIFN+9UKGppYCVJCgrL6sj14oDC oS8h0Bj3zO9FihgzuMEinGVQGcupwmcQanL8OBjIQ00Zt26PJOAE7N0knFQ9CDTvuUFyY5grDjlcN 9A/3DxftfTKDP9E+kw1rc0K3Hpt8DkVANp9y7hjKyTYo8vl2EdrunhVOgKV9br3dH2lOsrFpRfkuS 3SLZXm4vFHnUYSojegnJomhpxEFQywKPTQ0RSDKGGLkJEt3c5SU9W78K270BXgKRdbyRunha3NwOI 6vkY5DpKQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kNYtK-0002bG-0d; Wed, 30 Sep 2020 09:59:18 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kNYtG-0002a7-Hy for linux-arm-kernel@lists.infradead.org; Wed, 30 Sep 2020 09:59:15 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 47BA9D6E; Wed, 30 Sep 2020 02:59:13 -0700 (PDT) Received: from C02TD0UTHF1T.local (unknown [10.57.48.174]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C3E9A3F70D; Wed, 30 Sep 2020 02:59:09 -0700 (PDT) Date: Wed, 30 Sep 2020 10:58:50 +0100 From: Mark Rutland To: Sami Tolvanen 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-Disposition: inline In-Reply-To: <20200929214631.3516445-10-samitolvanen@google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200930_055914_676562_AA3C90CB X-CRM114-Status: GOOD ( 19.02 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, x86@kernel.org, Kees Cook , "Paul E. McKenney" , kernel-hardening@lists.openwall.com, Peter Zijlstra , Greg Kroah-Hartman , Masahiro Yamada , linux-kbuild@vger.kernel.org, Nick Desaulniers , linux-kernel@vger.kernel.org, Steven Rostedt , clang-built-linux@googlegroups.com, linux-pci@vger.kernel.org, Will Deacon , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel