Skip to content

Commit 96c6480

Browse files
jpoimboeIngo Molnar
authored andcommitted
x86/entry/64: Fix unwind hints in __switch_to_asm()
UNWIND_HINT_FUNC has some limitations: specifically, it doesn't reset all the registers to undefined. This causes objtool to get confused about the RBP push in __switch_to_asm(), resulting in bad ORC data. While __switch_to_asm() does do some stack magic, it's otherwise a normal callable-from-C function, so just annotate it as a function, which makes objtool happy and allows it to produces the correct hints automatically. Fixes: 8c1f755 ("x86/entry/64: Add unwind hint annotations") Reviewed-by: Miroslav Benes <[email protected]> Signed-off-by: Josh Poimboeuf <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Dave Jones <[email protected]> Cc: Jann Horn <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Vince Weaver <[email protected]> Link: https://lore.kernel.org/r/03d0411920d10f7418f2e909210d8e9a3b2ab081.1587808742.git.jpoimboe@redhat.com
1 parent 1fb1436 commit 96c6480

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

arch/x86/entry/entry_64.S

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,7 @@ SYM_CODE_END(entry_SYSCALL_64)
279279
* %rdi: prev task
280280
* %rsi: next task
281281
*/
282-
SYM_CODE_START(__switch_to_asm)
283-
UNWIND_HINT_FUNC
282+
SYM_FUNC_START(__switch_to_asm)
284283
/*
285284
* Save callee-saved registers
286285
* This must match the order in inactive_task_frame
@@ -321,7 +320,7 @@ SYM_CODE_START(__switch_to_asm)
321320
popq %rbp
322321

323322
jmp __switch_to
324-
SYM_CODE_END(__switch_to_asm)
323+
SYM_FUNC_END(__switch_to_asm)
325324

326325
/*
327326
* A newly forked process directly context switches into this address.

0 commit comments

Comments
 (0)