Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3469713pxu; Mon, 30 Nov 2020 04:02:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJwnIL4ou4n0/XWjfsOuKOBvq83IfgA85BM6cqqX4/euSiLwQ3QZfv1/3m8eYmXSACZlh8lQ X-Received: by 2002:a05:6402:18:: with SMTP id d24mr20811819edu.382.1606737760919; Mon, 30 Nov 2020 04:02:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606737760; cv=none; d=google.com; s=arc-20160816; b=oORFzZYYIbqEKH4/sfcABRVj4tDY3VAnIo9YyqP1YxZFvDwpLlg0x1NrSq0qbLKMio FU7IfJddsRjDHDeaOZZP1EdnZVqTPPbCXsFBLtG5TngDbyLTkcd2+XF36osUywXC0BG6 xRrsolYD8Q2TGgqT0wMHlXxOoBCdnjJbExZcgfehvCAPaoCgQ6Qkwv/D79k2Z8V+qVqf jC6/K3wmsl952C0E1jazbq2M1gLhsVP/hK0ht7KhhwG515UhiXrOcH8Q8y/HOMMnb7Uy 38xEXk7bK4nfJPGuCrW3sjUEm9xbRgi2dYIRu+m0hfGeYBBizeBWuvhnKvTEuqPu7zfx 5vsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=hxtkXbr0g+dT0LfMHfb5ox8uWdYh+0Bde9KSCO4jyFc=; b=ugHZa3DNXJ2caoSREwbQV8p0x2BEqmJs2SWk6vzhRfNIWkp/vcPGNFGQ3t9t/JQRtk SGfdX2FCAMV4CIlFRN2F+xyti/fyR+4tmFNrByssZu7Xp1q1lh7HsWSjA3iykvxD3Tda DNwcf7EVcSyQYqX2JGZG2iGr5zgbtf2Om9kw2b38cdTYUz5dOUYPT9RVbU2CFjJXT3C+ PfXH1Uz7wIX2/yOZfkzmcJzvopRYU601QRA6832/gf1ZwPIoTO/c2mk5pMZjqjxFCdD5 kG9EfNM5mxcWt4gYcQNkruq+u4mglFTXsBe+W+aGHiOOa6T+okPobJXWDDbyTHVRJmEX ymBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="XbGPLq/G"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b11si4061844edr.398.2020.11.30.04.02.14; Mon, 30 Nov 2020 04:02:40 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b="XbGPLq/G"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728531AbgK3L7v (ORCPT + 99 others); Mon, 30 Nov 2020 06:59:51 -0500 Received: from mail.kernel.org ([198.145.29.99]:34376 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728039AbgK3L7u (ORCPT ); Mon, 30 Nov 2020 06:59:50 -0500 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D62772073C; Mon, 30 Nov 2020 11:59:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1606737549; bh=jcKRnTY2A7tTxLUEBA4FhjDB78+vG8Uu58hBCNu3Qs8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XbGPLq/Gdk/ASCNBy/7/E3wrn5zqLDESpvoy2UNHGZHuuXFZQPCXO7FbliCo+KTjL dcpgEk4JxaUXIYiMKN86igCiutZADLzLXf9whER7tpQ4rNqnS6qJKWRrApd0RwpCLA mDCVfehaZ+02umT+yBR6tKxGFcK/pkEQRrCuPSVg= Date: Mon, 30 Nov 2020 11:59:03 +0000 From: Will Deacon To: Sami Tolvanen Cc: Masahiro Yamada , Steven Rostedt , Josh Poimboeuf , 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 Subject: Re: [PATCH v7 16/17] arm64: disable recordmcount with DYNAMIC_FTRACE_WITH_REGS Message-ID: <20201130115902.GD24563@willie-the-truck> References: <20201118220731.925424-1-samitolvanen@google.com> <20201118220731.925424-17-samitolvanen@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201118220731.925424-17-samitolvanen@google.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 18, 2020 at 02:07:30PM -0800, Sami Tolvanen wrote: > DYNAMIC_FTRACE_WITH_REGS uses -fpatchable-function-entry, which makes > running recordmcount unnecessary as there are no mcount calls in object > files, and __mcount_loc doesn't need to be generated. > > While there's normally no harm in running recordmcount even when it's > not strictly needed, this won't work with LTO as we have LLVM bitcode > instead of ELF objects. > > This change selects FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY, which > disables recordmcount when patchable function entries are used instead. > > 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 1515f6f153a0..c7f07978f5b6 100644 > --- a/arch/arm64/Kconfig > +++ b/arch/arm64/Kconfig > @@ -158,6 +158,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 I don't really understand why this is in the arch header file, rather than have the core code check for "fpatchable-function-entry=2" and expose a CC_HAS_PATCHABLE_FUNCTION_ENTRY, but in the interest of making some progress on this series: Acked-by: Will Deacon Will