Explorar o código

linux: wire up sigaltstack on microblaze

sigaltstack is wired to sys_ni_syscall - microblaze is the only
architecture without it - although the signal delivery code fully
supports the alternate stack (sigsp(), __save_altstack(),
restore_altstack()). Wire it up; fixes the five sigaltstack-dependent
NPTL tests of the uClibc-ng test suite (tst-cancel20/21,
tst-cancelx20/21, tst-signal6), verified on qemu petalogix-s3adsp1800
with 6.5.10. Will also be submitted to LKML.

Signed-off-by: Ramin Moussavi <ramin.moussavi@yacoub.de>
Ramin Moussavi hai 2 días
pai
achega
5cccacf5c9

+ 30 - 0
target/linux/patches/5.10.257/microblaze-wire-up-sigaltstack.patch

@@ -0,0 +1,30 @@
+From: Ramin Moussavi <ramin.moussavi@yacoub.de>
+Subject: [PATCH] microblaze: wire up sigaltstack
+
+sigaltstack is wired to sys_ni_syscall - microblaze is the only
+architecture without it - although the microblaze signal delivery code
+fully supports the alternate signal stack: get_sigframe() picks the
+stack via sigsp(), setup_rt_frame() saves it with __save_altstack() and
+sys_rt_sigreturn() calls restore_altstack().
+
+Wire it up to sys_sigaltstack.
+
+Tested on qemu petalogix-s3adsp1800 (microblazeel, kernel 6.5.10 and
+syscall table unchanged in current mainline) with the uClibc-ng test
+suite: the five sigaltstack-dependent NPTL tests (tst-cancel20/21,
+tst-cancelx20/21, tst-signal6) pass; before this change sigaltstack()
+returned ENOSYS.
+
+Signed-off-by: Ramin Moussavi <ramin.moussavi@yacoub.de>
+
+--- a/arch/microblaze/kernel/syscalls/syscall.tbl
++++ b/arch/microblaze/kernel/syscalls/syscall.tbl
+@@ -193,7 +193,7 @@
+ 183	common	getcwd				sys_getcwd
+ 184	common	capget				sys_capget
+ 185	common	capset				sys_capset
+-186	common	sigaltstack			sys_ni_syscall
++186	common	sigaltstack			sys_sigaltstack
+ 187	common	sendfile			sys_sendfile
+ 188	common	getpmsg				sys_ni_syscall
+ 189	common	putpmsg				sys_ni_syscall

+ 30 - 0
target/linux/patches/5.15.208/microblaze-wire-up-sigaltstack.patch

@@ -0,0 +1,30 @@
+From: Ramin Moussavi <ramin.moussavi@yacoub.de>
+Subject: [PATCH] microblaze: wire up sigaltstack
+
+sigaltstack is wired to sys_ni_syscall - microblaze is the only
+architecture without it - although the microblaze signal delivery code
+fully supports the alternate signal stack: get_sigframe() picks the
+stack via sigsp(), setup_rt_frame() saves it with __save_altstack() and
+sys_rt_sigreturn() calls restore_altstack().
+
+Wire it up to sys_sigaltstack.
+
+Tested on qemu petalogix-s3adsp1800 (microblazeel, kernel 6.5.10 and
+syscall table unchanged in current mainline) with the uClibc-ng test
+suite: the five sigaltstack-dependent NPTL tests (tst-cancel20/21,
+tst-cancelx20/21, tst-signal6) pass; before this change sigaltstack()
+returned ENOSYS.
+
+Signed-off-by: Ramin Moussavi <ramin.moussavi@yacoub.de>
+
+--- a/arch/microblaze/kernel/syscalls/syscall.tbl
++++ b/arch/microblaze/kernel/syscalls/syscall.tbl
+@@ -193,7 +193,7 @@
+ 183	common	getcwd				sys_getcwd
+ 184	common	capget				sys_capget
+ 185	common	capset				sys_capset
+-186	common	sigaltstack			sys_ni_syscall
++186	common	sigaltstack			sys_sigaltstack
+ 187	common	sendfile			sys_sendfile
+ 188	common	getpmsg				sys_ni_syscall
+ 189	common	putpmsg				sys_ni_syscall

+ 30 - 0
target/linux/patches/5.4.292/microblaze-wire-up-sigaltstack.patch

@@ -0,0 +1,30 @@
+From: Ramin Moussavi <ramin.moussavi@yacoub.de>
+Subject: [PATCH] microblaze: wire up sigaltstack
+
+sigaltstack is wired to sys_ni_syscall - microblaze is the only
+architecture without it - although the microblaze signal delivery code
+fully supports the alternate signal stack: get_sigframe() picks the
+stack via sigsp(), setup_rt_frame() saves it with __save_altstack() and
+sys_rt_sigreturn() calls restore_altstack().
+
+Wire it up to sys_sigaltstack.
+
+Tested on qemu petalogix-s3adsp1800 (microblazeel, kernel 6.5.10 and
+syscall table unchanged in current mainline) with the uClibc-ng test
+suite: the five sigaltstack-dependent NPTL tests (tst-cancel20/21,
+tst-cancelx20/21, tst-signal6) pass; before this change sigaltstack()
+returned ENOSYS.
+
+Signed-off-by: Ramin Moussavi <ramin.moussavi@yacoub.de>
+
+--- a/arch/microblaze/kernel/syscalls/syscall.tbl
++++ b/arch/microblaze/kernel/syscalls/syscall.tbl
+@@ -193,7 +193,7 @@
+ 183	common	getcwd				sys_getcwd
+ 184	common	capget				sys_capget
+ 185	common	capset				sys_capset
+-186	common	sigaltstack			sys_ni_syscall
++186	common	sigaltstack			sys_sigaltstack
+ 187	common	sendfile			sys_sendfile
+ 188	common	getpmsg				sys_ni_syscall
+ 189	common	putpmsg				sys_ni_syscall

+ 30 - 0
target/linux/patches/6.1.174/microblaze-wire-up-sigaltstack.patch

@@ -0,0 +1,30 @@
+From: Ramin Moussavi <ramin.moussavi@yacoub.de>
+Subject: [PATCH] microblaze: wire up sigaltstack
+
+sigaltstack is wired to sys_ni_syscall - microblaze is the only
+architecture without it - although the microblaze signal delivery code
+fully supports the alternate signal stack: get_sigframe() picks the
+stack via sigsp(), setup_rt_frame() saves it with __save_altstack() and
+sys_rt_sigreturn() calls restore_altstack().
+
+Wire it up to sys_sigaltstack.
+
+Tested on qemu petalogix-s3adsp1800 (microblazeel, kernel 6.5.10 and
+syscall table unchanged in current mainline) with the uClibc-ng test
+suite: the five sigaltstack-dependent NPTL tests (tst-cancel20/21,
+tst-cancelx20/21, tst-signal6) pass; before this change sigaltstack()
+returned ENOSYS.
+
+Signed-off-by: Ramin Moussavi <ramin.moussavi@yacoub.de>
+
+--- a/arch/microblaze/kernel/syscalls/syscall.tbl
++++ b/arch/microblaze/kernel/syscalls/syscall.tbl
+@@ -193,7 +193,7 @@
+ 183	common	getcwd				sys_getcwd
+ 184	common	capget				sys_capget
+ 185	common	capset				sys_capset
+-186	common	sigaltstack			sys_ni_syscall
++186	common	sigaltstack			sys_sigaltstack
+ 187	common	sendfile			sys_sendfile
+ 188	common	getpmsg				sys_ni_syscall
+ 189	common	putpmsg				sys_ni_syscall

+ 30 - 0
target/linux/patches/6.12.91/microblaze-wire-up-sigaltstack.patch

@@ -0,0 +1,30 @@
+From: Ramin Moussavi <ramin.moussavi@yacoub.de>
+Subject: [PATCH] microblaze: wire up sigaltstack
+
+sigaltstack is wired to sys_ni_syscall - microblaze is the only
+architecture without it - although the microblaze signal delivery code
+fully supports the alternate signal stack: get_sigframe() picks the
+stack via sigsp(), setup_rt_frame() saves it with __save_altstack() and
+sys_rt_sigreturn() calls restore_altstack().
+
+Wire it up to sys_sigaltstack.
+
+Tested on qemu petalogix-s3adsp1800 (microblazeel, kernel 6.5.10 and
+syscall table unchanged in current mainline) with the uClibc-ng test
+suite: the five sigaltstack-dependent NPTL tests (tst-cancel20/21,
+tst-cancelx20/21, tst-signal6) pass; before this change sigaltstack()
+returned ENOSYS.
+
+Signed-off-by: Ramin Moussavi <ramin.moussavi@yacoub.de>
+
+--- a/arch/microblaze/kernel/syscalls/syscall.tbl
++++ b/arch/microblaze/kernel/syscalls/syscall.tbl
+@@ -193,7 +193,7 @@
+ 183	common	getcwd				sys_getcwd
+ 184	common	capget				sys_capget
+ 185	common	capset				sys_capset
+-186	common	sigaltstack			sys_ni_syscall
++186	common	sigaltstack			sys_sigaltstack
+ 187	common	sendfile			sys_sendfile
+ 188	common	getpmsg				sys_ni_syscall
+ 189	common	putpmsg				sys_ni_syscall

+ 30 - 0
target/linux/patches/6.18.33/microblaze-wire-up-sigaltstack.patch

@@ -0,0 +1,30 @@
+From: Ramin Moussavi <ramin.moussavi@yacoub.de>
+Subject: [PATCH] microblaze: wire up sigaltstack
+
+sigaltstack is wired to sys_ni_syscall - microblaze is the only
+architecture without it - although the microblaze signal delivery code
+fully supports the alternate signal stack: get_sigframe() picks the
+stack via sigsp(), setup_rt_frame() saves it with __save_altstack() and
+sys_rt_sigreturn() calls restore_altstack().
+
+Wire it up to sys_sigaltstack.
+
+Tested on qemu petalogix-s3adsp1800 (microblazeel, kernel 6.5.10 and
+syscall table unchanged in current mainline) with the uClibc-ng test
+suite: the five sigaltstack-dependent NPTL tests (tst-cancel20/21,
+tst-cancelx20/21, tst-signal6) pass; before this change sigaltstack()
+returned ENOSYS.
+
+Signed-off-by: Ramin Moussavi <ramin.moussavi@yacoub.de>
+
+--- a/arch/microblaze/kernel/syscalls/syscall.tbl
++++ b/arch/microblaze/kernel/syscalls/syscall.tbl
+@@ -193,7 +193,7 @@
+ 183	common	getcwd				sys_getcwd
+ 184	common	capget				sys_capget
+ 185	common	capset				sys_capset
+-186	common	sigaltstack			sys_ni_syscall
++186	common	sigaltstack			sys_sigaltstack
+ 187	common	sendfile			sys_sendfile
+ 188	common	getpmsg				sys_ni_syscall
+ 189	common	putpmsg				sys_ni_syscall

+ 30 - 0
target/linux/patches/6.6.141/microblaze-wire-up-sigaltstack.patch

@@ -0,0 +1,30 @@
+From: Ramin Moussavi <ramin.moussavi@yacoub.de>
+Subject: [PATCH] microblaze: wire up sigaltstack
+
+sigaltstack is wired to sys_ni_syscall - microblaze is the only
+architecture without it - although the microblaze signal delivery code
+fully supports the alternate signal stack: get_sigframe() picks the
+stack via sigsp(), setup_rt_frame() saves it with __save_altstack() and
+sys_rt_sigreturn() calls restore_altstack().
+
+Wire it up to sys_sigaltstack.
+
+Tested on qemu petalogix-s3adsp1800 (microblazeel, kernel 6.5.10 and
+syscall table unchanged in current mainline) with the uClibc-ng test
+suite: the five sigaltstack-dependent NPTL tests (tst-cancel20/21,
+tst-cancelx20/21, tst-signal6) pass; before this change sigaltstack()
+returned ENOSYS.
+
+Signed-off-by: Ramin Moussavi <ramin.moussavi@yacoub.de>
+
+--- a/arch/microblaze/kernel/syscalls/syscall.tbl
++++ b/arch/microblaze/kernel/syscalls/syscall.tbl
+@@ -193,7 +193,7 @@
+ 183	common	getcwd				sys_getcwd
+ 184	common	capget				sys_capget
+ 185	common	capset				sys_capset
+-186	common	sigaltstack			sys_ni_syscall
++186	common	sigaltstack			sys_sigaltstack
+ 187	common	sendfile			sys_sendfile
+ 188	common	getpmsg				sys_ni_syscall
+ 189	common	putpmsg				sys_ni_syscall