Skip to contentSkip to conversation

alpha: switch osf_sigprocmask() to use of sigprocmask()

PATCH In review Al Viro 4 participants 6 messages Sep 26, 2010 – Sep 30, 2010 Alpha port

lore
Share & tools
lore

Al Viro

author
#0 lore raw

PATCH 1/2 alpha: switch osf_sigprocmask() to use of sigprocmask()

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

---
 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(-)
arch/alpha/kernel/entry.S +0 -9
index d1273c1..6d159ce 100644
@@ -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:
arch/alpha/kernel/signal.c +11 -37

57 lines not on this page · raw message

arch/alpha/kernel/systbls.S +1 -1
index ce594ef..a6a1de9 100644
@@ -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
Signature · 1 line
1.5.6.5
#1 lore raw
Quoted 4 lines · Al Viro

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

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.

#2 lore raw
Quoted 14 lines · Michael Cree
Quoted 4 lines · Al Viro

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

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?)

Quoted 8 lines

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

#3 lore raw
Quoted 5 lines · Al Viro
Quoted 4 lines · Michael Cree
Quoted 3 lines · Al Viro

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

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

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.

#4 lore raw
Quoted 4 lines · Michael Cree

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.

arch/alpha/kernel/signal.c +1 -1
index 779780a..f7f054d 100644
@@ -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();
#5 lore raw
In reply to Michael Cree
Quoted 5 lines · Michael Cree

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.

arch/alpha/kernel/signal.c +1 -1
index d290845..6f7feb5 100644
@@ -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();