• Frederic Weisbecker's avatar
    x86: Don't use frame pointer to save old stack on irq entry · a2bbe750
    Frederic Weisbecker authored
    rbp is used in SAVE_ARGS_IRQ to save the old stack pointer
    in order to restore it later in ret_from_intr.
    
    It is convenient because we save its value in the irq regs
    and it's easily restored using the leave instruction.
    
    However this is a kind of abuse of the frame pointer which
    role is to help unwinding the kernel by chaining frames
    together, each node following the return address to the
    previous frame.
    
    But although we are breaking the frame by changing the stack
    pointer, there is no preceding return address before the new
    frame. Hence using the frame pointer to link the two stacks
    breaks the stack unwinders that find a random value instead of
    a return address here.
    
    There is no workaround that can work in every case. We are using
    the fixup_bp_irq_link() function to dereference that abused frame
    pointer in the case of non nesting interrupt (which means stack
    changed).
    But that doesn't fix the case of interrupts that don't change the
    stack (but ...
    a2bbe750
dumpstack_64.c 7.31 KB