From patchwork Fri Feb 23 06:40:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 13568579 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 72F28C48BC4 for ; Fri, 23 Feb 2024 06:41:05 +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:MIME-Version:Message-ID:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=tCERaXsU5QHEi7urwc076QOef6KFETWlgrVbKTg1afs=; b=Ws7WAg8rPah15c z8KZefBEkE+ymi1ZkxEaP72IHsTAHLMrnWLm/NIk1v2dRGqFTAHm9xuJ3CEYoSrZdDjtrMVL3lkP2 J3beDV4qBkQIBxtAnJUq6YKDzNsW6Ejx1tSWzGXbQco6l41jy1EmLJQOO3Zukk8j13b4hXPUeLElb UEZdySUZUD/Er8bcoJyodUdYnI2V3eZdwwLT85HDtjliv5N80H/EXXxzf8H00gJavluOe9ts+p1Rf 4H7b15IU5i3DhwC0EEb0G5BeaIMW5z3d56S1/Xz/ObEyXIQSv6j4coqV05A8uiUs2wMltFxgXX2SQ kcAzIV9YgfnJju09jnRQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rdPEn-00000008CpB-10VD; Fri, 23 Feb 2024 06:40:49 +0000 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rdPEd-00000008ClQ-0VCV for linux-arm-kernel@lists.infradead.org; Fri, 23 Feb 2024 06:40:40 +0000 Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-6e457fab0e2so392458b3a.0 for ; Thu, 22 Feb 2024 22:40:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1708670434; x=1709275234; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=VlAxTgaIbiVQpF/ZQwxp07S3UGXkKE5YGd7hWgHUVZY=; b=ASe5IpH4hKtXeNLrEE8wPdPoiatc/Ttt1CxM6X6VxCmvFJ9FsetJIEk8lTW+v1yEiW OnUCMKlXJo2EN+PdlzOJ4qstYa39QWPXydkm+r7CesQxIAHclCfS2B84JO4uqQdMEf5l G4cnoE/NmNBJrazFH7XxDdUDwcnC94ZcnmAHQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708670434; x=1709275234; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=VlAxTgaIbiVQpF/ZQwxp07S3UGXkKE5YGd7hWgHUVZY=; b=w8lrwp09b0ypJE0OmtBLrcqHLPxsZ3K8HF6RCaINYX58jxZ/Dvt23LrkUEErQymfHn N2e0WNkuNLAM7WZrHPJDP0x6d+P2Va5r3k5ycCxVZYcOGnvQKTK3C0cOKFX+hq6+qXHy SUZ0DVtp4izT/Q8WHEFsxoFXM3fY4tRXwJ7Q3uhN/P1smzzUGDmoS8/v9JuzMAYL/7bV zucMpWSfUvxGDvaeTfAEiXXnox7ukhI+ZbdrBF6tdC4XaP80Zh5pgTOpW1k2jb0yObgA mZZ9vv+Hf1T8sAgPkqGLViwvxHLjVOj2RmFhpgk6ZBgHv/78NeaRaF6q3lJBvprwODvU Sf0g== X-Forwarded-Encrypted: i=1; AJvYcCUcy53Zy2OLQq8p9TH8R2uqR8PwjdXr42zJDqRp4amXJNzwjm+uow4Ojqkr0dPMBZxxWCuqwwtAgSKHQdXoNPGWuZ/o8J03iAl1Z18U+IoYGd/Qlnc= X-Gm-Message-State: AOJu0YxyctzOLAZn4+OF1pkHEAhDA35vzvxmmNnwrbvntGAhVFIscv8o DDBYP9Shbot0pcZEWE8Uci8w9dKyZyZjHLI4IAz8g3zs17/q24pp5x6TTFuiNQ== X-Google-Smtp-Source: AGHT+IH4UFzwgV0g9dgBCvcLiwOp8510IaCSr0SQ/rg50PPnqosFI2z6O/vgddexixApZQrnaAjOmw== X-Received: by 2002:a05:6a00:4307:b0:6e4:5ff9:f037 with SMTP id cb7-20020a056a00430700b006e45ff9f037mr2262350pfb.12.1708670434104; Thu, 22 Feb 2024 22:40:34 -0800 (PST) Received: from localhost (175.199.125.34.bc.googleusercontent.com. [34.125.199.175]) by smtp.gmail.com with UTF8SMTPSA id fm18-20020a056a002f9200b006e484e13454sm5653680pfb.32.2024.02.22.22.40.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 22 Feb 2024 22:40:33 -0800 (PST) From: Stephen Boyd To: Catalin Marinas , Will Deacon Cc: linux-kernel@vger.kernel.org, patches@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Jason Ling , Florian Fainelli , Mark Rutland , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev Subject: [PATCH] arm64: ftrace: Don't forbid CALL_OPS+CC_OPTIMIZE_FOR_SIZE with Clang Date: Thu, 22 Feb 2024 22:40:29 -0800 Message-ID: <20240223064032.3463229-1-swboyd@chromium.org> X-Mailer: git-send-email 2.44.0.rc0.258.g7320e95886-goog MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240222_224039_224882_ABFAAFA2 X-CRM114-Status: GOOD ( 13.46 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 Reviewed-by: Nathan Chancellor --- arch/arm64/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) base-commit: 6613476e225e090cc9aad49be7fa504e290dd33d 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