From: D Scott Phillips <scott@os.amperecomputing.com>
To: Mark Brown <broonie@kernel.org>
Cc: linux-arm-kernel@lists.infradead.org,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
Darren Hart <darren@os.amperecomputing.com>
Subject: Re: Panic when loading modules with CONFIG_ARM64_BTI_KERNEL
Date: Thu, 18 Aug 2022 09:22:39 -0700 [thread overview]
Message-ID: <861qtd4j3k.fsf@scott-ph-mail.amperecomputing.com> (raw)
In-Reply-To: <Yv5ZCjnSVgy7qXDv@sirena.org.uk>
Mark Brown <broonie@kernel.org> writes:
> On Wed, Aug 17, 2022 at 04:42:43PM -0700, D Scott Phillips wrote:
>
>> In the meantime, should we mark BTI_KERNEL as broken? or any other ideas
>
> The clang versions I have to hand appear fine with your userspace test
> program, it emits a BTI C at the start of func with -O1 so I guess
> that'd only be for GCC. Ideally we'd be able to detect particular
> configurations that would trigger this but I don't think we can.
Good point, it looks like LLVM is specifically aware that veneers might
get added and so inserts `bti c` at the start of *all* functions IIUC:
https://github.com/llvm/llvm-project/blob/main/llvm/lib/Target/AArch64/AArch64BranchTargets.cpp#L80
> // Even in cases where a function has internal linkage and is only
> // called directly in its translation unit, it can still be called
> // indirectly if the linker decides to add a thunk to it for whatever
> // reason (say, for example, if it is finally placed far from its call
> // site and a BL is not long-range enough).
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
prev parent reply other threads:[~2022-08-18 16:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-17 23:42 Panic when loading modules with CONFIG_ARM64_BTI_KERNEL D Scott Phillips
2022-08-18 15:21 ` Mark Brown
2022-08-18 16:22 ` D Scott Phillips [this message]
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=861qtd4j3k.fsf@scott-ph-mail.amperecomputing.com \
--to=scott@os.amperecomputing.com \
--cc=broonie@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=darren@os.amperecomputing.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=will@kernel.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;
as well as URLs for NNTP newsgroup(s).