Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Revert "x86/orc: Make it callthunk aware"

Commit 396e0b8e09e8 ("x86/orc: Make it callthunk aware") attempted to
deal with the fact that function prefix code didn't have ORC coverage.
However, it didn't work as advertised. Use of the "null" ORC entry just
caused affected unwinds to end early.

The root cause has now been fixed with commit 5743654f5e2e ("objtool:
Generate ORC data for __pfx code").

Revert most of commit 396e0b8e09e8 ("x86/orc: Make it callthunk aware").
The is_callthunk() function remains as it's now used by other code.

Link: https://lore.kernel.org/r/a05b916ef941da872cbece1ab3593eceabd05a79.1684245404.git.jpoimboe@kernel.org
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>

+2 -26
-5
arch/x86/include/asm/alternative.h
··· 113 113 extern void callthunks_patch_module_calls(struct callthunk_sites *sites, 114 114 struct module *mod); 115 115 extern void *callthunks_translate_call_dest(void *dest); 116 - extern bool is_callthunk(void *addr); 117 116 extern int x86_call_depth_emit_accounting(u8 **pprog, void *func); 118 117 #else 119 118 static __always_inline void callthunks_patch_builtin_calls(void) {} ··· 122 123 static __always_inline void *callthunks_translate_call_dest(void *dest) 123 124 { 124 125 return dest; 125 - } 126 - static __always_inline bool is_callthunk(void *addr) 127 - { 128 - return false; 129 126 } 130 127 static __always_inline int x86_call_depth_emit_accounting(u8 **pprog, 131 128 void *func)
+1 -1
arch/x86/kernel/callthunks.c
··· 293 293 return target ? : dest; 294 294 } 295 295 296 - bool is_callthunk(void *addr) 296 + static bool is_callthunk(void *addr) 297 297 { 298 298 unsigned int tmpl_size = SKL_TMPL_SIZE; 299 299 void *tmpl = skl_call_thunk_template;
+1 -20
arch/x86/kernel/unwind_orc.c
··· 183 183 .type = ORC_TYPE_CALL 184 184 }; 185 185 186 - #ifdef CONFIG_CALL_THUNKS 187 - static struct orc_entry *orc_callthunk_find(unsigned long ip) 188 - { 189 - if (!is_callthunk((void *)ip)) 190 - return NULL; 191 - 192 - return &null_orc_entry; 193 - } 194 - #else 195 - static struct orc_entry *orc_callthunk_find(unsigned long ip) 196 - { 197 - return NULL; 198 - } 199 - #endif 200 - 201 186 /* Fake frame pointer entry -- used as a fallback for generated code */ 202 187 static struct orc_entry orc_fp_entry = { 203 188 .type = ORC_TYPE_CALL, ··· 235 250 if (orc) 236 251 return orc; 237 252 238 - orc = orc_ftrace_find(ip); 239 - if (orc) 240 - return orc; 241 - 242 - return orc_callthunk_find(ip); 253 + return orc_ftrace_find(ip); 243 254 } 244 255 245 256 #ifdef CONFIG_MODULES