linux-kbuild.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Cc: masahiroy@kernel.org, linux-kernel@vger.kernel.org,
	Nick Desaulniers <ndesaulniers@google.com>,
	Nicolas Schier <nicolas@fjasle.eu>,
	linux-kbuild@vger.kernel.org, Naveen N Rao <naveen@kernel.org>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Michael Ellerman <mpe@ellerman.id.au>
Subject: Re: [PATCH] kbuild: dummy-tools: pretend we understand -fpatchable-function-entry
Date: Tue, 31 Oct 2023 09:09:22 -0700	[thread overview]
Message-ID: <20231031160922.GA995893@dev-arch.thelio-3990X> (raw)
In-Reply-To: <20231030113416.5208-1-jirislaby@kernel.org>

On Mon, Oct 30, 2023 at 12:34:16PM +0100, Jiri Slaby (SUSE) wrote:
> 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) <jirislaby@kernel.org>
> Cc: Masahiro Yamada <masahiroy@kernel.org>
> Cc: Nathan Chancellor <nathan@kernel.org>
> Cc: Nick Desaulniers <ndesaulniers@google.com>
> Cc: Nicolas Schier <nicolas@fjasle.eu>
> Cc: linux-kbuild@vger.kernel.org
> Cc: Naveen N Rao <naveen@kernel.org>
> Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
> Cc: Michael Ellerman <mpe@ellerman.id.au>
> ---

This seems reasonable to me. I did not test it but it seems like it
should work based on my reading of gcc-check-fpatchable-function-entry.sh.

Reviewed-by: Nathan Chancellor <nathan@kernel.org>

One minor nit, there should be quotes around the subject of 0f71dcfb4aef
in the commit message, should there need to be a v2 for some reason.

>  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
> -- 
> 2.42.0
> 

  reply	other threads:[~2023-10-31 16:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-30 11:34 [PATCH] kbuild: dummy-tools: pretend we understand -fpatchable-function-entry Jiri Slaby (SUSE)
2023-10-31 16:09 ` Nathan Chancellor [this message]
2023-11-01 14:30 ` Masahiro Yamada

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231031160922.GA995893@dev-arch.thelio-3990X \
    --to=nathan@kernel.org \
    --cc=christophe.leroy@csgroup.eu \
    --cc=jirislaby@kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=mpe@ellerman.id.au \
    --cc=naveen@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=nicolas@fjasle.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).