public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] alpha: switch osf_sigprocmask() to use of sigprocmask()
@ 2010-09-26 18:28 Al Viro
  2010-09-28  9:39 ` Michael Cree
  0 siblings, 1 reply; 6+ messages in thread
From: Al Viro @ 2010-09-26 18:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: mattst88, torvalds


get rid of a useless wrapper, while we are at it

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
 arch/alpha/kernel/entry.S   |    9 --------
 arch/alpha/kernel/signal.c  |   46 +++++++++---------------------------------
 arch/alpha/kernel/systbls.S |    2 +-
 3 files changed, 11 insertions(+), 46 deletions(-)

diff --git a/arch/alpha/kernel/entry.S b/arch/alpha/kernel/entry.S
index d1273c1..6d159ce 100644
--- a/arch/alpha/kernel/entry.S
+++ b/arch/alpha/kernel/entry.S
@@ -915,15 +915,6 @@ sys_execve:
 .end sys_execve
 
 	.align	4
-	.globl	osf_sigprocmask
-	.ent	osf_sigprocmask
-osf_sigprocmask:
-	.prologue 0
-	mov	$sp, $18
-	jmp	$31, sys_osf_sigprocmask
-.end osf_sigprocmask
-
-	.align	4
 	.globl	alpha_ni_syscall
 	.ent	alpha_ni_syscall
 alpha_ni_syscall:
diff --git a/arch/alpha/kernel/signal.c b/arch/alpha/kernel/signal.c
index 0f6b51a..06609aa 100644
--- a/arch/alpha/kernel/signal.c
+++ b/arch/alpha/kernel/signal.c
@@ -41,46 +41,20 @@ static void do_signal(struct pt_regs *, struct switch_stack *,
 /*
  * The OSF/1 sigprocmask calling sequence is different from the
  * C sigprocmask() sequence..
- *
- * how:
- * 1 - SIG_BLOCK
- * 2 - SIG_UNBLOCK
- * 3 - SIG_SETMASK
- *
- * We change the range to -1 .. 1 in order to let gcc easily
- * use the conditional move instructions.
- *
- * Note that we don't need to acquire the kernel lock for SMP
- * operation, as all of this is local to this thread.
  */
-SYSCALL_DEFINE3(osf_sigprocmask, int, how, unsigned long, newmask,
-		struct pt_regs *, regs)
+SYSCALL_DEFINE2(osf_sigprocmask, int, how, unsigned long, newmask)
 {
-	unsigned long oldmask = -EINVAL;
-
-	if ((unsigned long)how-1 <= 2) {
-		long sign = how-2;		/* -1 .. 1 */
-		unsigned long block, unblock;
-
-		newmask &= _BLOCKABLE;
-		spin_lock_irq(&current->sighand->siglock);
-		oldmask = current->blocked.sig[0];
-
-		unblock = oldmask & ~newmask;
-		block = oldmask | newmask;
-		if (!sign)
-			block = unblock;
-		if (sign <= 0)
-			newmask = block;
-		if (_NSIG_WORDS > 1 && sign > 0)
-			sigemptyset(&current->blocked);
-		current->blocked.sig[0] = newmask;
-		recalc_sigpending();
-		spin_unlock_irq(&current->sighand->siglock);
-
-		regs->r0 = 0;		/* special no error return */
+	sigset_t oldmask;
+	sigset_t mask;
+	unsigned long res;
+
+	siginitset(&mask, newmask & ~_BLOCKABLE);
+	res = siprocmask(how, &mask, &oldmask);
+	if (!res) {
+		force_successful_syscall_return();
+		res = oldmask->sig[0];
 	}
-	return oldmask;
+	return res;
 }
 
 SYSCALL_DEFINE3(osf_sigaction, int, sig,
diff --git a/arch/alpha/kernel/systbls.S b/arch/alpha/kernel/systbls.S
index ce594ef..a6a1de9 100644
--- a/arch/alpha/kernel/systbls.S
+++ b/arch/alpha/kernel/systbls.S
@@ -58,7 +58,7 @@ sys_call_table:
 	.quad sys_open				/* 45 */
 	.quad alpha_ni_syscall
 	.quad sys_getxgid
-	.quad osf_sigprocmask
+	.quad sys_osf_sigprocmask
 	.quad alpha_ni_syscall
 	.quad alpha_ni_syscall			/* 50 */
 	.quad sys_acct
-- 
1.5.6.5


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

* Re: [PATCH 1/2] alpha: switch osf_sigprocmask() to use of sigprocmask()
  2010-09-26 18:28 [PATCH 1/2] alpha: switch osf_sigprocmask() to use of sigprocmask() Al Viro
@ 2010-09-28  9:39 ` Michael Cree
  2010-09-29  1:07   ` Al Viro
  0 siblings, 1 reply; 6+ messages in thread
From: Michael Cree @ 2010-09-28  9:39 UTC (permalink / raw)
  To: Al Viro; +Cc: linux-kernel, mattst88, torvalds

On 27/09/10 07:28, Al Viro wrote:
>
> get rid of a useless wrapper, while we are at it
>
> Signed-off-by: Al Viro<viro@zeniv.linux.org.uk>

Compiling this leads to the following errors:

arch/alpha/kernel/signal.c: In function ‘SYSC_osf_sigprocmask’:
arch/alpha/kernel/signal.c:52: error: implicit declaration of function 
‘siprocmask’
arch/alpha/kernel/signal.c:55: error: invalid type argument of ‘->’ 
(have ‘sigset_t’)

Obviously it should be sigprocmask at line 52, and presumably line 55 
which is currently

		res = oldmask->sig[0];

should be

		res = oldmask.sig[0];

Cheers
Michael.

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

* Re: [PATCH 1/2] alpha: switch osf_sigprocmask() to use of sigprocmask()
  2010-09-28  9:39 ` Michael Cree
@ 2010-09-29  1:07   ` Al Viro
  2010-09-30  7:39     ` Michael Cree
  0 siblings, 1 reply; 6+ messages in thread
From: Al Viro @ 2010-09-29  1:07 UTC (permalink / raw)
  To: Michael Cree; +Cc: Al Viro, linux-kernel, mattst88, torvalds

On Tue, Sep 28, 2010 at 10:39:43PM +1300, Michael Cree wrote:
> On 27/09/10 07:28, Al Viro wrote:
> >
> >get rid of a useless wrapper, while we are at it
> >
> >Signed-off-by: Al Viro<viro@zeniv.linux.org.uk>
> 
> Compiling this leads to the following errors:
> 
> arch/alpha/kernel/signal.c: In function ?SYSC_osf_sigprocmask?:
> arch/alpha/kernel/signal.c:52: error: implicit declaration of
> function ?siprocmask?
> arch/alpha/kernel/signal.c:55: error: invalid type argument of ?->?
> (have ?sigset_t?)
> 
> Obviously it should be sigprocmask at line 52, and presumably line
> 55 which is currently
> 
> 		res = oldmask->sig[0];
> 
> should be
> 
> 		res = oldmask.sig[0];

Grrrr....   My apologies - cherry-pick from the wrong branch ;-/

Al "nothing like seeing the errors one has fixed show up in what's sent" Viro

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

* Re: [PATCH 1/2] alpha: switch osf_sigprocmask() to use of sigprocmask()
  2010-09-29  1:07   ` Al Viro
@ 2010-09-30  7:39     ` Michael Cree
  2010-09-30 11:50       ` Al Viro
  2010-09-30 11:56       ` Ivan Kokshaysky
  0 siblings, 2 replies; 6+ messages in thread
From: Michael Cree @ 2010-09-30  7:39 UTC (permalink / raw)
  To: Al Viro; +Cc: Al Viro, linux-kernel, mattst88, torvalds, linux-alpha

On 29/09/10 14:07, Al Viro wrote:
> On Tue, Sep 28, 2010 at 10:39:43PM +1300, Michael Cree wrote:
>> On 27/09/10 07:28, Al Viro wrote:
>>>
>>> get rid of a useless wrapper, while we are at it
>>>
>>> Signed-off-by: Al Viro<viro@zeniv.linux.org.uk>
>>
>> Compiling this leads to the following errors:
 >
> Grrrr....   My apologies - cherry-pick from the wrong branch ;-/
>
> Al "nothing like seeing the errors one has fixed show up in what's sent" Viro

It appears to be worse than that.  It introduces a regression.  On boot 
up on a Compaq Alpha XP1000 the system appears to freeze at the point of 
mounting swap.  It eventually resumes after almost three minutes and 
continues to boot.  A bisection returned this very commit as the first 
bad commit.  With a kernel without this commit the (truncated) bootup 
log is:

[   19.904286] ftdi_sio: v1.6.0:USB FTDI Serial Converters Driver
[   20.133778] PCI: Setting latency timer of device 0000:01:00.1 to 64
[   20.900379] ieee1394: Host added: ID:BUS[0-00:1023] 
GUID[0000303c0009c6d0]
[   23.142566] hda-intel: azx_get_response timeout, switching to polling 
mode: last cmd=0x000f0001
[   24.162097] Adding 1999992k swap on /dev/sda2.  Priority:-1 extents:1 
across:1999992k
[   24.495104] EXT3-fs (sda4): using internal journal

With the commit the log becomes:

[   19.970692] ftdi_sio: v1.6.0:USB FTDI Serial Converters Driver
[   20.207020] PCI: Setting latency timer of device 0000:01:00.1 to 64
[   21.052723] ieee1394: Host added: ID:BUS[0-00:1023] 
GUID[0000303c0009c6d0]
[   23.215808] hda-intel: azx_get_response timeout, switching to polling 
mode: last cmd=0x000f0001
[  189.828027] Adding 1999992k swap on /dev/sda2.  Priority:-1 extents:1 
across:1999992k
[  190.162012] EXT3-fs (sda4): using internal journal

Otherwise the system seems to come up okay.

Cheers
Michael.

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

* Re: [PATCH 1/2] alpha: switch osf_sigprocmask() to use of sigprocmask()
  2010-09-30  7:39     ` Michael Cree
@ 2010-09-30 11:50       ` Al Viro
  2010-09-30 11:56       ` Ivan Kokshaysky
  1 sibling, 0 replies; 6+ messages in thread
From: Al Viro @ 2010-09-30 11:50 UTC (permalink / raw)
  To: Michael Cree; +Cc: Al Viro, linux-kernel, mattst88, torvalds, linux-alpha

On Thu, Sep 30, 2010 at 08:39:01PM +1300, Michael Cree wrote:
> It appears to be worse than that.  It introduces a regression.  On
> boot up on a Compaq Alpha XP1000 the system appears to freeze at the
> point of mounting swap.  It eventually resumes after almost three
> minutes and continues to boot.


diff --git a/arch/alpha/kernel/signal.c b/arch/alpha/kernel/signal.c
index 779780a..f7f054d 100644
--- a/arch/alpha/kernel/signal.c
+++ b/arch/alpha/kernel/signal.c
@@ -48,7 +48,7 @@ SYSCALL_DEFINE2(osf_sigprocmask, int, how, unsigned long, newmask)
 	sigset_t mask;
 	unsigned long res;
 
-	siginitset(&mask, newmask & ~_BLOCKABLE);
+	siginitset(&mask, newmask & _BLOCKABLE);
 	res = siprocmask(how, &mask, &oldmask);
 	if (!res) {
 		force_successful_syscall_return();

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

* Re: [PATCH 1/2] alpha: switch osf_sigprocmask() to use of sigprocmask()
  2010-09-30  7:39     ` Michael Cree
  2010-09-30 11:50       ` Al Viro
@ 2010-09-30 11:56       ` Ivan Kokshaysky
  1 sibling, 0 replies; 6+ messages in thread
From: Ivan Kokshaysky @ 2010-09-30 11:56 UTC (permalink / raw)
  To: Michael Cree
  Cc: Al Viro, Al Viro, linux-kernel, mattst88, torvalds, linux-alpha

On Thu, Sep 30, 2010 at 08:39:01PM +1300, Michael Cree wrote:
> It appears to be worse than that.  It introduces a regression.  On boot up 
> on a Compaq Alpha XP1000 the system appears to freeze at the point of 
> mounting swap.  It eventually resumes after almost three minutes and 
> continues to boot.  A bisection returned this very commit as the first bad 
> commit.  With a kernel without this commit the (truncated) bootup log is:

Confirmed, I see some processes get stuck, apparently waiting for signals.

Looks like yet another typo - _BLOCKABLE is defined as
(~(sigmask(SIGKILL) | sigmask(SIGSTOP))), so (newmask & ~_BLOCKABLE)
clears everything but SIGKILL and SIGSTOP.

Ivan.

diff --git a/arch/alpha/kernel/signal.c b/arch/alpha/kernel/signal.c
index d290845..6f7feb5 100644
--- a/arch/alpha/kernel/signal.c
+++ b/arch/alpha/kernel/signal.c
@@ -48,7 +48,7 @@ SYSCALL_DEFINE2(osf_sigprocmask, int, how, unsigned long, newmask)
 	sigset_t mask;
 	unsigned long res;
 
-	siginitset(&mask, newmask & ~_BLOCKABLE);
+	siginitset(&mask, newmask & _BLOCKABLE);
 	res = sigprocmask(how, &mask, &oldmask);
 	if (!res) {
 		force_successful_syscall_return();

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

end of thread, other threads:[~2010-09-30 11:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-26 18:28 [PATCH 1/2] alpha: switch osf_sigprocmask() to use of sigprocmask() Al Viro
2010-09-28  9:39 ` Michael Cree
2010-09-29  1:07   ` Al Viro
2010-09-30  7:39     ` Michael Cree
2010-09-30 11:50       ` Al Viro
2010-09-30 11:56       ` Ivan Kokshaysky

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