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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0EA47C47DD9 for ; Sun, 25 Feb 2024 19:55:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc: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=GtSms9uWg5OHVj5VbYUCCi25JiO3RG6myLt9A5qpBU8=; b=ntu2C5yNvqxqIE VID/JJcbgatToMEBUfK8mMiDJJ+9RnB/KrN0c35fdeIOtcdySDtWni14uOYExN/WPvwrsJzWroiq5 pPHFAPC0SGfEd8Z+pEMIeAeu9W6F0asv8FtBo6Sv1W0H6KS8nJPJY4/+Ub9K0lOlDfSZ3Y+35su+E xjvHZpMmBHOG32LM6Xq8RA3RstlMPbDc8KaU0wuJInOwWFiHg0AvBtw9tLi6JXf21o4OrmpMUd1Fn bxOddyqG9nboELodNKcTV8ItMReLtS5hRIUSmmXvQVbMbAZJvgD/fhet289cHt3VLKxuijWbuXk5A IFFAjUmLYUok70ypmHng==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1reKaJ-0000000FbEJ-0SFF; Sun, 25 Feb 2024 19:54:51 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1reKaE-0000000FbDa-3cvD for linux-arm-kernel@lists.infradead.org; Sun, 25 Feb 2024 19:54:48 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 48A6B60C1B; Sun, 25 Feb 2024 19:54:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1D496C433C7; Sun, 25 Feb 2024 19:54:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708890881; bh=jf0UlHRKNCBdXsziVCahtzI/35nK15+b3hcYV4uM4/o=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=cxOV0CVhGndDjFDCod/+PSyPMXk6964dD6uDEMkTCMW9uwD88Ct03Ec6947ToevlF aZ5FSjf+i/vP+O0b7dC+7qLsZqNZzm8U0366rqWls7Dg4LLHN9BZRW6e7LHtWcYvdO g0XsXgFr+MglFksGClgh2w81zeH2kos0BS6q49TQclnxnXqbpTDE+hEZe7ISN4Koez dBr/rvCm2TJBJLaXze2k6QNXquspKKOaYaPvnGaiaEcbKLDotHo6hUyCJaTn8f0grX vXMxIpeyxSvSw0qfdcwSmSNMp0g8csgzrptw1k6lXk9YLNr1hDmUG0iV/Mqw+y9xy5 Ec0kzN0UTTgBw== Date: Sun, 25 Feb 2024 12:54:39 -0700 From: Nathan Chancellor To: Stephen Boyd Cc: Catalin Marinas , Will Deacon , linux-kernel@vger.kernel.org, patches@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Jason Ling , Florian Fainelli , Mark Rutland , Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev Subject: Re: [PATCH] arm64: ftrace: Don't forbid CALL_OPS+CC_OPTIMIZE_FOR_SIZE with Clang Message-ID: <20240225195439.GA2972471@dev-arch.thelio-3990X> References: <20240223064032.3463229-1-swboyd@chromium.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240223064032.3463229-1-swboyd@chromium.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240225_115447_011241_E65FC675 X-CRM114-Status: GOOD ( 20.56 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 On Thu, Feb 22, 2024 at 10:40:29PM -0800, Stephen Boyd wrote: > Per commit b3f11af9b2ce ("arm64: ftrace: forbid CALL_OPS with > CC_OPTIMIZE_FOR_SIZE"), GCC is silently ignoring `-falign-functions=N` > when passed `-Os`, causing functions to be improperly aligned. This > doesn't seem to be a problem with Clang though, where enabling CALL_OPS > with CC_OPTIMIZE_FOR_SIZE doesn't spit out any warnings at boot about > misaligned patch-sites. Only forbid CALL_OPS if GCC is used and we're > optimizing for size so that CALL_OPS can be used with clang optimizing > for size. > > Cc: Jason Ling > Cc: Florian Fainelli > Cc: Mark Rutland > Cc: Nathan Chancellor > Cc: Nick Desaulniers > Cc: Bill Wendling > Cc: Justin Stitt > Cc: > Fixes: b3f11af9b2ce ("arm64: ftrace: forbid CALL_OPS with CC_OPTIMIZE_FOR_SIZE") > Signed-off-by: Stephen Boyd Seems reasonable to me. Reviewed-by: Nathan Chancellor I wonder if that GCC issue is resolved with '-fmin-function-alignment' that is being introduced in GCC 14 [1]. If it is, I suspect this conditional could actually be CONFIG_CC_HAS_SANE_FUNCTION_ALIGNMENT instead of CONFIG_CC_IS_CLANG, but that can obviously happen as a clean up later down the road (more just food for thought for the arm64 folks, not sure how much '-Os' is used in general) [1]: https://git.kernel.org/masahiroy/linux-kbuild/c/5270316c9fec8cc99aa0e0a258509c5c7f789d12 > --- > arch/arm64/Kconfig | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig > index aa7c1d435139..6b96d75a3a3d 100644 > --- a/arch/arm64/Kconfig > +++ b/arch/arm64/Kconfig > @@ -198,7 +198,7 @@ config ARM64 > if DYNAMIC_FTRACE_WITH_ARGS && DYNAMIC_FTRACE_WITH_CALL_OPS > select HAVE_DYNAMIC_FTRACE_WITH_CALL_OPS \ > if (DYNAMIC_FTRACE_WITH_ARGS && !CFI_CLANG && \ > - !CC_OPTIMIZE_FOR_SIZE) > + (CC_IS_CLANG || !CC_OPTIMIZE_FOR_SIZE)) > select FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY \ > if DYNAMIC_FTRACE_WITH_ARGS > select HAVE_SAMPLE_FTRACE_DIRECT > > base-commit: 6613476e225e090cc9aad49be7fa504e290dd33d > -- > https://chromeos.dev > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel