From: Andrew Pinski <pinskia@gmail.com>
To: Sudakshina Das <Sudi.Das@arm.com>
Cc: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>,
nd <nd@arm.com>, James Greenhalgh <James.Greenhalgh@arm.com>,
Richard Earnshaw <Richard.Earnshaw@arm.com>,
Marcus Shawcroft <Marcus.Shawcroft@arm.com>
Subject: Re: [PATCH, GCC, AARCH64, 5/6] Enable BTI : Add new pass for BTI.
Date: Wed, 17 Aug 2022 17:00:17 -0700 [thread overview]
Message-ID: <CA+=Sn1=4Ze46m14nigJyBxauuJxosOSEosGUJT4f18tqQahUvA@mail.gmail.com> (raw)
In-Reply-To: <f99c2918-0d71-271f-6a70-156f8d02486b@arm.com>
On Fri, Nov 2, 2018 at 11:39 AM Sudakshina Das <Sudi.Das@arm.com> wrote:
>
> Hi
>
> This patch is part of a series that enables ARMv8.5-A in GCC and
> adds Branch Target Identification Mechanism.
> (https://developer.arm.com/products/architecture/cpu-architecture/a-profile/exploration-tools)
>
> This patch adds a new pass called "bti" which is triggered by the
> command line argument -mbranch-protection whenever "bti" is turned on.
>
> The pass iterates through the instructions and adds appropriated BTI
> instructions based on the following:
> * Add a new "BTI C" at the beginning of a function, unless its already
> protected by a "PACIASP/PACIBSP". We exempt the functions that are
> only called directly.
Coming back to this because the check only_called_directly_p does not
work if the linker will insert a veneer as the compiler does not know
about that.
This is recorded as https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106671 .
Thanks,
Andrew Pinski
> * Add a new "BTI J" for every target of an indirect jump, jump table
> targets, non-local goto targets or labels that might be referenced
> by variables, constant pools, etc (NOTE_INSN_DELETED_LABEL)
>
> Since we have already changed the use of indirect tail calls to only x16
> and x17, we do not have to use "BTI JC".
> (check patch 3/6).
>
> Bootstrapped and regression tested with aarch64-none-linux-gnu. Added
> new tests.
> Is this ok for trunk?
>
> Thanks
> Sudi
>
> *** gcc/ChangeLog ***
>
> 2018-xx-xx Sudakshina Das <sudi.das@arm.com>
> Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
>
> * config.gcc (aarch64*-*-*): Add aarch64-bti-insert.o.
> * gcc/config/aarch64/aarch64.h: Update comment for
> TRAMPOLINE_SIZE.
> * config/aarch64/aarch64.c (aarch64_asm_trampoline_template):
> Update if bti is enabled.
> * config/aarch64/aarch64-bti-insert.c: New file.
> * config/aarch64/aarch64-passes.def (INSERT_PASS_BEFORE): Insert
> bti pass.
> * config/aarch64/aarch64-protos.h (make_pass_insert_bti):
> Declare the new bti pass.
> * config/aarch64/aarch64.md (bti_nop): Define.
> * config/aarch64/t-aarch64: Add rule for aarch64-bti-insert.o.
>
> *** gcc/testsuite/ChangeLog ***
>
> 2018-xx-xx Sudakshina Das <sudi.das@arm.com>
>
> * gcc.target/aarch64/bti-1.c: New test.
> * gcc.target/aarch64/bti-2.c: New test.
> * lib/target-supports.exp
> (check_effective_target_aarch64_bti_hw): Add new check for
> BTI hw.
>
next prev parent reply other threads:[~2022-08-18 0:00 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-02 18:38 Sudakshina Das
2018-11-13 14:47 ` Sudakshina Das
2018-11-29 16:50 ` Sudakshina Das
2018-12-14 16:09 ` Sudakshina Das
2018-12-19 15:41 ` James Greenhalgh
2018-12-20 16:44 ` Sudakshina Das
2019-01-09 14:42 ` Sudakshina Das
2019-01-10 15:46 ` Christophe Lyon
2019-01-10 16:55 ` Sudakshina Das
2022-08-18 0:00 ` Andrew Pinski [this message]
2022-08-18 10:10 ` Richard Earnshaw
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='CA+=Sn1=4Ze46m14nigJyBxauuJxosOSEosGUJT4f18tqQahUvA@mail.gmail.com' \
--to=pinskia@gmail.com \
--cc=James.Greenhalgh@arm.com \
--cc=Marcus.Shawcroft@arm.com \
--cc=Richard.Earnshaw@arm.com \
--cc=Sudi.Das@arm.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=nd@arm.com \
/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 read-only IMAP folder(s) and NNTP newsgroup(s).