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

Jan Beulich
2011-01-06T16:11:00Z

>>> On 06.01.11 at 16:45, Frederic Weisbecker <fweisbec@gmail.com> wrote:
> Before we had:
>
>
> leaveq
>
> CFI_RESTORE rbp
> CFI_DEF_CFA_REGISTER rsp
> CFI_ADJUST_CFA_OFFSET -8
>
> So CFI_RESTORE means rbp has now the value of the base frame of
> the calling frame (the base frame pointer of the interrupted proc) ?

No - all it means is that %rbp now has its original (caller or
interrupted procedure) value again (i.e. an unwinder should not
try to read it from the stack [or other previously recorded
location] anymore).

> And what follows means that rsp-8 points to the return address?

No - .cfi_def_cfa_register says which register serves as the frame
pointer, and .cfi_adjust_cfa_offset says to adjust the offset from
the frame pointer to the top [or bottom] of frame. At any time

CFA = cfa_register + cfa_offset

with CFA being what all locations on the stack are expressed
relative to.

Jan