public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Richard Henderson <rth@redhat.com>
To: David Mosberger <davidm@hpl.hp.com>
Cc: Andreas Schwab <schwab@suse.de>,
	linux-ia64@linuxia64.org, marcelo@conectiva.com.br,
	torvalds@transmeta.com, linux-kernel@vger.kernel.org
Subject: alpha bug in signal handling
Date: Tue, 4 Dec 2001 19:00:48 -0800	[thread overview]
Message-ID: <20011204190048.B8179@redhat.com> (raw)
In-Reply-To: <jepu5xqnva.fsf@sykes.suse.de> <15372.13000.922405.379605@napali.hpl.hp.com> <20011204171426.B7982@redhat.com> <15373.33622.236872.92057@napali.hpl.hp.com>
In-Reply-To: <15373.33622.236872.92057@napali.hpl.hp.com>; from davidm@hpl.hp.com on Tue, Dec 04, 2001 at 06:15:50PM -0800

On Tue, Dec 04, 2001 at 06:15:50PM -0800, David Mosberger wrote:
> Oh, sorry, I was referring to teh *other* problem... ;-)
> 
> What I meant is that the check for re-scheduling
> (current->need_resched) and signal deliverify (current->sigpending)
> needs to be done with interrupts turned off, and the interrupts need
> to be left off until user space is reached.  Otherwise, you could get
> an interrupt which would wake up a higher priority task or post a
> signal between the check and the return to user space.
> 
> I didn't see this interrupt disabling in the Alpha version of entry.S,
> but I have to admit my Alpha assembly is getting quite rusty.

Oh, yes, I see.  This should fix it.


r~



--- arch/alpha/kernel/entry.S.orig	Tue Dec  4 18:40:53 2001
+++ arch/alpha/kernel/entry.S	Tue Dec  4 18:46:33 2001
@@ -580,6 +580,10 @@
 	and	$0,8,$0
 	beq	$0,restore_all
 ret_from_reschedule:
+	/* Turn off interrupts so that resched and signal delivery
+	   checks are done atomically.  */
+	addq	$31,7,$16
+	call_pal PAL_swpipl
 	ldq	$2,TASK_NEED_RESCHED($8)
 	lda	$4,init_task_union
 	bne	$2,reschedule

       reply	other threads:[~2001-12-05  3:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <jepu5xqnva.fsf@sykes.suse.de>
     [not found] ` <15372.13000.922405.379605@napali.hpl.hp.com>
     [not found]   ` <20011204171426.B7982@redhat.com>
     [not found]     ` <15373.33622.236872.92057@napali.hpl.hp.com>
2001-12-05  3:00       ` Richard Henderson [this message]
2001-12-05 11:23         ` alpha bug in signal handling David S. Miller
2001-12-05 16:58           ` Richard Henderson
2001-12-05 20:17             ` David S. Miller
2001-12-05 20:55           ` Paul Mackerras
2001-12-05 21:15             ` Benjamin Herrenschmidt
2001-12-06  1:09             ` David S. Miller

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=20011204190048.B8179@redhat.com \
    --to=rth@redhat.com \
    --cc=davidm@hpl.hp.com \
    --cc=linux-ia64@linuxia64.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo@conectiva.com.br \
    --cc=schwab@suse.de \
    --cc=torvalds@transmeta.com \
    /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