From: Camm Maguire <camm@enhanced.com>
To: Russell King <rmk@arm.linux.org.uk>
Cc: linux-kernel@vger.kernel.org
Subject: Re: 2.2.x kernels not filling in siginfo_t.si_addr on SEGV?
Date: 09 Mar 2001 17:29:20 -0500 [thread overview]
Message-ID: <54wv9ymv9b.fsf@intech19.enhanced.com> (raw)
In-Reply-To: <Pine.LNX.4.30.0103081610400.31071-100000@hill.cs.ucr.edu> <54itljvcwo.fsf@intech19.enhanced.com> <20010309083035.A27596@flint.arm.linux.org.uk>
In-Reply-To: Russell King's message of "Fri, 9 Mar 2001 08:30:35 +0000"
Greetings, and thanks for your reply!
Russell King <rmk@arm.linux.org.uk> writes:
> On Thu, Mar 08, 2001 at 10:28:39PM -0500, Camm Maguire wrote:
> > Greetings, and thank you so much for your helpful reply! Was this on
> > an i386? I'm specifically looking for a way to do his on arm, alpha,
> > and sparc, and I don't believe they have the cr2 member of struct
> > sigcontext. Any info you might have, including where you found this
> > solution, would be appreciated!
>
> ARM does have this information available of course (its required for the
> page fault processing), but it didn't fill in the tss struct with the
> address in 2.2 kernels. In 2.4, we use the siginfo stuff.
>
> You're the first person to report that it doesn't. We do have an
> "tss.address" member which should be filled in however.
>
Thanks so much for this info. Does this mean that given the siginfo_t
and sigcontext pointers, one cannot find this address anywhere by
poking around at a specified offset, or something? Roman Hodek came
up with the following rather elaborate scheme for m68k:
=============================================================================
/* GET_FAULT_ADDR is a bit complicated to implement on m68k, because the fault
address can't be found directly in the sigcontext. One has to look at the
CPU frame, and that one is different for each CPU.
*/
#define GET_FAULT_ADDR(sig,code,sv,a) \
({ \
struct sigcontext *scp = (struct sigcontext *)(sv); \
int format = (scp->sc_formatvec >> 12) & 0xf; \
unsigned long *framedata = (unsigned long *)(scp + 1); \
unsigned long ea; \
if (format == 0xa || format == 0xb) \
/* 68020/030 */ \
ea = framedata[2]; \
else if (format == 7) \
/* 68040 */ \
ea = framedata[3]; \
else if (format == 4) { \
/* 68060 */ \
ea = framedata[0]; \
if (framedata[1] & 0x08000000) \
/* correct addr on misaligned access */ \
ea = (ea+4095)&(~4095); \
} \
ea; \
})
#endif
=============================================================================
Is there any analog for arm (or alpha, sparc, etc. for that matter)
for current 2.2.x kernels?
Thanks again!
>
--
Camm Maguire camm@enhanced.com
==========================================================================
"The earth is but one country, and mankind its citizens." -- Baha'u'llah
next prev parent reply other threads:[~2001-03-09 22:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-03-09 0:26 2.2.x kernels not filling in siginfo_t.si_addr on SEGV? David Watson
2001-03-09 3:28 ` Camm Maguire
[not found] ` <20010309083035.A27596@flint.arm.linux.org.uk>
2001-03-09 22:29 ` Camm Maguire [this message]
-- strict thread matches above, loose matches on Subject: below --
2001-03-08 22:27 Camm Maguire
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=54wv9ymv9b.fsf@intech19.enhanced.com \
--to=camm@enhanced.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rmk@arm.linux.org.uk \
/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