Re: [PATCH 10/14] x86/unwind/orc: Prevent unwinding before ORC initialization

From: Miroslav Benes
Date: Fri Mar 13 2020 - 08:24:14 EST


On Thu, 12 Mar 2020, Josh Poimboeuf wrote:

> If the unwinder is called before the ORC data has been initialized,
> orc_find() returns NULL, and it tries to fall back to using frame
> pointers. This can cause some unexpected warnings during boot.
>
> Move the 'orc_init' check from orc_find() to __unwind_init(), so that it

s/__unwind_init()/__unwind_start()/

> void __unwind_start(struct unwind_state *state, struct task_struct *task,
> struct pt_regs *regs, unsigned long *first_frame)
> {
> + if (!orc_init)
> + goto done;
> +
> memset(state, 0, sizeof(*state));
> state->task = task;

Miroslav