Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2600970lqp; Mon, 25 Mar 2024 04:10:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWqPKYgeEAHMQdVSUJpwwdPvLlH4r5mCu5Ju4kd+WKP7FEgKmIRvaKGBkCTwmyNOmZJaW+zR8UywiX4/XEtEvNRNBHkCZSAWWuZATXLEA== X-Google-Smtp-Source: AGHT+IFpBP6XwM9/Ej7x2PwKLn8xX7f+AiD0TrJcfiSTVDqPz8+FeaxrHJLT5G20V27RthyywMXW X-Received: by 2002:a17:906:3888:b0:a47:325e:f88f with SMTP id q8-20020a170906388800b00a47325ef88fmr4751597ejd.61.1711365015337; Mon, 25 Mar 2024 04:10:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711365015; cv=pass; d=google.com; s=arc-20160816; b=OC/76qDL7HPVKbILdLs3KnSVu7NG5RA3dVuWoLhU1ty4R4DYrW/pTf7cri/N1LL9eq eyZvsVBHtPzPTI6UuHr+GiOnP8IOfN2pouroelYYdUdycC6Fw8fhItz3zh626wXm0J7L vfRSu3ZbRT67DPynySISd6R3ptpXnDbJXCFThGAmXAQ0KYa7pPZYiq2+K9PFtWwwoXq5 0DCJ+hGcAt9y4tFBGQYUiS5G0AAzgZOuVqD/Z8p5pKxN4f3WhuxFlgshhsVjBpl4oOFv 43dBo/H0sZG6QDFUVZRpXc8cz4RRnwNEFjUDxR1yDKRlUoV5hElE9m1pqaRQamFUJ5wR 3nHw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=UiauEC20+R/jg1AHUh+onSKlGEz7K4Da/hVcs32f1mQ=; fh=OvKsFpdCouH7q+FqF8lZAMGpAvoM8Nq6wp9OxGn1wIE=; b=rPsN8kTgwYyfMdqTyDw04qY0oT2GnoK7/kUoKWqVxx15fU0qZA81xAhmFbfMzMX1zD L9l1hOfkhQV946c25K5JKQv585suHQPEl2h3x9ddPsOx+q+RTLrdVjoEu1yla4zUwEJQ i4t+cbzi3UeXLqL6WMU1ia+BhMRMVul6mpr6q1f1XV+pf39MnTM4T30Z7MjBuAszRb7u noSeaL422oYhA2jP2jte0n6rdke3Bof/PMZp45FhN+7C4gXxZgLKrGE0pNe5swuqDAT1 8FpSHCy2VJMMXsAC2YO+ecDTMTN+zrTtEI8+p1k0qWyLopuHSSYTWvSPopU3VTFccMHY Zbsw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JVIIpM4w; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-115512-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-115512-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id qb3-20020a1709077e8300b00a46fbde0609si2400406ejc.335.2024.03.25.04.10.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 04:10:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-115512-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JVIIpM4w; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-115512-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-115512-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 16E1E1F35383 for ; Mon, 25 Mar 2024 11:10:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DF24223B463; Mon, 25 Mar 2024 02:42:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="JVIIpM4w" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A8AD512B149; Sun, 24 Mar 2024 22:55:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320960; cv=none; b=soUwGek/ITaPcd45Z4D26iC7xJG3Ilc6WKF9PjAQwZ+APC7Ovdx6J9d5XbDE08AdDVBkowh7p39SQYKWXOJfMUhj7GcITWkRkLooQ8ovw1RWsFcoZHbWdtfrb3/wfkNLT031S32Isr8dBKFeMGB4OnEuDi8jOZOGrGY7TDezk7c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320960; c=relaxed/simple; bh=T3a0S8GHT7cG9hx4OybyIirFOKGjhTGdg1Ua7OZ6jOc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DYvlHwHuJ3bydbt1+QUIsIStNa5m920BQYrbE6/UE0h2IGsj/7Co+3t1/3r7vXx2TgAI4ZoKct9SbTjZFa5OhXEeB+y9vx78CBMOiNSzLRnxJCQ0eobJpTkdUlihgcZmdy49Dc3c6bbg/aDL9qQg+8DXyUe/x5/9lWN4b6y/kUw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=JVIIpM4w; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3039DC433F1; Sun, 24 Mar 2024 22:55:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711320959; bh=T3a0S8GHT7cG9hx4OybyIirFOKGjhTGdg1Ua7OZ6jOc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JVIIpM4wPaqWhC3ySWdGxawrCMnTH9u1XgxQDfnnl4EajJtAqRT/fOe73ChU9cw3q fdNubMNCY5pXkikWmZWvX72U+rQE20cZu+nnrDSD7w8TAVyDJ+bnvtQmCLwtpo9GD2 22C9KxNdWIdBukhDz81ymRcnb0Mrc9dyH5ed8s+/8oqIqfPe+tcnPG/zZEYPP0+M+/ fOF5KTgT0zI6FSnj8h2YoXW7+fQLskTnReHaqf32w1IFsS6WPTjpIOD4tcuCR5oVf0 B3wqOQWaY8cergo8qaRJlzH8AYIU89qw4y6+nZhlCUZ3KErOh/a5hEyszBP/w9jOOr iD2YQ0fKU8Prg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Stephen Boyd , Jason Ling , Florian Fainelli , Mark Rutland , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, Catalin Marinas , Sasha Levin Subject: [PATCH 6.7 522/713] arm64: ftrace: Don't forbid CALL_OPS+CC_OPTIMIZE_FOR_SIZE with Clang Date: Sun, 24 Mar 2024 18:44:08 -0400 Message-ID: <20240324224720.1345309-523-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324224720.1345309-1-sashal@kernel.org> References: <20240324224720.1345309-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Stephen Boyd [ Upstream commit a743f26d03a96593c0f3d05dc26b388f45de67c9 ] 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: llvm@lists.linux.dev Fixes: b3f11af9b2ce ("arm64: ftrace: forbid CALL_OPS with CC_OPTIMIZE_FOR_SIZE") Signed-off-by: Stephen Boyd Reviewed-by: Nathan Chancellor Link: https://lore.kernel.org/r/20240223064032.3463229-1-swboyd@chromium.org Signed-off-by: Catalin Marinas Signed-off-by: Sasha Levin --- arch/arm64/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 456e8680e16ea..77dfbc8ab2d3b 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -196,7 +196,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 -- 2.43.0