From patchwork Mon Oct 30 11:34:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Slaby X-Patchwork-Id: 13440507 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 171D1C4332F for ; Mon, 30 Oct 2023 11:34:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232427AbjJ3LeY (ORCPT ); Mon, 30 Oct 2023 07:34:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229456AbjJ3LeX (ORCPT ); Mon, 30 Oct 2023 07:34:23 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85658C2; Mon, 30 Oct 2023 04:34:21 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0A264C433C7; Mon, 30 Oct 2023 11:34:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698665661; bh=XBOZSHuoRoD8WSPEZTng3lqWdqh+3Xe2FMkuy6z6a5Y=; h=From:To:Cc:Subject:Date:From; b=h7FAyb6L9+v/tF5yELzcBvV8YRsztwzw7cEAW+REYwt+YuHpBEA1E5G5HybX0aB4H /tTM0Vje5C0dQvzg3m736p1/tVI02ubFMfaqlSA0/RirHr2WHX155UHkY+4j0HPgDd sTNChCTbF96Wj3i0V7e92or2k+M4uUh4W9oBbRXGRpEJvPQ9TPEQoi+t9drnIDAsjO 6p/x7Nh1CR6ZbvSvZrP17eRbuPh+exeiZfVrGOq4q1Xk8IrH4O55cPYgAmWUhYnEMH 425paWxK73OY9a31Kjnv/JUKh5aFni2E0yomCT6+vYMPwKo4L3wGxw7CwjCZ33syVS FvtPW4VgmxnQw== From: "Jiri Slaby (SUSE)" To: masahiroy@kernel.org Cc: linux-kernel@vger.kernel.org, "Jiri Slaby (SUSE)" , Nathan Chancellor , Nick Desaulniers , Nicolas Schier , linux-kbuild@vger.kernel.org, Naveen N Rao , Christophe Leroy , Michael Ellerman Subject: [PATCH] kbuild: dummy-tools: pretend we understand -fpatchable-function-entry Date: Mon, 30 Oct 2023 12:34:16 +0100 Message-ID: <20231030113416.5208-1-jirislaby@kernel.org> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org Commit 0f71dcfb4aef (powerpc/ftrace: Add support for -fpatchable-function-entry) added a script to check for -fpatchable-function-entry compiler support. The script expects compiler to emit the section __patchable_function_entries and few nops after a function entry. If the compiler understands and emits the above, CONFIG_ARCH_USING_PATCHABLE_FUNCTION_ENTRY is set. So teach dummy-tools' gcc about this. Signed-off-by: Jiri Slaby (SUSE) Cc: Masahiro Yamada Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: Nicolas Schier Cc: linux-kbuild@vger.kernel.org Cc: Naveen N Rao Cc: Christophe Leroy Cc: Michael Ellerman Reviewed-by: Nathan Chancellor --- scripts/dummy-tools/gcc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripts/dummy-tools/gcc b/scripts/dummy-tools/gcc index 07f6dc4c5cf6..e6c41427c02f 100755 --- a/scripts/dummy-tools/gcc +++ b/scripts/dummy-tools/gcc @@ -91,6 +91,16 @@ if arg_contain -S "$@"; then fi exit 0 fi + + # For arch/powerpc/tools/gcc-check-fpatchable-function-entry.sh + if arg_contain -m64 "$@" && arg_contain -fpatchable-function-entry=2 "$@"; then + echo "func:" + echo ".section __patchable_function_entries" + echo ".localentry" + echo " nop" + echo " nop" + exit 0 + fi fi # To set GCC_PLUGINS