Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp2281572rdb; Wed, 21 Feb 2024 02:51:12 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVWtN3IVlJL/pUezlqGPkcIKhKYSJK56miBgA3X8fU6zg/Xz0xNfGWFHWLwNDPQfH0g5+gY1LFaOUcoZWDqffwJe73cSixDHUYuFrqLPw== X-Google-Smtp-Source: AGHT+IGiDd6PhrU6mSCyvpO5Qm3nhBdN/eUE1i7MxoLOyAYys4haUme6KDbsE0pmR+4nD8smWzkS X-Received: by 2002:a05:6a20:e30b:b0:1a0:8697:1e2d with SMTP id nb11-20020a056a20e30b00b001a086971e2dmr13073059pzb.16.1708512672487; Wed, 21 Feb 2024 02:51:12 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708512672; cv=pass; d=google.com; s=arc-20160816; b=T2mtswL8ia2nA4nC6QIAEzEaDwGlaUcdRt7boKIlhHXneGn2wtNV8dItCstusXRIEa neIf6s/lhG96XHor2o4YpYqUmSZwALYKQtYLVNh73JQ+z0IyIzWFJCjq3V//ISFeDsoG TVf/Ql9K7smL073e45mTsnaH6zfjWott31pKvbOcMs0WJ9fNXU3E/AtMh4evto4zKMp4 x4XMfJoC4UCvidnp00vyfAa+DFE83VYBeJLQvmeLEKE3V7L8neZf8P/w39DtF7STm3Gw lZSRU0pvCGkLWAs6bm4WTi90p3Pg2i3IaFdT56Iwxk/BMaS3Fmmg+Ts1hICsTtbKTqYQ frow== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=Q/UzevA48r62rgx/pHLzT8MztXtwX9AwwAIPqZ+3gm4=; fh=RDYOz78UXemdBX9XDIT3nIli3iyef4BlxMCT0RwwJyE=; b=OsUorclvRIkAdShxX7al4kbM7JpZTrQplXYHoXkzkq2G4ObU64JcjPoZp7EPOntDfS P1tKDXPdW8TjdmhN4MYNei+huhXMzgFzWfQVILxV6SOKG/eK7O1+RbsTH8z/aZgks+1V Xj1NT9ZGYmJGYX5NaMQvOGB9cBYfHh/CA4YWyjPIzhdg9M2R+ZioOeYqlHDS/1C9Gn2X lPKASUGmXNY5QM1Cy5BVbm8zXENZu+3FU/eowxQf1X3RTbHuI6bCssB+qaI5rIJuMWXm NNxkuaMbdoz9M7m+6ZuVGSYmOCHFbCTSgEzsPVG7NlbD13a3q7GJvwx+veKsBCc+0fWZ LiFg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-74566-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74566-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id cp7-20020a056a00348700b006e476398302si3579120pfb.20.2024.02.21.02.51.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 02:51:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-74566-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-74566-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74566-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 3597B283477 for ; Wed, 21 Feb 2024 10:51:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F01163CF6B; Wed, 21 Feb 2024 10:51:05 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AA86C5394; Wed, 21 Feb 2024 10:51:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708512665; cv=none; b=jvRLfFWNF7Gt5wai8oNw+Lw59lqVjcHSXF6lgfgwq2NHrHCT8ro1BQleReG3PSBkB0yU/9vsqntfrXGl+aaKzzULtDTOqXs0ALE5B1H7JPTkbKlP7pRjHcHNBF0LAEwuAzVfdv8f3rpoI1nkjzfnzflHww4RDdGoRCsBTIp6naY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708512665; c=relaxed/simple; bh=hxDqSBhDoWiFtrkpgug2oDEHEdiM9hC7r5lwdm3fopc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=kUWMNmzrYr6TcPbA9Tb3brQVbN8FwFszJPDMbi8Aue2+3vk4tWUqtHsDKE4eBDYNJ84HNHPHeHrI0cAv78fcAd0AnbsF2s+3zs4s30tl9LzfQLhnoi9vM4hVuSL7dN/vDNAlMM0wM0X9dphRvvaqCwpnLbVshEEpHSm518Os6jM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com 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 A8D0CFEC; Wed, 21 Feb 2024 02:51:41 -0800 (PST) Received: from FVFF77S0Q05N (unknown [10.57.65.90]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 214533F73F; Wed, 21 Feb 2024 02:51:02 -0800 (PST) Date: Wed, 21 Feb 2024 10:50:59 +0000 From: Mark Rutland To: Petr Pavlu Cc: masahiroy@kernel.org, nathan@kernel.org, nicolas@fjasle.eu, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] kbuild: Use -fmin-function-alignment when available Message-ID: References: <20240215151642.8970-1-petr.pavlu@suse.com> <1c6bb7d4-59bf-4887-8a0a-03373d3d9c11@suse.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1c6bb7d4-59bf-4887-8a0a-03373d3d9c11@suse.com> On Tue, Feb 20, 2024 at 04:28:23PM +0100, Petr Pavlu wrote: > On 2/19/24 18:20, Mark Rutland wrote: > > On Thu, Feb 15, 2024 at 04:16:42PM +0100, Petr Pavlu wrote: > >> GCC recently added option -fmin-function-alignment, which should appear > >> in GCC 14. Unlike -falign-functions, this option causes all functions to > >> be aligned at the specified value, including the cold ones. > >> > >> Detect availability of -fmin-function-alignment and use it instead of > >> -falign-functions when present. Introduce CC_HAS_SANE_FUNCTION_ALIGNMENT > >> and make the workarounds for the broken function alignment conditional > >> on this setting. > >> > >> Signed-off-by: Petr Pavlu > > > > I don't have a GCC 14 build to play with, but this looks sound to me. > > > > Petr, are you able to test an arm64 kernel with this and DYNAMIC_FTRACE > > enabled? i.e. build that, and check that function symbols are all aligned to 8 > > bytes using objdump or similar? That way we could be pretty sure there's no > > other latent issue in this area. > > I tested an arm64 kernel with DYNAMIC_FTRACE, in particular with > DYNAMIC_FTRACE_WITH_CALL_OPS=y. That is actually the primary motivation > for this patch. We ran in our environment into some incorrectly aligned > functions with this option despite the kernel workarounds. They were > reported as "Misaligned patch-site" warnings from ftrace_call_adjust(). > I don't observe them anymore with -fmin-function-alignment in my tests. > Sorry, I should have mentioned this motivation in the commit message. No problem; thanks for confirming! Mark.