public inbox for linux-trace-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mark Rutland <mark.rutland@arm.com>
To: Florent Revest <revest@chromium.org>
Cc: "GONG, Ruiqi" <gongruiqi@huaweicloud.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org,
	gongruiqi1@huawei.com
Subject: Re: [PATCH] samples: ftrace: replace bti assembly with hint for older compiler
Date: Mon, 21 Aug 2023 17:04:50 +0100	[thread overview]
Message-ID: <ZOOLIsVkwk40X_Ex@FVFF77S0Q05N> (raw)
In-Reply-To: <CABRcYmJkt3AYL1T57415JBLa7kT9LWuWx-oGZf5Lvn9nskyhSw@mail.gmail.com>

On Mon, Aug 21, 2023 at 05:41:21PM +0200, Florent Revest wrote:
> On Sun, Aug 20, 2023 at 1:10 PM GONG, Ruiqi <gongruiqi@huaweicloud.com> wrote:
> >
> > When cross-building the arm64 kernel with allmodconfig using GCC 9.4,
> > the following error occurs on multiple files under samples/ftrace/:
> >
> > /tmp/ccPC1ODs.s: Assembler messages:
> > /tmp/ccPC1ODs.s:8: Error: selected processor does not support `bti c'
> >
> > Fix this issue by replacing `bti c` with `hint 34`, which is compatible
> > for the older compiler.
> 
> I see this hint is already used in
> tools/testing/selftests/arm64/fp/rdvl.S but I'm curious why it isn't
> used in other parts of the kernel like
> arch/arm64/kernel/entry-ftrace.S or
> tools/testing/selftests/arm64/bti/syscall.S

For assembly files, the macro in arch/arm64/include/asm/assembler.h handles
this automatically. See commit:

  9be34be87cc8d1af ("arm64: Add macro version of the BTI instruction")

For inline asembly, we need to explicitly instantiate all of that in the inline
asm block, and since clang treats each asm block independently, we can'y just
define that in one place in a header somewhere.

I'll reply to the patch in a sec...

Mark.

  reply	other threads:[~2023-08-21 16:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-20 11:15 [PATCH] samples: ftrace: replace bti assembly with hint for older compiler GONG, Ruiqi
2023-08-21 15:34 ` Steven Rostedt
2023-08-21 15:41 ` Florent Revest
2023-08-21 16:04   ` Mark Rutland [this message]
2023-08-21 16:12 ` Mark Rutland

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=ZOOLIsVkwk40X_Ex@FVFF77S0Q05N \
    --to=mark.rutland@arm.com \
    --cc=gongruiqi1@huawei.com \
    --cc=gongruiqi@huaweicloud.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=revest@chromium.org \
    --cc=rostedt@goodmis.org \
    /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