From: Sebastian Pop <sebpop.gnu@gmail.com>
To: Kyrylo Tkachov <Kyrylo.Tkachov@arm.com>
Cc: Matthew Malcomson <Matthew.Malcomson@arm.com>,
"gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>,
Richard Earnshaw <Richard.Earnshaw@arm.com>,
Ross Burton <Ross.Burton@arm.com>
Subject: Re: SLS Mitigation patches backported for GCC9
Date: Thu, 12 Nov 2020 12:34:54 -0600 [thread overview]
Message-ID: <CAL+u6rrkdeTi7ywJ5f-Y8dSnBRPsy1w0gwCV9khcdom0Ab9sUA@mail.gmail.com> (raw)
In-Reply-To: <DB7PR08MB3002AF138E79114ED3381A2E934A0@DB7PR08MB3002.eurprd08.prod.outlook.com>
Hi,
could the SLS Mitigation patches be back-ported to the gcc-8 branch?
https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=dc586a74922 aarch64:
Introduce SLS mitigation for RET and BR instructions
https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=20da13e395b aarch64:
New Straight Line Speculation (SLS) mitigation flags
Thanks,
Sebastian
On Tue, Aug 4, 2020 at 3:34 AM Kyrylo Tkachov <Kyrylo.Tkachov@arm.com> wrote:
>
> Hi Matthew,
>
> > -----Original Message-----
> > From: Matthew Malcomson <Matthew.Malcomson@arm.com>
> > Sent: 24 July 2020 17:03
> > To: Kyrylo Tkachov <Kyrylo.Tkachov@arm.com>; gcc-patches@gcc.gnu.org
> > Cc: Richard Earnshaw <Richard.Earnshaw@arm.com>; Ross Burton
> > <Ross.Burton@arm.com>; Richard Sandiford <Richard.Sandiford@arm.com>
> > Subject: Re: SLS Mitigation patches backported for GCC9
> >
> > On 24/07/2020 12:01, Kyrylo Tkachov wrote:
> > > Hi Matthew,
> > >
> > >> -----Original Message-----
> > >> From: Matthew Malcomson <Matthew.Malcomson@arm.com>
> > >> Sent: 21 July 2020 16:16
> > >> To: gcc-patches@gcc.gnu.org
> > >> Cc: Richard Earnshaw <Richard.Earnshaw@arm.com>; Kyrylo Tkachov
> > >> <Kyrylo.Tkachov@arm.com>; Ross Burton <Ross.Burton@arm.com>
> > >> Subject: SLS Mitigation patches backported for GCC9
> > >>
> > >> Hello,
> > >>
> > >> Eventually we will want to backport the SLS patches to older branches.
> > >>
> > >> When the GCC10 release is unfrozen we will work on getting the same
> > >> patches
> > >> already posted backported to that branch. The patches already posted on
> > >> the
> > >> mailing list apply cleanly to the current releases/gcc-10 branch.
> > >>
> > >> I've heard interest in having the GCC 9 patches, so I'm posting the
> > modified
> > >> versions upstream sooner than otherwise.
> > >
> > > I'd say let's go ahead with the GCC 10 patches (assuming testing works out
> > well on there).
> > > For the GCC 9 patches it would be useful if you included a bit of text of how
> > they differ from the GCC 10/11 patches.
> > > This would speed up the technical review.
> > > Thanks,
> > > Kyrill
> > >
> > >>
> > >> Cheers,
> > >> Matthew
> > >>
> > >> Entire patch series attached to cover letter.
> >
> > Below were the only two "interesting" hunks that failed to apply after
> > `patch -p1`.
> >
> > The differences causing these were:
> > - in GCC-9 the `retab` instruction wasn't in the "do_return" pattern.
> > - `simple_return` had "aarch64_use_simple_return_insn_p ()" as a
> > condition.
> >
> >
>
> Thanks, the backports to GCC 10 and GCC 9 are okay, let's go ahead with them.
> Kyrill
>
> >
> >
> > --- gcc/config/aarch64/aarch64.md
> > +++ gcc/config/aarch64/aarch64.md
> > @@ -863,18 +882,23 @@
> > [(return)]
> > ""
> > {
> > + const char *ret = NULL;
> > if (aarch64_return_address_signing_enabled ()
> > && TARGET_ARMV8_3
> > && !crtl->calls_eh_return)
> > {
> > if (aarch64_ra_sign_key == AARCH64_KEY_B)
> > - return "retab";
> > + ret = "retab";
> > else
> > - return "retaa";
> > + ret = "retaa";
> > }
> > - return "ret";
> > + else
> > + ret = "ret";
> > + output_asm_insn (ret, operands);
> > + return aarch64_sls_barrier (aarch64_harden_sls_retbr_p ());
> > }
> > - [(set_attr "type" "branch")]
> > + [(set_attr "type" "branch")
> > + (set_attr "sls_length" "retbr")]
> > )
> >
> > (define_expand "return"
> > @@ -886,8 +910,12 @@
> > (define_insn "simple_return"
> > [(simple_return)]
> > ""
> > - "ret"
> > - [(set_attr "type" "branch")]
> > + {
> > + output_asm_insn ("ret", operands);
> > + return aarch64_sls_barrier (aarch64_harden_sls_retbr_p ());
> > + }
> > + [(set_attr "type" "branch")
> > + (set_attr "sls_length" "retbr")]
> > )
> >
> > (define_insn "*cb<optab><mode>1"
prev parent reply other threads:[~2020-11-12 18:35 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-21 15:15 Matthew Malcomson
2020-07-21 15:15 ` aarch64: (GCC-9 Backport) Introduce SLS mitigation for RET and BR instructions Matthew Malcomson
2020-07-21 15:15 ` aarch64: (GCC-9 Backport) Mitigate SLS for BLR instruction Matthew Malcomson
2020-07-21 15:15 ` aarch64: (GCC-9 Backport) New Straight Line Speculation (SLS) mitigation flags Matthew Malcomson
2020-07-24 11:01 ` SLS Mitigation patches backported for GCC9 Kyrylo Tkachov
2020-07-24 16:02 ` Matthew Malcomson
2020-08-04 8:33 ` Kyrylo Tkachov
2020-11-12 18:34 ` Sebastian Pop [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=CAL+u6rrkdeTi7ywJ5f-Y8dSnBRPsy1w0gwCV9khcdom0Ab9sUA@mail.gmail.com \
--to=sebpop.gnu@gmail.com \
--cc=Kyrylo.Tkachov@arm.com \
--cc=Matthew.Malcomson@arm.com \
--cc=Richard.Earnshaw@arm.com \
--cc=Ross.Burton@arm.com \
--cc=gcc-patches@gcc.gnu.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 read-only IMAP folder(s) and NNTP newsgroup(s).