Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2391667lqp; Sun, 24 Mar 2024 17:23:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXgeLMXmAnMjgwZGO5q5YwFcRzLK1dSrkfkiPBMP7td7syPO5x671jQxlZq8ZDumttcXavHvJgnbJAuaf2On2r6UiVfHXEpOB+9ko4A7Q== X-Google-Smtp-Source: AGHT+IE+KA29IDoUV53zKkaS+eCGFo0qYkriC3afNkkHQJAY64Zc9lIaEbwDWLM/7WwszgYUG2Xw X-Received: by 2002:a81:9e48:0:b0:611:2e1b:22ee with SMTP id n8-20020a819e48000000b006112e1b22eemr3229822ywj.30.1711326236222; Sun, 24 Mar 2024 17:23:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711326236; cv=pass; d=google.com; s=arc-20160816; b=r2CnIa/2NxV6nIFy07oJq1njDqfcJ6G3poai1bHu5J3uGL1KPhXbpE6YShbOgNqaV/ /KezJSQIKTI+zSsrpktUmbwwy0exLeW74GIlRxZ2uvFLjSxsERvaxMrPLo8TQOQzgdya Bm5grnryjZDwclvOCuaqtW9SqXBApSUdb4yTSW7dhRGRST3zjgWq7yhL3Zv/GIjbvWP9 9hxxAL4PoN91RSP1gE4OTFR+fkRxrOXS5gnJQAnIQ9f/slpvGTlvlMtuz90UQkZo9rFh o8s1NYaHkXwNt4QyNvPSLibmfVBp8JvCiMM4eHe/9LkWw81uDKhQ2PmD6QtAFpa3wZgE a3vg== 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=ZEezaTCtzJxpYy4H5aAC6rqbNlc7hHvZX6Jmfnlt8+4=; fh=OvKsFpdCouH7q+FqF8lZAMGpAvoM8Nq6wp9OxGn1wIE=; b=VgLSaDAy1o6qn5cXWxsXG1xnfPlO6dbeFIF95kFuZHnRSu08drNzUFv+i85c+afTKE TQiouVCS6AVXHhCS4ASGpDgLpqeedpMdIgj4SavljnFwn7hsjK3duUUy/jw4h3BOreaG aFspxTZqVCVukxGqjavdeUC0a45SD6Y3SJVgo7DpdGRTBeGvlgWHZ0qzEp2I+UCGuZPc oq/YHmPl4E4tFxTO/u0sVO2gmwYPQpSawu5TISQ5TrsAWknSCnD2LZw7wKbgFEgc3kha 1enMCDA7HaHaNsWanLbx0lJryqsacGAenlsb74kPkVIB8iMi6q87rq5Bz3qJAftep6WU 6U4A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DE4S6xqA; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113385-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113385-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id h21-20020a37de15000000b0078a40127b4esi4277308qkj.33.2024.03.24.17.23.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 17:23:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-113385-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DE4S6xqA; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113385-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113385-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id EEAAB1C23923 for ; Mon, 25 Mar 2024 00:23:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 379621A132A; Sun, 24 Mar 2024 22:43:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="DE4S6xqA" 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 5078F1A130F; Sun, 24 Mar 2024 22:43:07 +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=1711320187; cv=none; b=WSzoE55l5b1Rez/wZpW4xWCcjzqubwfdR6/+zbhJWq1xrRPS9/6y9ipvn3epILNPhbndo/mcr35OuInv75j1vB8MLqSKlIg4V59UeOyVAGptZyJHLe3tkS73Xi7+J2h0GQH0iqaiX+n3zMfDOeOphN85iZqL/FUcf1syXQluMOg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320187; c=relaxed/simple; bh=FaMMzGF3uDIogoO+PFY/77q0D1RR1vmlPJX2EYNM7/Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kaZ+njZ/W22tfo5NV3xJHp2OH3bdilwO3OW3DcEGtwDgMNtRBBZXt5B4z+XIxE8NVOXYENxptO4KoS7h3B+O1RNwvBJXEGz+8Q9ZLasj2E03HfKufL12TWBoZ/zedyuYKwkSj+KOlqkS9WE1aScAzYl/tl6560/a4sFC8KQCfpU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=DE4S6xqA; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 92B4DC433F1; Sun, 24 Mar 2024 22:43:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711320187; bh=FaMMzGF3uDIogoO+PFY/77q0D1RR1vmlPJX2EYNM7/Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DE4S6xqAkE3eelOI1OQmdgbRaZlt2XdUjR6Wbp05UACfPzOLpFmmnVnzQjdAptqGq vluMOS1rrhXLKEggqfK261+TkUuwav8agKMBzHQ3axX+rWjllQ+Btp07o86SO+87YD kY42WNJ3N/p4tqu3yAA4xQRkaX7GMuPbL93aOHSIm4abdqeiutWvoSHdUCkYqTtBH2 4jN2H39b83t4oyJZMPB0Q0ekNZY9+Mqr8n3Xgm6spvYEEFGQcq53DjYOzAUcG86N1E gHDw37hpvdwVgJgDIkVTp0PglJTsB33C3oR47dT50ah4vFiCDUOie00eIQ3f8nZ58j QFpfKv/DinMkA== 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.8 494/715] arm64: ftrace: Don't forbid CALL_OPS+CC_OPTIMIZE_FOR_SIZE with Clang Date: Sun, 24 Mar 2024 18:31:13 -0400 Message-ID: <20240324223455.1342824-495-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324223455.1342824-1-sashal@kernel.org> References: <20240324223455.1342824-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 aa7c1d4351396..6b96d75a3a3d8 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 -- 2.43.0