Re: [RFC PATCH 1/2] x86: Fix rbp saving in pt_regs on irq entry

From: Ingo Molnar
Date: Fri Jan 07 2011 - 07:31:47 EST



* Jan Beulich <JBeulich@xxxxxxxxxx> wrote:

> > Now I don't understand how this is all useful as this is not a normal proc but
> > an interruption. We can't get back the return address from the CFA. Or am I
> > missing something?
>
> Unwind annotations, when written correctly, allow unwinding through all kinds of
> execution flows, including interrupts or exceptions as well as including stack
> switches.

Yeah and that's rather useful, as exception contexts can nest in very weird ways,
especially with NMIs involved. For example a 7-context combination is possible:

user-space -> syscall -> pagefault -> softirq -> hardirq -> debug trap -> NMI

And the call frame walking logic needs to be able to get all the way back to
user-space ...

For that every transition needs to work flawlessly, for debugging (and CFI based
profiling) to work fine.

Most of those transitions can happen at any instruction boundary that a given
context executes, so the total number of possible combinations is virtually endless.

Unfortunately we dont seem to have a good way to test any of this automatically.
Putting a perf probe on every assembly instruction perhaps, and checking whether the
frame manages to go back all the way to user-space?

Thanks,

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/