mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Aneesh Kumar K.V" <aneesh.kumar@digital.com>
To: Camm Maguire <camm@enhanced.com>
Cc: debian-alpha <debian-alpha@lists.debian.org>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: SA_SIGINFO in Linux 2.4.x
Date: 02 Aug 2002 15:22:16 +0530	[thread overview]
Message-ID: <1028281936.17352.42.camel@satan.xko.dec.com> (raw)
In-Reply-To: <E17aOg0-0002ub-00@intech19.enhanced.com>

On Fri, 2002-08-02 at 04:14, Camm Maguire wrote:
> Greetings!  The 2.4.x kernels on alpha don't appear to be filling in
> the si_addr element of the siginfo_t structure when a signal handler
> is setup with SA_SIGINFO.  Is this right?  Any other way to get this
> address in the handler?
> 
> Take care,
> 
> -- 
> Camm Maguire			     			camm@enhanced.com


Hi, 

 Try the following patch  for arch/alpha/mm/fault.c 

 -aneesh 

--- fault.c	Tue Aug  2 12:33:44 2050
+++ fault.c.n	Tue Aug  2 12:34:51 2050
@@ -88,6 +88,7 @@
 	struct mm_struct *mm = current->mm;
 	unsigned int fixup;
 	int fault;
+	siginfo_t info;
 
 	/* As of EV6, a load into $31/$f31 is a prefetch, and never faults
 	   (or is suppressed by the PALcode).  Support that for older CPUs
@@ -108,6 +109,8 @@
 	if (!mm || in_interrupt())
 		goto no_context;
 
+	info.si_code = SEGV_MAPERR;
+
 #ifdef CONFIG_ALPHA_LARGE_VMALLOC
 	if (address >= TASK_SIZE)
 		goto vmalloc_fault;
@@ -128,6 +131,7 @@
  * we can handle it..
  */
 good_area:
+	info.si_code = SEGV_ACCERR;
 	if (cause < 0) {
 		if (!(vma->vm_flags & VM_EXEC))
 			goto bad_area;
@@ -164,7 +168,12 @@
 	up_read(&mm->mmap_sem);
 
 	if (user_mode(regs)) {
-		force_sig(SIGSEGV, current);
+			
+		info.si_signo = SIGSEGV;
+		info.si_errno = 0;
+		/* info.si_code has been set above */
+		info.si_addr = (void *)address;
+		force_sig_info(SIGSEGV,&info,current);
 		return;
 	}
 
@@ -212,7 +221,12 @@
 	 * Send a sigbus, regardless of whether we were in kernel
 	 * or user mode.
 	 */
-	force_sig(SIGBUS, current);
+	info.si_signo = SIGBUS;
+	info.si_errno = 0;
+	/* not sure si_code value here  */
+	info.si_code =  BUS_ADRERR;
+	info.si_addr = (void *)address;
+	force_sig_info(SIGBUS,&info,current);
 	if (!user_mode(regs))
 		goto no_context;
 	return;
@@ -220,7 +234,11 @@
 #ifdef CONFIG_ALPHA_LARGE_VMALLOC
 vmalloc_fault:
 	if (user_mode(regs)) {
-		force_sig(SIGSEGV, current);
+		info.si_signo = SIGSEGV;
+		info.si_errno = 0;
+		/* info.si_code has been set above */
+		info.si_addr = (void *)address;
+		force_sig_info(SIGSEGV,&info,current);
 		return;
 	} else {
 		/* Synchronize this task's top level page-table


       reply	other threads:[~2002-08-02  9:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E17aOg0-0002ub-00@intech19.enhanced.com>
2002-08-02  9:52 ` Aneesh Kumar K.V [this message]
2002-08-02 12:41   ` Daniel Barlow
2002-08-02 15:54     ` Camm Maguire
2002-08-02 16:01       ` [Gcl-devel] " Camm Maguire
2002-08-02 21:36   ` Goswin Brederlow

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=1028281936.17352.42.camel@satan.xko.dec.com \
    --to=aneesh.kumar@digital.com \
    --cc=camm@enhanced.com \
    --cc=debian-alpha@lists.debian.org \
    --cc=linux-kernel@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

all inboxes | Powered by JetHome®