]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - arch/x86/include/asm/nospec-branch.h
x86/nospec, objtool: Introduce ANNOTATE_IGNORE_ALTERNATIVE
[linux.git] / arch / x86 / include / asm / nospec-branch.h
index dad12b767ba069ede01be842e25a5d04afa35297..daf25b60c9e3a5ff6b83ee80028689b6449e85d2 100644 (file)
 #include <asm/cpufeatures.h>
 #include <asm/msr-index.h>
 
+/*
+ * This should be used immediately before a retpoline alternative. It tells
+ * objtool where the retpolines are so that it can make sense of the control
+ * flow by just reading the original instruction(s) and ignoring the
+ * alternatives.
+ */
+#define ANNOTATE_NOSPEC_ALTERNATIVE \
+       ANNOTATE_IGNORE_ALTERNATIVE
+
 /*
  * Fill the CPU return stack buffer.
  *
 
 #ifdef __ASSEMBLY__
 
-/*
- * This should be used immediately before a retpoline alternative.  It tells
- * objtool where the retpolines are so that it can make sense of the control
- * flow by just reading the original instruction(s) and ignoring the
- * alternatives.
- */
-.macro ANNOTATE_NOSPEC_ALTERNATIVE
-       .Lannotate_\@:
-       .pushsection .discard.nospec
-       .long .Lannotate_\@ - .
-       .popsection
-.endm
-
 /*
  * This should be used immediately before an indirect jump/call. It tells
  * objtool the subsequent indirect jump/call is vouched safe for retpoline
 
 #else /* __ASSEMBLY__ */
 
-#define ANNOTATE_NOSPEC_ALTERNATIVE                            \
-       "999:\n\t"                                              \
-       ".pushsection .discard.nospec\n\t"                      \
-       ".long 999b - .\n\t"                                    \
-       ".popsection\n\t"
-
 #define ANNOTATE_RETPOLINE_SAFE                                        \
        "999:\n\t"                                              \
        ".pushsection .discard.retpoline_safe\n\t"              \