public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: Keith Owens <kaos@sgi.com>
To: linux-ia64@vger.kernel.org
Subject: Unwind bug on out of line code called from leaf functions
Date: Thu, 27 Nov 2003 00:12:18 +0000	[thread overview]
Message-ID: <marc-linux-ia64-106989195923088@msgid-missing> (raw)

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?


             reply	other threads:[~2003-11-27  0:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-27  0:12 Keith Owens [this message]
2003-11-27  0:32 ` Unwind bug on out of line code called from leaf functions 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=marc-linux-ia64-106989195923088@msgid-missing \
    --to=kaos@sgi.com \
    --cc=linux-ia64@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox