Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4439672pxk; Wed, 30 Sep 2020 03:03:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw1kUC57TOxIZTDcnXxx8Ea57uj/48bOF7eVinVvteNML2nUWy+NvfBpt3PSVWcw9a8vJF/ X-Received: by 2002:aa7:ca17:: with SMTP id y23mr1861972eds.245.1601460195170; Wed, 30 Sep 2020 03:03:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601460195; cv=none; d=google.com; s=arc-20160816; b=d7X5b7M+y8W8RLrKh7it1/5yfW/AfN77cPRVxfFdY5SfX1+F3ufB8xsEy5TpxSxX0H OA3gxePdrQFIdjZ/6Iiyau0is+3nxGLuO4OYvyvM2Xa7Op3TF8KpW0rteNfnA05JNL+K NCop1WvK6GOVYLZvTgV6QgvJWmHAofOREjnBNj+WnLdYQsrDoEN/Bl+DpCqk2Ag+ve5p 4bCuDLqvXkHsnuyYaiHp70JOPBchpFEjJaatPMIpIzy3ie+dQWzYWZvzojVebt8R/1Ep W47Oq42sHnmGvglfVersTdmGHM28SsCTUmi1jhz6IFcEIQa3nqDjJx7KUiLeCDF/vWPw JGHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=IbhRizzE9YrxGNpdmNNM+IydyPkOixONYChtGLkGKMg=; b=RT9Kk52gy+qQzjWG7Vgah6AYcojXBQ5tPjepc1UsxQ6xNYvXHjJzkoFYVsNnMXq1es hgqSyOGYn1x1UnWxbVKaxOfd47s1EUBcpOsUMaa7ZDCPpqNULdJq/7lD5KOUEKSOmxvc +NvuL4HA6eUqWk8UOlCCHcfdDM8XmbEilQUcKOIq/cA9LSIQg2tUx+jbzD10CyIucy7X MhFbA5DVjWuJkn4m6VA9T6CR85plxMfGnJrPhZ4uTwPcc8FDwHj1ZfIRL1Xf/LvRIb5V F5jAlPwYC1/Hdaaz8frb6/HLhexv3U6Ohl9VBghQDuRA76RD4itHK+g4DCz+VjJoljzf jEGA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d5si661868eds.427.2020.09.30.03.02.50; Wed, 30 Sep 2020 03:03:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729188AbgI3J7O (ORCPT + 99 others); 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.