<div dir="ltr">Also, including the SVN revision (llvm's util/git-svn/git-svnrevert script can help with this) is helpful for other folks following along who may not be using git.</div><br><div class="gmail_quote"><div dir="ltr">On Mon, Nov 26, 2018 at 12:19 PM Aaron Ballman via cfe-commits <<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Mon, Nov 26, 2018 at 3:13 PM Zola Bridges via cfe-commits<br>
<<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>> wrote:<br>
><br>
> Author: zbrid<br>
> Date: Mon Nov 26 12:11:18 2018<br>
> New Revision: 347588<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=347588&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=347588&view=rev</a><br>
> Log:<br>
> Revert "[clang][slh] add attribute for speculative load hardening"<br>
><br>
> This reverts commit 801eaf91221ba6dd6996b29ff82659ad6359e885.<br>
<br>
Next time you revert something, can you add an explanation as to why<br>
it was reverted into the commit message? It helps when doing code<br>
archaeology.<br>
<br>
Thanks!<br>
<br>
~Aaron<br>
<br>
><br>
> Removed:<br>
> cfe/trunk/test/CodeGen/attr-speculative-load-hardening.cpp<br>
> cfe/trunk/test/CodeGen/attr-speculative-load-hardening.m<br>
> cfe/trunk/test/SemaCXX/attr-speculative-load-hardening.cpp<br>
> Modified:<br>
> cfe/trunk/include/clang/Basic/Attr.td<br>
> cfe/trunk/include/clang/Basic/AttrDocs.td<br>
> cfe/trunk/lib/CodeGen/CGCall.cpp<br>
> cfe/trunk/lib/Sema/SemaDeclAttr.cpp<br>
><br>
> Modified: cfe/trunk/include/clang/Basic/Attr.td<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Attr.td?rev=347588&r1=347587&r2=347588&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Attr.td?rev=347588&r1=347587&r2=347588&view=diff</a><br>
> ==============================================================================<br>
> --- cfe/trunk/include/clang/Basic/Attr.td (original)<br>
> +++ cfe/trunk/include/clang/Basic/Attr.td Mon Nov 26 12:11:18 2018<br>
> @@ -3091,9 +3091,3 @@ def AlwaysDestroy : InheritableAttr {<br>
> let Subjects = SubjectList<[Var]>;<br>
> let Documentation = [AlwaysDestroyDocs];<br>
> }<br>
> -<br>
> -def SpeculativeLoadHardening : InheritableAttr {<br>
> - let Spellings = [Clang<"speculative_load_hardening">];<br>
> - let Subjects = SubjectList<[Function, ObjCMethod], ErrorDiag>;<br>
> - let Documentation = [SpeculativeLoadHardeningDocs];<br>
> -}<br>
><br>
> Modified: cfe/trunk/include/clang/Basic/AttrDocs.td<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/AttrDocs.td?rev=347588&r1=347587&r2=347588&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/AttrDocs.td?rev=347588&r1=347587&r2=347588&view=diff</a><br>
> ==============================================================================<br>
> --- cfe/trunk/include/clang/Basic/AttrDocs.td (original)<br>
> +++ cfe/trunk/include/clang/Basic/AttrDocs.td Mon Nov 26 12:11:18 2018<br>
> @@ -3629,27 +3629,3 @@ GNU inline semantics are the default beh<br>
> ``-std=c89``, ``-std=c94``, or ``-fgnu89-inline``.<br>
> }];<br>
> }<br>
> -<br>
> -def SpeculativeLoadHardeningDocs : Documentation {<br>
> - let Category = DocCatFunction;<br>
> - let Content = [{<br>
> - This attribute can be applied to a function declaration in order to indicate<br>
> - that `Speculative Load Hardening <<a href="https://llvm.org/docs/SpeculativeLoadHardening.html" rel="noreferrer" target="_blank">https://llvm.org/docs/SpeculativeLoadHardening.html</a>>`_<br>
> - should be enabled for the function body. This can also be applied to a method<br>
> - in Objective C.<br>
> -<br>
> - Speculative Load Hardening is a best-effort mitigation against<br>
> - information leak attacks that make use of control flow<br>
> - miss-speculation - specifically miss-speculation of whether a branch<br>
> - is taken or not. Typically vulnerabilities enabling such attacks are<br>
> - classified as "Spectre variant #1". Notably, this does not attempt to<br>
> - mitigate against miss-speculation of branch target, classified as<br>
> - "Spectre variant #2" vulnerabilities.<br>
> -<br>
> - When inlining, the attribute is sticky. Inlining a function that<br>
> - carries this attribute will cause the caller to gain the<br>
> - attribute. This is intended to provide a maximally conservative model<br>
> - where the code in a function annotated with this attribute will always<br>
> - (even after inlining) end up hardened.<br>
> - }];<br>
> -}<br>
><br>
> Modified: cfe/trunk/lib/CodeGen/CGCall.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCall.cpp?rev=347588&r1=347587&r2=347588&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCall.cpp?rev=347588&r1=347587&r2=347588&view=diff</a><br>
> ==============================================================================<br>
> --- cfe/trunk/lib/CodeGen/CGCall.cpp (original)<br>
> +++ cfe/trunk/lib/CodeGen/CGCall.cpp Mon Nov 26 12:11:18 2018<br>
> @@ -1791,8 +1791,6 @@ void CodeGenModule::ConstructDefaultFnAt<br>
> if (CodeGenOpts.Backchain)<br>
> FuncAttrs.addAttribute("backchain");<br>
><br>
> - // FIXME: The interaction of this attribute with the SLH command line flag<br>
> - // has not been determined.<br>
> if (CodeGenOpts.SpeculativeLoadHardening)<br>
> FuncAttrs.addAttribute(llvm::Attribute::SpeculativeLoadHardening);<br>
> }<br>
> @@ -1856,8 +1854,6 @@ void CodeGenModule::ConstructAttributeLi<br>
> FuncAttrs.addAttribute(llvm::Attribute::NoDuplicate);<br>
> if (TargetDecl->hasAttr<ConvergentAttr>())<br>
> FuncAttrs.addAttribute(llvm::Attribute::Convergent);<br>
> - if (TargetDecl->hasAttr<SpeculativeLoadHardeningAttr>())<br>
> - FuncAttrs.addAttribute(llvm::Attribute::SpeculativeLoadHardening);<br>
><br>
> if (const FunctionDecl *Fn = dyn_cast<FunctionDecl>(TargetDecl)) {<br>
> AddAttributesFromFunctionProtoType(<br>
><br>
> Modified: cfe/trunk/lib/Sema/SemaDeclAttr.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclAttr.cpp?rev=347588&r1=347587&r2=347588&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclAttr.cpp?rev=347588&r1=347587&r2=347588&view=diff</a><br>
> ==============================================================================<br>
> --- cfe/trunk/lib/Sema/SemaDeclAttr.cpp (original)<br>
> +++ cfe/trunk/lib/Sema/SemaDeclAttr.cpp Mon Nov 26 12:11:18 2018<br>
> @@ -6373,9 +6373,6 @@ static void ProcessDeclAttribute(Sema &S<br>
> case ParsedAttr::AT_Section:<br>
> handleSectionAttr(S, D, AL);<br>
> break;<br>
> - case ParsedAttr::AT_SpeculativeLoadHardening:<br>
> - handleSimpleAttribute<SpeculativeLoadHardeningAttr>(S, D, AL);<br>
> - break;<br>
> case ParsedAttr::AT_CodeSeg:<br>
> handleCodeSegAttr(S, D, AL);<br>
> break;<br>
><br>
> Removed: cfe/trunk/test/CodeGen/attr-speculative-load-hardening.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/attr-speculative-load-hardening.cpp?rev=347587&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/attr-speculative-load-hardening.cpp?rev=347587&view=auto</a><br>
> ==============================================================================<br>
> --- cfe/trunk/test/CodeGen/attr-speculative-load-hardening.cpp (original)<br>
> +++ cfe/trunk/test/CodeGen/attr-speculative-load-hardening.cpp (removed)<br>
> @@ -1,18 +0,0 @@<br>
> -// RUN: %clang_cc1 -std=c++11 -disable-llvm-passes -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK1<br>
> -// RUN: %clang_cc1 -std=c++11 -disable-llvm-passes -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK2<br>
> -//<br>
> -// Check that we set the attribute on each function.<br>
> -<br>
> -[[clang::speculative_load_hardening]]<br>
> -int test1() {<br>
> - return 42;<br>
> -}<br>
> -<br>
> -int __attribute__((speculative_load_hardening)) test2() {<br>
> - return 42;<br>
> -}<br>
> -// CHECK1: @{{.*}}test1{{.*}}[[SLH1:#[0-9]+]]<br>
> -// CHECK1: attributes [[SLH1]] = { {{.*}}speculative_load_hardening{{.*}} }<br>
> -<br>
> -// CHECK2: @{{.*}}test2{{.*}}[[SLH2:#[0-9]+]]<br>
> -// CHECK2: attributes [[SLH2]] = { {{.*}}speculative_load_hardening{{.*}} }<br>
><br>
> Removed: cfe/trunk/test/CodeGen/attr-speculative-load-hardening.m<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/attr-speculative-load-hardening.m?rev=347587&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/attr-speculative-load-hardening.m?rev=347587&view=auto</a><br>
> ==============================================================================<br>
> --- cfe/trunk/test/CodeGen/attr-speculative-load-hardening.m (original)<br>
> +++ cfe/trunk/test/CodeGen/attr-speculative-load-hardening.m (removed)<br>
> @@ -1,9 +0,0 @@<br>
> -// RUN: %clang -emit-llvm %s -o - -S | FileCheck %s -check-prefix=SLH<br>
> -<br>
> -int main() __attribute__((speculative_load_hardening)) {<br>
> - return 0;<br>
> -}<br>
> -<br>
> -// SLH: @{{.*}}main{{.*}}[[SLH:#[0-9]+]]<br>
> -<br>
> -// SLH: attributes [[SLH]] = { {{.*}}speculative_load_hardening{{.*}} }<br>
><br>
> Removed: cfe/trunk/test/SemaCXX/attr-speculative-load-hardening.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/attr-speculative-load-hardening.cpp?rev=347587&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/attr-speculative-load-hardening.cpp?rev=347587&view=auto</a><br>
> ==============================================================================<br>
> --- cfe/trunk/test/SemaCXX/attr-speculative-load-hardening.cpp (original)<br>
> +++ cfe/trunk/test/SemaCXX/attr-speculative-load-hardening.cpp (removed)<br>
> @@ -1,34 +0,0 @@<br>
> -// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s<br>
> -<br>
> -int i __attribute__((speculative_load_hardening)); // expected-error {{'speculative_load_hardening' attribute only applies to functions}}<br>
> -<br>
> -void f1() __attribute__((speculative_load_hardening));<br>
> -void f2() __attribute__((speculative_load_hardening(1))); // expected-error {{'speculative_load_hardening' attribute takes no arguments}}<br>
> -<br>
> -template <typename T><br>
> -void tf1() __attribute__((speculative_load_hardening));<br>
> -<br>
> -int f3(int __attribute__((speculative_load_hardening)), int); // expected-error {{'speculative_load_hardening' attribute only applies to functions}}<br>
> -<br>
> -struct A {<br>
> - int f __attribute__((speculative_load_hardening)); // expected-error {{'speculative_load_hardening' attribute only applies to functions}}<br>
> - void mf1() __attribute__((speculative_load_hardening));<br>
> - static void mf2() __attribute__((speculative_load_hardening));<br>
> -};<br>
> -<br>
> -int ci [[speculative_load_hardening]]; // expected-error {{'speculative_load_hardening' attribute only applies to functions}}<br>
> -<br>
> -[[speculative_load_hardening]] void cf1();<br>
> -[[speculative_load_hardening(1)]] void cf2(); // expected-error {{'speculative_load_hardening' attribute takes no arguments}}<br>
> -<br>
> -template <typename T><br>
> -[[speculative_load_hardening]]<br>
> -void ctf1();<br>
> -<br>
> -int cf3(int c[[speculative_load_hardening]], int); // expected-error {{'speculative_load_hardening' attribute only applies to functions}}<br>
> -<br>
> -struct CA {<br>
> - int f [[speculative_load_hardening]]; // expected-error {{'speculative_load_hardening' attribute only applies to functions}}<br>
> - [[speculative_load_hardening]] void mf1();<br>
> - [[speculative_load_hardening]] static void mf2();<br>
> -};<br>
><br>
><br>
> _______________________________________________<br>
> cfe-commits mailing list<br>
> <a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
</blockquote></div>