Skip to content

Commit

Permalink
x86/stacktrace: Do not fail for ORC with regs on stack
Browse files Browse the repository at this point in the history
save_stack_trace_reliable now returns "non reliable" when there are
kernel pt_regs on stack. This means an interrupt or exception happened
somewhere down the route. It is a problem for the frame pointer
unwinder, because the frame might not have been set up yet when the irq
happened, so the unwinder might fail to unwind from the interrupted
function.

With ORC, this is not a problem, as ORC has out-of-band data. We can
find ORC data even for the IP in the interrupted function and always
unwind one level up reliably.

So lift the check to apply only when CONFIG_FRAME_POINTER=y is enabled.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/lkml/20180518064713.26440-4-jslaby@suse.cz
Signed-off-by: Ingo Molnar <mingo@kernel.org>
  • Loading branch information
Jiri Slaby authored and Ingo Molnar committed Jun 21, 2018
1 parent 441ccc3 commit 0c41436
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/x86/kernel/stacktrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ __save_stack_trace_reliable(struct stack_trace *trace,
* unreliable.
*/

return -EINVAL;
if (IS_ENABLED(CONFIG_FRAME_POINTER))
return -EINVAL;
}

addr = unwind_get_return_address(&state);
Expand Down

0 comments on commit 0c41436

Please sign in to comment.