From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk1-x729.google.com (mail-qk1-x729.google.com [IPv6:2607:f8b0:4864:20::729]) by sourceware.org (Postfix) with ESMTPS id 0F785385701E for ; Thu, 12 Nov 2020 18:35:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 0F785385701E Received: by mail-qk1-x729.google.com with SMTP id 11so6254296qkd.5 for ; Thu, 12 Nov 2020 10:35:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:sender:from :date:message-id:subject:to:cc; bh=RqcRK7LiH7tWcT+VKjHpdGAvDDeLadIVpkw1xhBwq/4=; b=q4kq+jwelo+VRgN0Ui8epjQe5AsD1mQYTp9LSgVVd9FvCUdvo3eLRQBA1Xb3odx8RA gEcLj2ZjIb7Lm7u4H3sYANxY1mgde6UYW83165ielSI0+tWUbNg05NF/6AmQcOtIgmpa A78KpY6ldUwPfzHcv1SoKFnCPtktBsSpEqB/+Z1mAErU+qmW2dr8hxkl8ejoluG7isE3 u60ZZAYJsw7PXjf8YOErl1TDB7Q+/5jOZElFa7xrc8jEzhNHddEfpYb2NV/SQGhZ2QFq SsGNqOdPb2GLVx6ewm0yLSh6QBI7hMFXYH+5q54AG+HbLfrqupFQPI1Lw2gQh1kRwJuW A+fw== X-Gm-Message-State: AOAM53167vif00LhmoMh3B7IchXPNkyIAHupCxpyztIH4zfrgd6YNwfL WGr5HxCRsluaVjx//m9Q0qbQ/UK1oxY600kdOp0= X-Google-Smtp-Source: ABdhPJyv4YeMU67afqrwGi1vyl0ToTnHM2PvBohIMmao3/K70o64BTG5vEaYzXAbYhY6gPV5Md3a7//45gxCU/I3UqI= X-Received: by 2002:a37:e8e:: with SMTP id 136mr1200920qko.110.1605206105696; Thu, 12 Nov 2020 10:35:05 -0800 (PST) MIME-Version: 1.0 References: <159534453451.25601.18119761260522884038.scripted-patch-series@arm.com> In-Reply-To: Sender: sebpop@gmail.com X-Google-Sender-Delegation: sebpop@gmail.com From: Sebastian Pop Date: Thu, 12 Nov 2020 12:34:54 -0600 X-Google-Sender-Auth: 7fdjkY-hJwpgB6VNXiJuME0FHHw Message-ID: Subject: Re: SLS Mitigation patches backported for GCC9 To: Kyrylo Tkachov Cc: Matthew Malcomson , "gcc-patches@gcc.gnu.org" , Richard Earnshaw , Ross Burton Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, KAM_NUMSUBJECT, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2020 18:35:07 -0000 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 wrote: > > Hi Matthew, > > > -----Original Message----- > > From: Matthew Malcomson > > Sent: 24 July 2020 17:03 > > To: Kyrylo Tkachov ; gcc-patches@gcc.gnu.org > > Cc: Richard Earnshaw ; Ross Burton > > ; Richard Sandiford > > Subject: Re: SLS Mitigation patches backported for GCC9 > > > > On 24/07/2020 12:01, Kyrylo Tkachov wrote: > > > Hi Matthew, > > > > > >> -----Original Message----- > > >> From: Matthew Malcomson > > >> Sent: 21 July 2020 16:16 > > >> To: gcc-patches@gcc.gnu.org > > >> Cc: Richard Earnshaw ; Kyrylo Tkachov > > >> ; Ross Burton > > >> 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 "*cb1"