OSDN Git Service

Merge tag 'x86_shstk_for_6.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git...
[tomoyo/tomoyo-test1.git] / arch / x86 / kernel / ibt_selftest.S
diff --git a/arch/x86/kernel/ibt_selftest.S b/arch/x86/kernel/ibt_selftest.S
new file mode 100644 (file)
index 0000000..c43c4ed
--- /dev/null
@@ -0,0 +1,17 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#include <linux/linkage.h>
+#include <linux/objtool.h>
+#include <asm/nospec-branch.h>
+
+SYM_CODE_START(ibt_selftest_noendbr)
+       ANNOTATE_NOENDBR
+       UNWIND_HINT_FUNC
+       /* #CP handler sets %ax to 0 */
+       RET
+SYM_CODE_END(ibt_selftest_noendbr)
+
+SYM_FUNC_START(ibt_selftest)
+       lea ibt_selftest_noendbr(%rip), %rax
+       ANNOTATE_RETPOLINE_SAFE
+       jmp *%rax
+SYM_FUNC_END(ibt_selftest)