History

objtool: Add CONFIG_OBJTOOL

Now that stack validation is an optional feature of objtool, add CONFIG_OBJTOOL and replace most usages of CONFIG_STACK_VALIDATION with it. CONFIG_STACK_VALIDATION can now be considered to be frame-pointer specific. CONFIG_UNWINDER_ORC is already inherently valid for live patching, so no need to "validate" it.

Josh Poimboeuf committed 4 years ago

Commit 03f16cd1 parent c2bdd6117 files · +73 −57Browse files

Showing the changes to include (3 of 17 files). Show all

Unified · Split

3 files
  1. include/linux/compiler.h +3 −3
  2. include/linux/instrumentation.h +3 −3
  3. include/linux/objtool.h +3 −3
include/linux/compiler.h+3−3
@@ -109,7 +109,7 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val, · 108 unmodified lines
109109 #endif
110110
111111 /* Unreachable code */
112−#ifdef CONFIG_STACK_VALIDATION
112+#ifdef CONFIG_OBJTOOL
113113 /*
114114 * These macros help objtool understand GCC code flow for unreachable code.
115115 * The __COUNTER__ based labels are a hack to make each instance of the macros
@@ -128,10 +128,10 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val, · 12 unmodified lines
128128 /* Annotate a C jump table to allow objtool to follow the code flow */
129129 #define __annotate_jump_table __section(".rodata..c_jump_table")
130130
131−#else
131+#else /* !CONFIG_OBJTOOL */
132132 #define annotate_unreachable()
133133 #define __annotate_jump_table
134−#endif
134+#endif /* CONFIG_OBJTOOL */
135135
136136 #ifndef unreachable
137137 # define unreachable() do { \
include/linux/instrumentation.h+3−3
@@ -2,7 +2,7 @@ · 1 unmodified line
22 #ifndef __LINUX_INSTRUMENTATION_H
33 #define __LINUX_INSTRUMENTATION_H
44
5−#if defined(CONFIG_DEBUG_ENTRY) && defined(CONFIG_STACK_VALIDATION)
5+#ifdef CONFIG_VMLINUX_VALIDATION
66
77 #include <linux/stringify.h>
88
@@ -53,9 +53,9 @@ · 44 unmodified lines
5353 ".popsection\n\t" : : "i" (c)); \
5454 })
5555 #define instrumentation_end() __instrumentation_end(__COUNTER__)
56−#else
56+#else /* !CONFIG_VMLINUX_VALIDATION */
5757 # define instrumentation_begin() do { } while(0)
5858 # define instrumentation_end() do { } while(0)
59−#endif
59+#endif /* CONFIG_VMLINUX_VALIDATION */
6060
6161 #endif /* __LINUX_INSTRUMENTATION_H */
include/linux/objtool.h+3−3
@@ -38,7 +38,7 @@ struct unwind_hint { · 37 unmodified lines
3838 #define UNWIND_HINT_TYPE_REGS_PARTIAL 2
3939 #define UNWIND_HINT_TYPE_FUNC 3
4040
41−#ifdef CONFIG_STACK_VALIDATION
41+#ifdef CONFIG_OBJTOOL
4242
4343 #ifndef __ASSEMBLY__
4444
@@ -157,7 +157,7 @@ struct unwind_hint { · 112 unmodified lines
157157
158158 #endif /* __ASSEMBLY__ */
159159
160−#else /* !CONFIG_STACK_VALIDATION */
160+#else /* !CONFIG_OBJTOOL */
161161
162162 #ifndef __ASSEMBLY__
163163
@@ -179,6 +179,6 @@ struct unwind_hint { · 15 unmodified lines
179179 .endm
180180 #endif
181181
182−#endif /* CONFIG_STACK_VALIDATION */
182+#endif /* CONFIG_OBJTOOL */
183183
184184 #endif /* _LINUX_OBJTOOL_H */