public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* Unwind bug on out of line code called from leaf functions
@ 2003-11-27  0:12 Keith Owens
  2003-11-27  0:32 ` David Mosberger
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Keith Owens @ 2003-11-27  0:12 UTC (permalink / raw)
  To: linux-ia64

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

  pt_regs.cr_ifs
  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?


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2003-12-11  1:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-11-27  0:12 Unwind bug on out of line code called from leaf functions Keith Owens
2003-11-27  0:32 ` David Mosberger
2003-11-27  1:12 ` Keith Owens
2003-11-27  1:34 ` David Mosberger
2003-11-27  4:28 ` David Mosberger
2003-11-27  6:52 ` Jim Wilson
2003-12-11  1:21 ` David Mosberger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox