Unwind bug on out of line code called from leaf functions

From: Keith Owens <kaos_at_sgi.com>
Date: 2003-11-27 11:12:18
ia64_spinlock_contention_pre3_4 has

        .save ar.pfs, r0        // this code effectively has a zero frame size

If ia64_spinlock_contention_pre3_4 is called from a leaf function,
takes an interrupt and you unwind through the contenion code, the
unwind steps are

  ia64_spinlock_contention_pre3_4, ar.pfs = 0
  leaf function, no unwind data, ar.pfs is unchanged and stays at 0!

There is no problem when ia64_spinlock_contention_pre3_4 is called from
a non-leaf function.  The non-leaf function has unwind data which
resets ar.pfs, the problem only occurs when the caller of the out of
line code has no unwind data and is using .

I have hacked kdb to recognise that it is unwinding the caller of the
out of line code and force ar.pfs to pt_regs.ar_pfs.  That is the
correct value for leaf functions.  The unwind data for non-leaf
functions will override this default value of ar.pfs.

I know that gcc 3.4 overcomes this problem by saving ar.pfs in leaf
functions and using br.call.  However we need a fix for gcc in the
current distributions, even with gcc 3.4 we may wish to use out of line
code that does not save ar.pfs in the future.

We need a generic fix for unwinding through out of line code called
from leaf functions and not using br.call.  The obvious solution is to
flag all out of line code with an unwind abi field and have the common
unwind code reset ar.pfs.  Can I use .unwabi 3, 'o' for out of line?

To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Wed Nov 26 19:12:39 2003

This archive was generated by hypermail 2.1.8 : 2005-08-02 09:20:20 EST