public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 1/5] m68k: Fix sigaction kernel definition (BZ #23960)
@ 2018-12-11 19:56 Adhemerval Zanella
  2018-12-11 19:56 ` [PATCH 4/5] ia64: Remove kernel_sigaction.h Adhemerval Zanella
                   ` (4 more replies)
  0 siblings, 5 replies; 16+ messages in thread
From: Adhemerval Zanella @ 2018-12-11 19:56 UTC (permalink / raw)
  To: libc-alpha

Commit b4a5d26d883 (linux: Consolidate sigaction implementation) added
a wrong kernel_sigaction definition for m68k, meant for __NR_sigaction
instead of __NR_rt_sigaction as used on generic Linux sigaction
implementation.  This patch fixes it by using the Linux generic
definition meant for the RT kernel ABI.

Checked the signal tests on emulated m68-linux-gnu (Aranym).  It fixes
the faulty signal/tst-sigaction and man works as expected.

	James Clarke  <jrtc27@jrtc27.com>
	Adhemerval Zanella  <adhemerval.zanella@linaro.org>

	[BZ #23960]
	* sysdeps/unix/sysv/linux/kernel_sigaction.h (kernel_sigaction): Add
	comment about the difference due glibc definition.
	* sysdeps/unix/sysv/linux/m68k/kernel_sigaction.h (kernel_sigaction):
	Use Linux generic definition.
---
 ChangeLog                                      |  9 +++++++++
 sysdeps/unix/sysv/linux/kernel_sigaction.h     |  2 ++
 .../unix/sysv/linux/m68k/kernel_sigaction.h    | 18 ++----------------
 3 files changed, 13 insertions(+), 16 deletions(-)

diff --git a/sysdeps/unix/sysv/linux/kernel_sigaction.h b/sysdeps/unix/sysv/linux/kernel_sigaction.h
index 2dbec08099..b7359054b2 100644
--- a/sysdeps/unix/sysv/linux/kernel_sigaction.h
+++ b/sysdeps/unix/sysv/linux/kernel_sigaction.h
@@ -9,6 +9,8 @@ struct kernel_sigaction
 #ifdef SA_RESTORER
   void (*sa_restorer) (void);
 #endif
+  /* glibc sigset is larger than kernel expected one, however sigaction
+     passes the kernel expected size on rt_sigaction syscall.  */
   sigset_t sa_mask;
 };
 
diff --git a/sysdeps/unix/sysv/linux/m68k/kernel_sigaction.h b/sysdeps/unix/sysv/linux/m68k/kernel_sigaction.h
index 54972feb13..eef4bb9b65 100644
--- a/sysdeps/unix/sysv/linux/m68k/kernel_sigaction.h
+++ b/sysdeps/unix/sysv/linux/m68k/kernel_sigaction.h
@@ -1,22 +1,8 @@
-#ifndef _KERNEL_SIGACTION_H
-# define _KERNEL_SIGACTION_H
-
-#include <signal.h>
-
+/* m68k uses the generic Linux UAPI but defines SA_RESTORER.  */
 #define SA_RESTORER 0x04000000
-
-/* This is the sigaction structure from the Linux 3.2 kernel.  */
-struct kernel_sigaction
-{
-  __sighandler_t k_sa_handler;
-  sigset_t sa_mask;
-  unsigned long sa_flags;
-  void (*sa_restorer) (void);
-};
+#include <sysdeps/unix/sysv/linux/kernel_sigaction.h>
 
 #define SET_SA_RESTORER(kact, act)			\
   (kact)->sa_restorer = (act)->sa_restorer
 #define RESET_SA_RESTORER(act, kact)			\
   (act)->sa_restorer = (kact)->sa_restorer
-
-#endif
-- 
2.17.1

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

* [PATCH 3/5] hppa: Remove kernel_sigaction.h
  2018-12-11 19:56 [PATCH 1/5] m68k: Fix sigaction kernel definition (BZ #23960) Adhemerval Zanella
  2018-12-11 19:56 ` [PATCH 4/5] ia64: Remove kernel_sigaction.h Adhemerval Zanella
  2018-12-11 19:56 ` [PATCH 5/5] s390: Use generic kernel_sigaction.h Adhemerval Zanella
@ 2018-12-11 19:56 ` Adhemerval Zanella
  2018-12-18 18:28   ` Adhemerval Zanella
  2018-12-11 20:09 ` [PATCH 2/5] alpha: Use Linux generic sigaction implementation Adhemerval Zanella
  2018-12-11 22:47 ` [PATCH 1/5] m68k: Fix sigaction kernel definition (BZ #23960) Andreas Schwab
  4 siblings, 1 reply; 16+ messages in thread
From: Adhemerval Zanella @ 2018-12-11 19:56 UTC (permalink / raw)
  To: libc-alpha

HPPA kernel_sigaction.h definition is the sama as the Linux generic
one and old_kernel_sigaction is not used.

Checked on hppa-linux-gnu.

	* sysdeps/unix/sysv/linux/hppa/kernel_sigaction.h: Remove file.
---
 ChangeLog                                      |  2 ++
 .../unix/sysv/linux/hppa/kernel_sigaction.h    | 18 ------------------
 2 files changed, 2 insertions(+), 18 deletions(-)
 delete mode 100644 sysdeps/unix/sysv/linux/hppa/kernel_sigaction.h

diff --git a/sysdeps/unix/sysv/linux/hppa/kernel_sigaction.h b/sysdeps/unix/sysv/linux/hppa/kernel_sigaction.h
deleted file mode 100644
index af048cbe7d..0000000000
--- a/sysdeps/unix/sysv/linux/hppa/kernel_sigaction.h
+++ /dev/null
@@ -1,18 +0,0 @@
-/* We have a separate header file here because we do not support
-   SA_RESTORER on hppa. */
-
-/* This is the sigaction struction from the Linux 2.1.20 kernel.  */
-/* Blah.  This is bogus.  We don't ever use it. */
-struct old_kernel_sigaction {
-	__sighandler_t k_sa_handler;
-	unsigned long sa_mask;
-	unsigned long sa_flags;
-};
-
-/* This is the sigaction structure from the Linux 2.1.68 kernel.  */
-
-struct kernel_sigaction {
-	__sighandler_t k_sa_handler;
-	unsigned long sa_flags;
-	sigset_t sa_mask;
-};
-- 
2.17.1

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

* [PATCH 5/5] s390: Use generic kernel_sigaction.h
  2018-12-11 19:56 [PATCH 1/5] m68k: Fix sigaction kernel definition (BZ #23960) Adhemerval Zanella
  2018-12-11 19:56 ` [PATCH 4/5] ia64: Remove kernel_sigaction.h Adhemerval Zanella
@ 2018-12-11 19:56 ` Adhemerval Zanella
  2018-12-18 18:44   ` Adhemerval Zanella
  2018-12-11 19:56 ` [PATCH 3/5] hppa: Remove kernel_sigaction.h Adhemerval Zanella
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 16+ messages in thread
From: Adhemerval Zanella @ 2018-12-11 19:56 UTC (permalink / raw)
  To: libc-alpha

S390 kernel sigaction is the same as the Linux generic one.

Checked with a s390-linux-gnu and s390x-linux-gnu build.

	* sysdeps/unix/sysv/linux/s390/kernel_sigaction.h: Use Linux generic
	kernel_sigction definition.
---
 ChangeLog                                     |  3 ++
 .../unix/sysv/linux/s390/kernel_sigaction.h   | 28 ++-----------------
 2 files changed, 5 insertions(+), 26 deletions(-)

diff --git a/sysdeps/unix/sysv/linux/s390/kernel_sigaction.h b/sysdeps/unix/sysv/linux/s390/kernel_sigaction.h
index 7a6a2c4f29..18000a62cc 100644
--- a/sysdeps/unix/sysv/linux/s390/kernel_sigaction.h
+++ b/sysdeps/unix/sysv/linux/s390/kernel_sigaction.h
@@ -1,30 +1,6 @@
-#include <bits/types/siginfo_t.h>
-
+/* S390 uses the generic Linux UAPI but defines SA_RESTORER.  */
 #define SA_RESTORER	0x04000000
-
-/* This is the sigaction structure from the Linux 3.2 kernel.  */
-struct kernel_sigaction
-{
-  union
-  {
-    __sighandler_t _sa_handler;
-    void (*_sa_sigaction)(int, siginfo_t *, void *);
-  } _u;
-#define k_sa_handler _u._sa_handler
-  /* The 'struct sigaction' definition in s390 kernel header
-     arch/s390/include/uapi/asm/signal.h is used for __NR_rt_sigaction
-     on 64 bits and for __NR_sigaction for 31 bits.
-
-     The expected layout for __NR_rt_sigaction for 31 bits is either
-     'struct sigaction' from include/linux/signal_types.h or
-     'struct compat_sigaction' from include/linux/compat.h.
-
-     So for __NR_rt_sigaction we can use the same layout for both s390x
-     and s390.  */
-  unsigned long sa_flags;
-  void (*sa_restorer)(void);
-  sigset_t sa_mask;
-};
+#include <sysdeps/unix/sysv/linux/kernel_sigaction.h>
 
 #define SET_SA_RESTORER(kact, act)             \
   (kact)->sa_restorer = (act)->sa_restorer
-- 
2.17.1

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

* [PATCH 4/5] ia64: Remove kernel_sigaction.h
  2018-12-11 19:56 [PATCH 1/5] m68k: Fix sigaction kernel definition (BZ #23960) Adhemerval Zanella
@ 2018-12-11 19:56 ` Adhemerval Zanella
  2018-12-18 18:29   ` Adhemerval Zanella
  2018-12-11 19:56 ` [PATCH 5/5] s390: Use generic kernel_sigaction.h Adhemerval Zanella
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 16+ messages in thread
From: Adhemerval Zanella @ 2018-12-11 19:56 UTC (permalink / raw)
  To: libc-alpha

IA64 kernel_sigaction.h definition is the sama as the Linux generic
one.

Checked on hppa-linux-gnu.

	* sysdeps/unix/sysv/linux/ia64/kernel_sigaction.h: Remove file.
---
 ChangeLog                                       | 2 ++
 sysdeps/unix/sysv/linux/ia64/kernel_sigaction.h | 7 -------
 2 files changed, 2 insertions(+), 7 deletions(-)
 delete mode 100644 sysdeps/unix/sysv/linux/ia64/kernel_sigaction.h

diff --git a/sysdeps/unix/sysv/linux/ia64/kernel_sigaction.h b/sysdeps/unix/sysv/linux/ia64/kernel_sigaction.h
deleted file mode 100644
index fc9f29603c..0000000000
--- a/sysdeps/unix/sysv/linux/ia64/kernel_sigaction.h
+++ /dev/null
@@ -1,7 +0,0 @@
-/* This is the sigaction structure from the Linux 3.2 kernel.  */
-struct kernel_sigaction
-{
-  __sighandler_t k_sa_handler;
-  unsigned long sa_flags;
-  sigset_t sa_mask;               /* mask last for extensibility */
-};
-- 
2.17.1

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

* [PATCH 2/5] alpha: Use Linux generic sigaction implementation
  2018-12-11 19:56 [PATCH 1/5] m68k: Fix sigaction kernel definition (BZ #23960) Adhemerval Zanella
                   ` (2 preceding siblings ...)
  2018-12-11 19:56 ` [PATCH 3/5] hppa: Remove kernel_sigaction.h Adhemerval Zanella
@ 2018-12-11 20:09 ` Adhemerval Zanella
  2018-12-18 18:28   ` Adhemerval Zanella
  2018-12-11 22:47 ` [PATCH 1/5] m68k: Fix sigaction kernel definition (BZ #23960) Andreas Schwab
  4 siblings, 1 reply; 16+ messages in thread
From: Adhemerval Zanella @ 2018-12-11 20:09 UTC (permalink / raw)
  To: libc-alpha

Alpha rt_sigaction syscall uses a slight different kernel ABI than
generic one:

arch/alpha/kernel/signal.c

 90 SYSCALL_DEFINE5(rt_sigaction, int, sig, const struct sigaction __user *, act,
 91                 struct sigaction __user *, oact,
 92                 size_t, sigsetsize, void __user *, restorer)

Similar as sparc, the syscall expects a restorer function.  However
different than sparc, alpha defines the restorer as the 5th argument
(sparc defines as the 4th).

This patch removes the arch-specific alpha sigaction implementation,
adapt the Linux generic one to different restore placements (through
STUB macro), and make alpha use the Linux generic kernel_sigaction
definition.

Checked on alpha-linux-gnu and x86_64-linux-gnu (for sanity).

	* sysdeps/unix/sysv/linux/alpha/Makefile: Update comment about
	__syscall_rt_sigaction.
	* sysdeps/unix/sysv/linux/alpha/kernel_sigaction.h
	(kernel_sigaction): Use Linux generic defintion.
	(STUB): Define.
	(__syscall_rt_sigreturn, __syscall_sigreturn): Add prototype.
	* sysdeps/unix/sysv/linux/alpha/rt_sigaction.S
	(__syscall_rt_sigaction): Remove implementation.
	(__syscall_sigreturn, __syscall_rt_sigreturn): Define as global and
	hidden.
	* sysdeps/unix/sysv/linux/alpha/sigaction.c: Remove file.
	* sysdeps/unix/sysv/linux/alpha/sysdep.h (INLINE_SYSCALL,
	INTERNAL_SYSCALL): Remove definitions.
	* sysdeps/unix/sysv/linux/sigaction.c: Define STUB to accept both the
	action and signal set size.
	* sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c (STUB): Redefine.
	* sysdeps/unix/sysv/linux/sparc/sparc64/sigaction.c (STUB): Likewise.
---
 ChangeLog                                     | 20 +++++++++
 sysdeps/unix/sysv/linux/alpha/Makefile        |  2 +-
 .../unix/sysv/linux/alpha/kernel_sigaction.h  | 19 ++++-----
 sysdeps/unix/sysv/linux/alpha/rt_sigaction.S  | 41 ++-----------------
 sysdeps/unix/sysv/linux/alpha/sigaction.c     | 38 -----------------
 sysdeps/unix/sysv/linux/alpha/sysdep.h        | 23 -----------
 sysdeps/unix/sysv/linux/sigaction.c           |  4 +-
 .../unix/sysv/linux/sparc/sparc32/sigaction.c |  5 ++-
 .../unix/sysv/linux/sparc/sparc64/sigaction.c |  5 ++-
 9 files changed, 42 insertions(+), 115 deletions(-)
 delete mode 100644 sysdeps/unix/sysv/linux/alpha/sigaction.c

diff --git a/sysdeps/unix/sysv/linux/alpha/Makefile b/sysdeps/unix/sysv/linux/alpha/Makefile
index 50f4fb1183..fdd089af71 100644
--- a/sysdeps/unix/sysv/linux/alpha/Makefile
+++ b/sysdeps/unix/sysv/linux/alpha/Makefile
@@ -31,7 +31,7 @@ libm-routines += multc3 divtc3
 endif   # math
 
 ifeq ($(subdir),nptl)
-# pull in __syscall_error routine, __sigprocmask, __syscall_rt_sigaction
+# pull in __syscall_error routine, __sigprocmask, sigaction stubs.
 libpthread-routines += sysdep sigprocmask rt_sigaction
 libpthread-shared-only-routines += sysdep sigprocmask rt_sigaction
 endif
diff --git a/sysdeps/unix/sysv/linux/alpha/kernel_sigaction.h b/sysdeps/unix/sysv/linux/alpha/kernel_sigaction.h
index 25180ff9c9..679179b563 100644
--- a/sysdeps/unix/sysv/linux/alpha/kernel_sigaction.h
+++ b/sysdeps/unix/sysv/linux/alpha/kernel_sigaction.h
@@ -1,12 +1,11 @@
-#ifndef _KERNEL_SIGACTION_H
-# define _KERNEL_SIGACTION_H
+#include <sysdeps/unix/sysv/linux/kernel_sigaction.h>
 
-/* This is the sigaction structure from the Linux 3.2 kernel.  */
-struct kernel_sigaction
-{
-  __sighandler_t k_sa_handler;
-  unsigned int sa_flags;
-  sigset_t sa_mask;
-};
+void __syscall_rt_sigreturn (void) attribute_hidden;
+void __syscall_sigreturn (void) attribute_hidden;
 
-#endif
+#define STUB(act, sigsetsize) \
+  (sigsetsize),						\
+  (act) ? ((unsigned long)((act->sa_flags & SA_SIGINFO)	\
+			    ? &__syscall_rt_sigreturn	\
+			    : &__syscall_sigreturn))	\
+	: 0
diff --git a/sysdeps/unix/sysv/linux/alpha/rt_sigaction.S b/sysdeps/unix/sysv/linux/alpha/rt_sigaction.S
index ca25eee611..17e55239fe 100644
--- a/sysdeps/unix/sysv/linux/alpha/rt_sigaction.S
+++ b/sysdeps/unix/sysv/linux/alpha/rt_sigaction.S
@@ -18,43 +18,6 @@
 
 #include <sysdep.h>
 
-/* On Alpha we desparately want to avoid having to issue an imb.  Ordinarily
-   the kernel would have to issue one after setting up the signal return
-   stack, but the Linux rt_sigaction syscall is prepared to accept a pointer
-   to the sigreturn syscall, instead of inlining it on the stack.
-
-   This just about halves signal delivery time.  */
-
-	.text
-
-ENTRY(__syscall_rt_sigaction)
-	cfi_startproc
-	ldgp	gp,0(pv)
-#ifdef PROF
-	.set noat
-	lda	AT, _mcount
-	jsr	AT, (AT), _mcount
-	.set at
-#endif
-	.prologue 1
-
-	beq	a1, 0f
-	ldl	t0, 8(a1)				# sa_flags
-
-	ldah	a4, __syscall_sigreturn(gp)		!gprelhigh
-	ldah	t1, __syscall_rt_sigreturn(gp)		!gprelhigh
-	lda	a4, __syscall_sigreturn(a4)		!gprellow
-	lda	t1, __syscall_rt_sigreturn(t1)		!gprellow
-	and	t0, 0x40, t0				# SA_SIGINFO
-	cmovne	t0, t1, a4
-
-0:	ldi	v0, __NR_rt_sigaction
-	callsys
-	bne	a3, SYSCALL_ERROR_LABEL
-	ret
-	cfi_endproc
-PSEUDO_END(__syscall_rt_sigaction)
-
 /* To enable unwinding through the signal frame without special hackery
    elsewhere, describe the entire struct sigcontext with unwind info.
 
@@ -104,6 +67,8 @@ __syscall_sigreturn:
 	callsys
 	.size	__syscall_sigreturn, .-__syscall_sigreturn
 	.type	__syscall_sigreturn, @function
+	.global __syscall_sigreturn;
+	.hidden __syscall_sigreturn;
 
 	/* See above wrt including the nop.  */
 	cfi_def_cfa_offset (176 + 648)
@@ -116,5 +81,7 @@ __syscall_rt_sigreturn:
 	callsys
 	.size	__syscall_rt_sigreturn, .-__syscall_rt_sigreturn
 	.type	__syscall_rt_sigreturn, @function
+	.global __syscall_rt_sigreturn;
+	.hidden __syscall_rt_sigreturn;
 
 	cfi_endproc
diff --git a/sysdeps/unix/sysv/linux/alpha/sigaction.c b/sysdeps/unix/sysv/linux/alpha/sigaction.c
deleted file mode 100644
index 8051043587..0000000000
--- a/sysdeps/unix/sysv/linux/alpha/sigaction.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library.  If not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <sysdep.h>
-#include <sys/cdefs.h>
-#include <stddef.h>
-
-/*
- * In order to get the hidden arguments for rt_sigaction set up
- * properly, we need to call the assembly version.  Detect this in the
- * INLINE_SYSCALL macro, and fail to expand inline in that case.
- */
-
-#undef INLINE_SYSCALL
-#define INLINE_SYSCALL(name, nr, args...)       \
-        (__NR_##name == __NR_rt_sigaction       \
-         ? __syscall_rt_sigaction(args)         \
-         : INLINE_SYSCALL1(name, nr, args))
-
-struct kernel_sigaction;
-extern int __syscall_rt_sigaction (int, const struct kernel_sigaction *,
-				   struct kernel_sigaction *, size_t);
-
-#include <sysdeps/unix/sysv/linux/sigaction.c>
diff --git a/sysdeps/unix/sysv/linux/alpha/sysdep.h b/sysdeps/unix/sysv/linux/alpha/sysdep.h
index 080405021f..9148b4793b 100644
--- a/sysdeps/unix/sysv/linux/alpha/sysdep.h
+++ b/sysdeps/unix/sysv/linux/alpha/sysdep.h
@@ -72,27 +72,4 @@
 
 #define SINGLE_THREAD_BY_GLOBAL 1
 
-/*
- * In order to get the hidden arguments for rt_sigaction set up
- * properly, we need to call the assembly version.  This shouldn't
- * happen except for inside sigaction.c, where we handle this
- * specially.  Catch other uses and error.
- */
-
-#undef INLINE_SYSCALL
-#define INLINE_SYSCALL(name, nr, args...)				\
-({									\
-	extern char ChEcK[__NR_##name == __NR_rt_sigaction ? -1 : 1]	\
-	  __attribute__((unused));					\
-	INLINE_SYSCALL1(name, nr, args);				\
-})
-
-#undef INTERNAL_SYSCALL
-#define INTERNAL_SYSCALL(name, err_out, nr, args...)			\
-({									\
-	extern char ChEcK[__NR_##name == __NR_rt_sigaction ? -1 : 1]	\
-	  __attribute__((unused));					\
-	INTERNAL_SYSCALL1(name, err_out, nr, args);			\
-})
-
 #endif /* _LINUX_ALPHA_SYSDEP_H */
diff --git a/sysdeps/unix/sysv/linux/sigaction.c b/sysdeps/unix/sysv/linux/sigaction.c
index 0e6851a148..233ab1fcb5 100644
--- a/sysdeps/unix/sysv/linux/sigaction.c
+++ b/sysdeps/unix/sysv/linux/sigaction.c
@@ -33,7 +33,7 @@
 
 /* SPARC passes the restore function as an argument to rt_sigaction.  */
 #ifndef STUB
-# define STUB(act)
+# define STUB(act, sigsetsize) (sigsetsize)
 #endif
 
 /* If ACT is not NULL, change the action for SIG to *ACT.
@@ -57,7 +57,7 @@ __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
      real size of the user-level sigset_t.  */
   result = INLINE_SYSCALL_CALL (rt_sigaction, sig,
 				act ? &kact : NULL,
-				oact ? &koact : NULL, STUB(act) _NSIG / 8);
+				oact ? &koact : NULL, STUB (act, _NSIG / 8));
 
   if (oact && result >= 0)
     {
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c b/sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c
index 191f58729e..9f1a31a3b3 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c
@@ -27,11 +27,12 @@
 static void __rt_sigreturn_stub (void);
 static void __sigreturn_stub (void);
 
-#define STUB(act) \
+#define STUB(act, sigsetsize) \
   (act) ? ((unsigned long)((act->sa_flags & SA_SIGINFO)	\
 			    ? &__rt_sigreturn_stub	\
 			    : &__sigreturn_stub) - 8)	\
-	: 0,
+	: 0,						\
+  (sigsetsize)
 
 #include <sysdeps/unix/sysv/linux/sigaction.c>
 
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/sigaction.c b/sysdeps/unix/sysv/linux/sparc/sparc64/sigaction.c
index cfbbc6e7b4..acc76b1bf9 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/sigaction.c
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/sigaction.c
@@ -24,8 +24,9 @@
 
 static void __rt_sigreturn_stub (void);
 
-#define STUB(act) \
-  (((unsigned long) &__rt_sigreturn_stub) - 8),
+#define STUB(act, sigsetsize) \
+  (((unsigned long) &__rt_sigreturn_stub) - 8),	\
+  (sigsetsize)
 
 #include <sysdeps/unix/sysv/linux/sigaction.c>
 
-- 
2.17.1

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

* Re: [PATCH 1/5] m68k: Fix sigaction kernel definition (BZ #23960)
  2018-12-11 19:56 [PATCH 1/5] m68k: Fix sigaction kernel definition (BZ #23960) Adhemerval Zanella
                   ` (3 preceding siblings ...)
  2018-12-11 20:09 ` [PATCH 2/5] alpha: Use Linux generic sigaction implementation Adhemerval Zanella
@ 2018-12-11 22:47 ` Andreas Schwab
  2018-12-12 10:41   ` Adhemerval Zanella
  4 siblings, 1 reply; 16+ messages in thread
From: Andreas Schwab @ 2018-12-11 22:47 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: libc-alpha

On Dez 11 2018, Adhemerval Zanella <adhemerval.zanella@linaro.org> wrote:

> diff --git a/sysdeps/unix/sysv/linux/m68k/kernel_sigaction.h b/sysdeps/unix/sysv/linux/m68k/kernel_sigaction.h
> index 54972feb13..eef4bb9b65 100644
> --- a/sysdeps/unix/sysv/linux/m68k/kernel_sigaction.h
> +++ b/sysdeps/unix/sysv/linux/m68k/kernel_sigaction.h
> @@ -1,22 +1,8 @@
> -#ifndef _KERNEL_SIGACTION_H
> -# define _KERNEL_SIGACTION_H
> -
> -#include <signal.h>
> -
> +/* m68k uses the generic Linux UAPI but defines SA_RESTORER.  */
>  #define SA_RESTORER 0x04000000
> -
> -/* This is the sigaction structure from the Linux 3.2 kernel.  */
> -struct kernel_sigaction
> -{
> -  __sighandler_t k_sa_handler;
> -  sigset_t sa_mask;
> -  unsigned long sa_flags;
> -  void (*sa_restorer) (void);
> -};
> +#include <sysdeps/unix/sysv/linux/kernel_sigaction.h>
>  
>  #define SET_SA_RESTORER(kact, act)			\
>    (kact)->sa_restorer = (act)->sa_restorer
>  #define RESET_SA_RESTORER(act, kact)			\
>    (act)->sa_restorer = (kact)->sa_restorer
> -
> -#endif

There should be no need to read or set sa_restorer.  The kernel does not
use it, and it also doesn't define SA_RESTORER.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

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

* Re: [PATCH 1/5] m68k: Fix sigaction kernel definition (BZ #23960)
  2018-12-11 22:47 ` [PATCH 1/5] m68k: Fix sigaction kernel definition (BZ #23960) Andreas Schwab
@ 2018-12-12 10:41   ` Adhemerval Zanella
  2018-12-12 10:44     ` Andreas Schwab
  0 siblings, 1 reply; 16+ messages in thread
From: Adhemerval Zanella @ 2018-12-12 10:41 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: libc-alpha



On 11/12/2018 19:26, Andreas Schwab wrote:
> On Dez 11 2018, Adhemerval Zanella <adhemerval.zanella@linaro.org> wrote:
> 
>> diff --git a/sysdeps/unix/sysv/linux/m68k/kernel_sigaction.h b/sysdeps/unix/sysv/linux/m68k/kernel_sigaction.h
>> index 54972feb13..eef4bb9b65 100644
>> --- a/sysdeps/unix/sysv/linux/m68k/kernel_sigaction.h
>> +++ b/sysdeps/unix/sysv/linux/m68k/kernel_sigaction.h
>> @@ -1,22 +1,8 @@
>> -#ifndef _KERNEL_SIGACTION_H
>> -# define _KERNEL_SIGACTION_H
>> -
>> -#include <signal.h>
>> -
>> +/* m68k uses the generic Linux UAPI but defines SA_RESTORER.  */
>>  #define SA_RESTORER 0x04000000
>> -
>> -/* This is the sigaction structure from the Linux 3.2 kernel.  */
>> -struct kernel_sigaction
>> -{
>> -  __sighandler_t k_sa_handler;
>> -  sigset_t sa_mask;
>> -  unsigned long sa_flags;
>> -  void (*sa_restorer) (void);
>> -};
>> +#include <sysdeps/unix/sysv/linux/kernel_sigaction.h>
>>  
>>  #define SET_SA_RESTORER(kact, act)			\
>>    (kact)->sa_restorer = (act)->sa_restorer
>>  #define RESET_SA_RESTORER(act, kact)			\
>>    (act)->sa_restorer = (kact)->sa_restorer
>> -
>> -#endif
> 
> There should be no need to read or set sa_restorer.  The kernel does not
> use it, and it also doesn't define SA_RESTORER.

The m68k kernel does define SA_RESTORER on arch/m68k/include/asm/signal.h
(__ARCH_HAS_SA_RESTORER), but the only difference it makes for m68k is at
flush_signal_handlers where kernel sets the sa_restorer to NULL. So it
indeed should be safe to just use default kernel_sigaction.h (I don't see
any signal test issues). Updated patch below.

--

	James Clarke  <jrtc27@jrtc27.com>
	Adhemerval Zanella  <adhemerval.zanella@linaro.org>

	[BZ #23960]
	* sysdeps/unix/sysv/linux/kernel_sigaction.h (kernel_sigaction): Add
	comment about the difference due glibc definition.
	* sysdeps/unix/sysv/linux/m68k/kernel_sigaction.h: Remove file.

---

diff --git a/sysdeps/unix/sysv/linux/kernel_sigaction.h b/sysdeps/unix/sysv/linux/kernel_sigaction.h
index 2dbec08099..b7359054b2 100644
--- a/sysdeps/unix/sysv/linux/kernel_sigaction.h
+++ b/sysdeps/unix/sysv/linux/kernel_sigaction.h
@@ -9,6 +9,8 @@ struct kernel_sigaction
 #ifdef SA_RESTORER
   void (*sa_restorer) (void);
 #endif
+  /* glibc sigset is larger than kernel expected one, however sigaction
+     passes the kernel expected size on rt_sigaction syscall.  */
   sigset_t sa_mask;
 };
 
diff --git a/sysdeps/unix/sysv/linux/m68k/kernel_sigaction.h b/sysdeps/unix/sysv/linux/m68k/kernel_sigaction.h
deleted file mode 100644
index 54972feb13..0000000000
--- a/sysdeps/unix/sysv/linux/m68k/kernel_sigaction.h
+++ /dev/null
@@ -1,22 +0,0 @@
-#ifndef _KERNEL_SIGACTION_H
-# define _KERNEL_SIGACTION_H
-
-#include <signal.h>
-
-#define SA_RESTORER 0x04000000
-
-/* This is the sigaction structure from the Linux 3.2 kernel.  */
-struct kernel_sigaction
-{
-  __sighandler_t k_sa_handler;
-  sigset_t sa_mask;
-  unsigned long sa_flags;
-  void (*sa_restorer) (void);
-};
-
-#define SET_SA_RESTORER(kact, act)			\
-  (kact)->sa_restorer = (act)->sa_restorer
-#define RESET_SA_RESTORER(act, kact)			\
-  (act)->sa_restorer = (kact)->sa_restorer
-
-#endif



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

* Re: [PATCH 1/5] m68k: Fix sigaction kernel definition (BZ #23960)
  2018-12-12 10:41   ` Adhemerval Zanella
@ 2018-12-12 10:44     ` Andreas Schwab
  2018-12-12 19:01       ` Adhemerval Zanella
  0 siblings, 1 reply; 16+ messages in thread
From: Andreas Schwab @ 2018-12-12 10:44 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: libc-alpha

On Dez 12 2018, Adhemerval Zanella <adhemerval.zanella@linaro.org> wrote:

> The m68k kernel does define SA_RESTORER on arch/m68k/include/asm/signal.h
> (__ARCH_HAS_SA_RESTORER),

These are not the same.  The latter only tells <linux/signal_types.h> to
add the sa_restorer member, independent of SA_RESTORER (which m68k
doesn't define).

> but the only difference it makes for m68k is at flush_signal_handlers
> where kernel sets the sa_restorer to NULL. So it indeed should be safe
> to just use default kernel_sigaction.h (I don't see any signal test
> issues). Updated patch below.

This fails to add the sa_restorer member, causing the signal mask to be
mishandled.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

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

* Re: [PATCH 1/5] m68k: Fix sigaction kernel definition (BZ #23960)
  2018-12-12 10:44     ` Andreas Schwab
@ 2018-12-12 19:01       ` Adhemerval Zanella
  2018-12-14 18:43         ` Andreas Schwab
  2018-12-16 22:57         ` Aurelien Jarno
  0 siblings, 2 replies; 16+ messages in thread
From: Adhemerval Zanella @ 2018-12-12 19:01 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: libc-alpha



On 12/12/2018 08:41, Andreas Schwab wrote:
> On Dez 12 2018, Adhemerval Zanella <adhemerval.zanella@linaro.org> wrote:
> 
>> The m68k kernel does define SA_RESTORER on arch/m68k/include/asm/signal.h
>> (__ARCH_HAS_SA_RESTORER),
> 
> These are not the same.  The latter only tells <linux/signal_types.h> to
> add the sa_restorer member, independent of SA_RESTORER (which m68k
> doesn't define).
> 
>> but the only difference it makes for m68k is at flush_signal_handlers
>> where kernel sets the sa_restorer to NULL. So it indeed should be safe
>> to just use default kernel_sigaction.h (I don't see any signal test
>> issues). Updated patch below.
> 
> This fails to add the sa_restorer member, causing the signal mask to be
> mishandled.
> 
> Andreas.
> 

Updated patch below.

--

	[BZ #23960]
	* sysdeps/unix/sysv/linux/kernel_sigaction.h (HAS_SA_RESTORER):
	Define if SA_RESTORER is defined.
	(kernel_sigaction): Define sa_restorer if HAS_SA_RESTORER is defined.
	(SET_SA_RESTORER, RESET_SA_RESTORER): Define iff the macro are not
	already defined.
	* sysdeps/unix/sysv/linux/m68k/kernel_sigaction.h (SA_RESTORER,
	kernel_sigaction, SET_SA_RESTORER, RESET_SA_RESTORER): Remove
	definitions.
	(HAS_SA_RESTORER): Define.
	* sysdeps/unix/sysv/linux/sparc/kernel_sigaction.h (SA_RESTORER,
	SET_SA_RESTORER, RESET_SA_RESTORER): Remove definition.
	(HAS_SA_RESTORER): Define.
	* sysdeps/unix/sysv/linux/nios2/kernel_sigaction.h: Include generic
	kernel_sigaction after define SET_SA_RESTORER and RESET_SA_RESTORER.
	* sysdeps/unix/sysv/linux/powerpc/kernel_sigaction.h: Likewise.
	* sysdeps/unix/sysv/linux/s390/kernel_sigaction.h: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/sigaction.c: Likewise.

---

diff --git a/sysdeps/unix/sysv/linux/kernel_sigaction.h b/sysdeps/unix/sysv/linux/kernel_sigaction.h
index 2dbec08099..1c36146d46 100644
--- a/sysdeps/unix/sysv/linux/kernel_sigaction.h
+++ b/sysdeps/unix/sysv/linux/kernel_sigaction.h
@@ -1,19 +1,27 @@
 #ifndef _KERNEL_SIGACTION_H
 # define _KERNEL_SIGACTION_H
 
+#ifdef SA_RESTORER
+# define HAS_SA_RESTORER 1
+#endif
+
 /* This is the sigaction structure from the Linux 3.2 kernel.  */
 struct kernel_sigaction
 {
   __sighandler_t k_sa_handler;
   unsigned long sa_flags;
-#ifdef SA_RESTORER
+#ifdef HAS_SA_RESTORER
   void (*sa_restorer) (void);
 #endif
+  /* glibc sigset is larger than kernel expected one, however sigaction
+     passes the kernel expected size on rt_sigaction syscall.  */
   sigset_t sa_mask;
 };
 
-#ifndef SA_RESTORER
+#ifndef SET_SA_RESTORER
 # define SET_SA_RESTORER(kact, act)
+#endif
+#ifndef RESET_SA_RESTORER
 # define RESET_SA_RESTORER(act, kact)
 #endif
 
diff --git a/sysdeps/unix/sysv/linux/m68k/kernel_sigaction.h b/sysdeps/unix/sysv/linux/m68k/kernel_sigaction.h
index 54972feb13..464b351d6d 100644
--- a/sysdeps/unix/sysv/linux/m68k/kernel_sigaction.h
+++ b/sysdeps/unix/sysv/linux/m68k/kernel_sigaction.h
@@ -1,22 +1,4 @@
-#ifndef _KERNEL_SIGACTION_H
-# define _KERNEL_SIGACTION_H
-
-#include <signal.h>
-
-#define SA_RESTORER 0x04000000
-
-/* This is the sigaction structure from the Linux 3.2 kernel.  */
-struct kernel_sigaction
-{
-  __sighandler_t k_sa_handler;
-  sigset_t sa_mask;
-  unsigned long sa_flags;
-  void (*sa_restorer) (void);
-};
-
-#define SET_SA_RESTORER(kact, act)			\
-  (kact)->sa_restorer = (act)->sa_restorer
-#define RESET_SA_RESTORER(act, kact)			\
-  (act)->sa_restorer = (kact)->sa_restorer
-
-#endif
+/* m68k does not define SA_RESTORER, but does have sa_restorer member
+   on kernel sigaction struct.  */
+#define HAS_SA_RESTORER 1
+#include <sysdeps/unix/sysv/linux/kernel_sigaction.h>
diff --git a/sysdeps/unix/sysv/linux/nios2/kernel_sigaction.h b/sysdeps/unix/sysv/linux/nios2/kernel_sigaction.h
index 4ada322104..89f9bcedfd 100644
--- a/sysdeps/unix/sysv/linux/nios2/kernel_sigaction.h
+++ b/sysdeps/unix/sysv/linux/nios2/kernel_sigaction.h
@@ -1,8 +1,9 @@
 /* NIOS2 uses the generic Linux UAPI but defines SA_RESTORER.  */
 #define SA_RESTORER 0x04000000
-#include <sysdeps/unix/sysv/linux/kernel_sigaction.h>
 
 #define SET_SA_RESTORER(kact, act)             \
   (kact)->sa_restorer = (act)->sa_restorer
 #define RESET_SA_RESTORER(act, kact)           \
   (act)->sa_restorer = (kact)->sa_restorer
+
+#include <sysdeps/unix/sysv/linux/kernel_sigaction.h>
diff --git a/sysdeps/unix/sysv/linux/powerpc/kernel_sigaction.h b/sysdeps/unix/sysv/linux/powerpc/kernel_sigaction.h
index aef3d5a3b3..bac03ee45d 100644
--- a/sysdeps/unix/sysv/linux/powerpc/kernel_sigaction.h
+++ b/sysdeps/unix/sysv/linux/powerpc/kernel_sigaction.h
@@ -1,9 +1,10 @@
 /* powerpc kernel sigaction is similar to generic Linux UAPI one,
    but the architecture also defines SA_RESTORER.  */
 #define SA_RESTORER 0x04000000
-#include <sysdeps/unix/sysv/linux/kernel_sigaction.h>
 
 #define SET_SA_RESTORER(kact, act)             \
   (kact)->sa_restorer = (act)->sa_restorer
 #define RESET_SA_RESTORER(act, kact)           \
   (act)->sa_restorer = (kact)->sa_restorer
+
+#include <sysdeps/unix/sysv/linux/kernel_sigaction.h>
diff --git a/sysdeps/unix/sysv/linux/s390/kernel_sigaction.h b/sysdeps/unix/sysv/linux/s390/kernel_sigaction.h
index 7a6a2c4f29..14f44c200b 100644
--- a/sysdeps/unix/sysv/linux/s390/kernel_sigaction.h
+++ b/sysdeps/unix/sysv/linux/s390/kernel_sigaction.h
@@ -30,3 +30,5 @@ struct kernel_sigaction
   (kact)->sa_restorer = (act)->sa_restorer
 #define RESET_SA_RESTORER(act, kact)           \
   (act)->sa_restorer = (kact)->sa_restorer
+
+#include <sysdeps/unix/sysv/linux/kernel_sigaction.h>
diff --git a/sysdeps/unix/sysv/linux/sh/kernel_sigaction.h b/sysdeps/unix/sysv/linux/sh/kernel_sigaction.h
index 7ebcd08d62..c8dc77a02b 100644
--- a/sysdeps/unix/sysv/linux/sh/kernel_sigaction.h
+++ b/sysdeps/unix/sysv/linux/sh/kernel_sigaction.h
@@ -1,8 +1,9 @@
 /* SH uses the generic Linux UAPI but defines SA_RESTORER.  */
 #define SA_RESTORER 0x04000000
-#include <sysdeps/unix/sysv/linux/kernel_sigaction.h>
 
 #define SET_SA_RESTORER(kact, act)             \
   (kact)->sa_restorer = (act)->sa_restorer
 #define RESET_SA_RESTORER(act, kact)           \
   (act)->sa_restorer = (kact)->sa_restorer
+
+#include <sysdeps/unix/sysv/linux/kernel_sigaction.h>
diff --git a/sysdeps/unix/sysv/linux/sparc/kernel_sigaction.h b/sysdeps/unix/sysv/linux/sparc/kernel_sigaction.h
index bee7e9cd03..eb4a522453 100644
--- a/sysdeps/unix/sysv/linux/sparc/kernel_sigaction.h
+++ b/sysdeps/unix/sysv/linux/sparc/kernel_sigaction.h
@@ -1,10 +1,5 @@
 /* SPARC 'struct __new_sigaction' is similar to generic Linux UAPI with
    a sa_restorer field, even though function is passed as an argument
    to rt_sigaction syscall.  */
-#define SA_RESTORER 0x04000000
+#define HAS_SA_RESTORER 1
 #include <sysdeps/unix/sysv/linux/kernel_sigaction.h>
-
-#define SET_SA_RESTORER(kact, act)             \
-  (kact)->sa_restorer = NULL
-#define RESET_SA_RESTORER(act, kact)           \
-  (act)->sa_restorer = (kact)->sa_restorer
diff --git a/sysdeps/unix/sysv/linux/x86_64/sigaction.c b/sysdeps/unix/sysv/linux/x86_64/sigaction.c
index 4e6d9cc32e..9aa2c7f860 100644
--- a/sysdeps/unix/sysv/linux/x86_64/sigaction.c
+++ b/sysdeps/unix/sysv/linux/x86_64/sigaction.c
@@ -18,7 +18,6 @@
 
 #include <signal.h>
 #define SA_RESTORER 0x04000000
-#include <kernel_sigaction.h>
 
 extern void restore_rt (void) asm ("__restore_rt") attribute_hidden;
 
@@ -29,6 +28,8 @@ extern void restore_rt (void) asm ("__restore_rt") attribute_hidden;
 #define RESET_SA_RESTORER(act, kact) 			\
   (act)->sa_restorer = (kact)->sa_restorer
 
+#include <kernel_sigaction.h>
+
 #include <sysdeps/unix/sysv/linux/sigaction.c>
 
 /* NOTE: Please think twice before making any changes to the bits of

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

* Re: [PATCH 1/5] m68k: Fix sigaction kernel definition (BZ #23960)
  2018-12-12 19:01       ` Adhemerval Zanella
@ 2018-12-14 18:43         ` Andreas Schwab
  2018-12-16 22:57         ` Aurelien Jarno
  1 sibling, 0 replies; 16+ messages in thread
From: Andreas Schwab @ 2018-12-14 18:43 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: libc-alpha

On Dez 12 2018, Adhemerval Zanella <adhemerval.zanella@linaro.org> wrote:

> 	[BZ #23960]
> 	* sysdeps/unix/sysv/linux/kernel_sigaction.h (HAS_SA_RESTORER):
> 	Define if SA_RESTORER is defined.
> 	(kernel_sigaction): Define sa_restorer if HAS_SA_RESTORER is defined.
> 	(SET_SA_RESTORER, RESET_SA_RESTORER): Define iff the macro are not
> 	already defined.
> 	* sysdeps/unix/sysv/linux/m68k/kernel_sigaction.h (SA_RESTORER,
> 	kernel_sigaction, SET_SA_RESTORER, RESET_SA_RESTORER): Remove
> 	definitions.
> 	(HAS_SA_RESTORER): Define.
> 	* sysdeps/unix/sysv/linux/sparc/kernel_sigaction.h (SA_RESTORER,
> 	SET_SA_RESTORER, RESET_SA_RESTORER): Remove definition.
> 	(HAS_SA_RESTORER): Define.
> 	* sysdeps/unix/sysv/linux/nios2/kernel_sigaction.h: Include generic
> 	kernel_sigaction after define SET_SA_RESTORER and RESET_SA_RESTORER.
> 	* sysdeps/unix/sysv/linux/powerpc/kernel_sigaction.h: Likewise.
> 	* sysdeps/unix/sysv/linux/s390/kernel_sigaction.h: Likewise.
> 	* sysdeps/unix/sysv/linux/x86_64/sigaction.c: Likewise.

Ok.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

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

* Re: [PATCH 1/5] m68k: Fix sigaction kernel definition (BZ #23960)
  2018-12-12 19:01       ` Adhemerval Zanella
  2018-12-14 18:43         ` Andreas Schwab
@ 2018-12-16 22:57         ` Aurelien Jarno
  2018-12-17 12:06           ` Adhemerval Zanella
  1 sibling, 1 reply; 16+ messages in thread
From: Aurelien Jarno @ 2018-12-16 22:57 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: libc-alpha

Hi,

On 2018-12-12 16:52, Adhemerval Zanella wrote:
> 
> 
> On 12/12/2018 08:41, Andreas Schwab wrote:
> > On Dez 12 2018, Adhemerval Zanella <adhemerval.zanella@linaro.org> wrote:
> > 
> >> The m68k kernel does define SA_RESTORER on arch/m68k/include/asm/signal.h
> >> (__ARCH_HAS_SA_RESTORER),
> > 
> > These are not the same.  The latter only tells <linux/signal_types.h> to
> > add the sa_restorer member, independent of SA_RESTORER (which m68k
> > doesn't define).
> > 
> >> but the only difference it makes for m68k is at flush_signal_handlers
> >> where kernel sets the sa_restorer to NULL. So it indeed should be safe
> >> to just use default kernel_sigaction.h (I don't see any signal test
> >> issues). Updated patch below.
> > 
> > This fails to add the sa_restorer member, causing the signal mask to be
> > mishandled.
> > 
> > Andreas.
> > 
> 
> Updated patch below.
> 
> --
> 
> 	[BZ #23960]
> 	* sysdeps/unix/sysv/linux/kernel_sigaction.h (HAS_SA_RESTORER):
> 	Define if SA_RESTORER is defined.
> 	(kernel_sigaction): Define sa_restorer if HAS_SA_RESTORER is defined.
> 	(SET_SA_RESTORER, RESET_SA_RESTORER): Define iff the macro are not
> 	already defined.
> 	* sysdeps/unix/sysv/linux/m68k/kernel_sigaction.h (SA_RESTORER,
> 	kernel_sigaction, SET_SA_RESTORER, RESET_SA_RESTORER): Remove
> 	definitions.
> 	(HAS_SA_RESTORER): Define.
> 	* sysdeps/unix/sysv/linux/sparc/kernel_sigaction.h (SA_RESTORER,
> 	SET_SA_RESTORER, RESET_SA_RESTORER): Remove definition.
> 	(HAS_SA_RESTORER): Define.
> 	* sysdeps/unix/sysv/linux/nios2/kernel_sigaction.h: Include generic
> 	kernel_sigaction after define SET_SA_RESTORER and RESET_SA_RESTORER.
> 	* sysdeps/unix/sysv/linux/powerpc/kernel_sigaction.h: Likewise.
> 	* sysdeps/unix/sysv/linux/s390/kernel_sigaction.h: Likewise.
> 	* sysdeps/unix/sysv/linux/x86_64/sigaction.c: Likewise.

[ snip ]

> diff --git a/sysdeps/unix/sysv/linux/s390/kernel_sigaction.h b/sysdeps/unix/sysv/linux/s390/kernel_sigaction.h
> index 7a6a2c4f29..14f44c200b 100644
> --- a/sysdeps/unix/sysv/linux/s390/kernel_sigaction.h
> +++ b/sysdeps/unix/sysv/linux/s390/kernel_sigaction.h
> @@ -30,3 +30,5 @@ struct kernel_sigaction
>    (kact)->sa_restorer = (act)->sa_restorer
>  #define RESET_SA_RESTORER(act, kact)           \
>    (act)->sa_restorer = (kact)->sa_restorer
> +
> +#include <sysdeps/unix/sysv/linux/kernel_sigaction.h>

This is not correct, you should also remove struct kernel_sigaction from
this file, like it was done in the initial version of the patchset
(patch 5).

Aurelien

-- 
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
aurelien@aurel32.net                 http://www.aurel32.net

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

* Re: [PATCH 1/5] m68k: Fix sigaction kernel definition (BZ #23960)
  2018-12-16 22:57         ` Aurelien Jarno
@ 2018-12-17 12:06           ` Adhemerval Zanella
  0 siblings, 0 replies; 16+ messages in thread
From: Adhemerval Zanella @ 2018-12-17 12:06 UTC (permalink / raw)
  To: libc-alpha



On 16/12/2018 18:06, Aurelien Jarno wrote:
> Hi,
> 
> On 2018-12-12 16:52, Adhemerval Zanella wrote:
>>
>>
>> On 12/12/2018 08:41, Andreas Schwab wrote:
>>> On Dez 12 2018, Adhemerval Zanella <adhemerval.zanella@linaro.org> wrote:
>>>
>>>> The m68k kernel does define SA_RESTORER on arch/m68k/include/asm/signal.h
>>>> (__ARCH_HAS_SA_RESTORER),
>>>
>>> These are not the same.  The latter only tells <linux/signal_types.h> to
>>> add the sa_restorer member, independent of SA_RESTORER (which m68k
>>> doesn't define).
>>>
>>>> but the only difference it makes for m68k is at flush_signal_handlers
>>>> where kernel sets the sa_restorer to NULL. So it indeed should be safe
>>>> to just use default kernel_sigaction.h (I don't see any signal test
>>>> issues). Updated patch below.
>>>
>>> This fails to add the sa_restorer member, causing the signal mask to be
>>> mishandled.
>>>
>>> Andreas.
>>>
>>
>> Updated patch below.
>>
>> --
>>
>> 	[BZ #23960]
>> 	* sysdeps/unix/sysv/linux/kernel_sigaction.h (HAS_SA_RESTORER):
>> 	Define if SA_RESTORER is defined.
>> 	(kernel_sigaction): Define sa_restorer if HAS_SA_RESTORER is defined.
>> 	(SET_SA_RESTORER, RESET_SA_RESTORER): Define iff the macro are not
>> 	already defined.
>> 	* sysdeps/unix/sysv/linux/m68k/kernel_sigaction.h (SA_RESTORER,
>> 	kernel_sigaction, SET_SA_RESTORER, RESET_SA_RESTORER): Remove
>> 	definitions.
>> 	(HAS_SA_RESTORER): Define.
>> 	* sysdeps/unix/sysv/linux/sparc/kernel_sigaction.h (SA_RESTORER,
>> 	SET_SA_RESTORER, RESET_SA_RESTORER): Remove definition.
>> 	(HAS_SA_RESTORER): Define.
>> 	* sysdeps/unix/sysv/linux/nios2/kernel_sigaction.h: Include generic
>> 	kernel_sigaction after define SET_SA_RESTORER and RESET_SA_RESTORER.
>> 	* sysdeps/unix/sysv/linux/powerpc/kernel_sigaction.h: Likewise.
>> 	* sysdeps/unix/sysv/linux/s390/kernel_sigaction.h: Likewise.
>> 	* sysdeps/unix/sysv/linux/x86_64/sigaction.c: Likewise.
> 
> [ snip ]
> 
>> diff --git a/sysdeps/unix/sysv/linux/s390/kernel_sigaction.h b/sysdeps/unix/sysv/linux/s390/kernel_sigaction.h
>> index 7a6a2c4f29..14f44c200b 100644
>> --- a/sysdeps/unix/sysv/linux/s390/kernel_sigaction.h
>> +++ b/sysdeps/unix/sysv/linux/s390/kernel_sigaction.h
>> @@ -30,3 +30,5 @@ struct kernel_sigaction
>>    (kact)->sa_restorer = (act)->sa_restorer
>>  #define RESET_SA_RESTORER(act, kact)           \
>>    (act)->sa_restorer = (kact)->sa_restorer
>> +
>> +#include <sysdeps/unix/sysv/linux/kernel_sigaction.h>
> 
> This is not correct, you should also remove struct kernel_sigaction from
> this file, like it was done in the initial version of the patchset
> (patch 5).
> 
> Aurelien
> 

Thanks for catching it, this is an mistake with my local rebase. I remove
this change for s390 kernel_sigaction.h for this patch.

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

* Re: [PATCH 3/5] hppa: Remove kernel_sigaction.h
  2018-12-11 19:56 ` [PATCH 3/5] hppa: Remove kernel_sigaction.h Adhemerval Zanella
@ 2018-12-18 18:28   ` Adhemerval Zanella
  0 siblings, 0 replies; 16+ messages in thread
From: Adhemerval Zanella @ 2018-12-18 18:28 UTC (permalink / raw)
  To: libc-alpha

I will commit this shortly if no one opposes it.

On 11/12/2018 17:55, Adhemerval Zanella wrote:
> HPPA kernel_sigaction.h definition is the sama as the Linux generic
> one and old_kernel_sigaction is not used.
> 
> Checked on hppa-linux-gnu.
> 
> 	* sysdeps/unix/sysv/linux/hppa/kernel_sigaction.h: Remove file.
> ---
>  ChangeLog                                      |  2 ++
>  .../unix/sysv/linux/hppa/kernel_sigaction.h    | 18 ------------------
>  2 files changed, 2 insertions(+), 18 deletions(-)
>  delete mode 100644 sysdeps/unix/sysv/linux/hppa/kernel_sigaction.h
> 
> diff --git a/sysdeps/unix/sysv/linux/hppa/kernel_sigaction.h b/sysdeps/unix/sysv/linux/hppa/kernel_sigaction.h
> deleted file mode 100644
> index af048cbe7d..0000000000
> --- a/sysdeps/unix/sysv/linux/hppa/kernel_sigaction.h
> +++ /dev/null
> @@ -1,18 +0,0 @@
> -/* We have a separate header file here because we do not support
> -   SA_RESTORER on hppa. */
> -
> -/* This is the sigaction struction from the Linux 2.1.20 kernel.  */
> -/* Blah.  This is bogus.  We don't ever use it. */
> -struct old_kernel_sigaction {
> -	__sighandler_t k_sa_handler;
> -	unsigned long sa_mask;
> -	unsigned long sa_flags;
> -};
> -
> -/* This is the sigaction structure from the Linux 2.1.68 kernel.  */
> -
> -struct kernel_sigaction {
> -	__sighandler_t k_sa_handler;
> -	unsigned long sa_flags;
> -	sigset_t sa_mask;
> -};
> 

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

* Re: [PATCH 2/5] alpha: Use Linux generic sigaction implementation
  2018-12-11 20:09 ` [PATCH 2/5] alpha: Use Linux generic sigaction implementation Adhemerval Zanella
@ 2018-12-18 18:28   ` Adhemerval Zanella
  0 siblings, 0 replies; 16+ messages in thread
From: Adhemerval Zanella @ 2018-12-18 18:28 UTC (permalink / raw)
  To: libc-alpha

I will commit this shortly if no one opposes it.

On 11/12/2018 17:55, Adhemerval Zanella wrote:
> Alpha rt_sigaction syscall uses a slight different kernel ABI than
> generic one:
> 
> arch/alpha/kernel/signal.c
> 
>  90 SYSCALL_DEFINE5(rt_sigaction, int, sig, const struct sigaction __user *, act,
>  91                 struct sigaction __user *, oact,
>  92                 size_t, sigsetsize, void __user *, restorer)
> 
> Similar as sparc, the syscall expects a restorer function.  However
> different than sparc, alpha defines the restorer as the 5th argument
> (sparc defines as the 4th).
> 
> This patch removes the arch-specific alpha sigaction implementation,
> adapt the Linux generic one to different restore placements (through
> STUB macro), and make alpha use the Linux generic kernel_sigaction
> definition.
> 
> Checked on alpha-linux-gnu and x86_64-linux-gnu (for sanity).
> 
> 	* sysdeps/unix/sysv/linux/alpha/Makefile: Update comment about
> 	__syscall_rt_sigaction.
> 	* sysdeps/unix/sysv/linux/alpha/kernel_sigaction.h
> 	(kernel_sigaction): Use Linux generic defintion.
> 	(STUB): Define.
> 	(__syscall_rt_sigreturn, __syscall_sigreturn): Add prototype.
> 	* sysdeps/unix/sysv/linux/alpha/rt_sigaction.S
> 	(__syscall_rt_sigaction): Remove implementation.
> 	(__syscall_sigreturn, __syscall_rt_sigreturn): Define as global and
> 	hidden.
> 	* sysdeps/unix/sysv/linux/alpha/sigaction.c: Remove file.
> 	* sysdeps/unix/sysv/linux/alpha/sysdep.h (INLINE_SYSCALL,
> 	INTERNAL_SYSCALL): Remove definitions.
> 	* sysdeps/unix/sysv/linux/sigaction.c: Define STUB to accept both the
> 	action and signal set size.
> 	* sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c (STUB): Redefine.
> 	* sysdeps/unix/sysv/linux/sparc/sparc64/sigaction.c (STUB): Likewise.
> ---
>  ChangeLog                                     | 20 +++++++++
>  sysdeps/unix/sysv/linux/alpha/Makefile        |  2 +-
>  .../unix/sysv/linux/alpha/kernel_sigaction.h  | 19 ++++-----
>  sysdeps/unix/sysv/linux/alpha/rt_sigaction.S  | 41 ++-----------------
>  sysdeps/unix/sysv/linux/alpha/sigaction.c     | 38 -----------------
>  sysdeps/unix/sysv/linux/alpha/sysdep.h        | 23 -----------
>  sysdeps/unix/sysv/linux/sigaction.c           |  4 +-
>  .../unix/sysv/linux/sparc/sparc32/sigaction.c |  5 ++-
>  .../unix/sysv/linux/sparc/sparc64/sigaction.c |  5 ++-
>  9 files changed, 42 insertions(+), 115 deletions(-)
>  delete mode 100644 sysdeps/unix/sysv/linux/alpha/sigaction.c
> 
> diff --git a/sysdeps/unix/sysv/linux/alpha/Makefile b/sysdeps/unix/sysv/linux/alpha/Makefile
> index 50f4fb1183..fdd089af71 100644
> --- a/sysdeps/unix/sysv/linux/alpha/Makefile
> +++ b/sysdeps/unix/sysv/linux/alpha/Makefile
> @@ -31,7 +31,7 @@ libm-routines += multc3 divtc3
>  endif   # math
>  
>  ifeq ($(subdir),nptl)
> -# pull in __syscall_error routine, __sigprocmask, __syscall_rt_sigaction
> +# pull in __syscall_error routine, __sigprocmask, sigaction stubs.
>  libpthread-routines += sysdep sigprocmask rt_sigaction
>  libpthread-shared-only-routines += sysdep sigprocmask rt_sigaction
>  endif
> diff --git a/sysdeps/unix/sysv/linux/alpha/kernel_sigaction.h b/sysdeps/unix/sysv/linux/alpha/kernel_sigaction.h
> index 25180ff9c9..679179b563 100644
> --- a/sysdeps/unix/sysv/linux/alpha/kernel_sigaction.h
> +++ b/sysdeps/unix/sysv/linux/alpha/kernel_sigaction.h
> @@ -1,12 +1,11 @@
> -#ifndef _KERNEL_SIGACTION_H
> -# define _KERNEL_SIGACTION_H
> +#include <sysdeps/unix/sysv/linux/kernel_sigaction.h>
>  
> -/* This is the sigaction structure from the Linux 3.2 kernel.  */
> -struct kernel_sigaction
> -{
> -  __sighandler_t k_sa_handler;
> -  unsigned int sa_flags;
> -  sigset_t sa_mask;
> -};
> +void __syscall_rt_sigreturn (void) attribute_hidden;
> +void __syscall_sigreturn (void) attribute_hidden;
>  
> -#endif
> +#define STUB(act, sigsetsize) \
> +  (sigsetsize),						\
> +  (act) ? ((unsigned long)((act->sa_flags & SA_SIGINFO)	\
> +			    ? &__syscall_rt_sigreturn	\
> +			    : &__syscall_sigreturn))	\
> +	: 0
> diff --git a/sysdeps/unix/sysv/linux/alpha/rt_sigaction.S b/sysdeps/unix/sysv/linux/alpha/rt_sigaction.S
> index ca25eee611..17e55239fe 100644
> --- a/sysdeps/unix/sysv/linux/alpha/rt_sigaction.S
> +++ b/sysdeps/unix/sysv/linux/alpha/rt_sigaction.S
> @@ -18,43 +18,6 @@
>  
>  #include <sysdep.h>
>  
> -/* On Alpha we desparately want to avoid having to issue an imb.  Ordinarily
> -   the kernel would have to issue one after setting up the signal return
> -   stack, but the Linux rt_sigaction syscall is prepared to accept a pointer
> -   to the sigreturn syscall, instead of inlining it on the stack.
> -
> -   This just about halves signal delivery time.  */
> -
> -	.text
> -
> -ENTRY(__syscall_rt_sigaction)
> -	cfi_startproc
> -	ldgp	gp,0(pv)
> -#ifdef PROF
> -	.set noat
> -	lda	AT, _mcount
> -	jsr	AT, (AT), _mcount
> -	.set at
> -#endif
> -	.prologue 1
> -
> -	beq	a1, 0f
> -	ldl	t0, 8(a1)				# sa_flags
> -
> -	ldah	a4, __syscall_sigreturn(gp)		!gprelhigh
> -	ldah	t1, __syscall_rt_sigreturn(gp)		!gprelhigh
> -	lda	a4, __syscall_sigreturn(a4)		!gprellow
> -	lda	t1, __syscall_rt_sigreturn(t1)		!gprellow
> -	and	t0, 0x40, t0				# SA_SIGINFO
> -	cmovne	t0, t1, a4
> -
> -0:	ldi	v0, __NR_rt_sigaction
> -	callsys
> -	bne	a3, SYSCALL_ERROR_LABEL
> -	ret
> -	cfi_endproc
> -PSEUDO_END(__syscall_rt_sigaction)
> -
>  /* To enable unwinding through the signal frame without special hackery
>     elsewhere, describe the entire struct sigcontext with unwind info.
>  
> @@ -104,6 +67,8 @@ __syscall_sigreturn:
>  	callsys
>  	.size	__syscall_sigreturn, .-__syscall_sigreturn
>  	.type	__syscall_sigreturn, @function
> +	.global __syscall_sigreturn;
> +	.hidden __syscall_sigreturn;
>  
>  	/* See above wrt including the nop.  */
>  	cfi_def_cfa_offset (176 + 648)
> @@ -116,5 +81,7 @@ __syscall_rt_sigreturn:
>  	callsys
>  	.size	__syscall_rt_sigreturn, .-__syscall_rt_sigreturn
>  	.type	__syscall_rt_sigreturn, @function
> +	.global __syscall_rt_sigreturn;
> +	.hidden __syscall_rt_sigreturn;
>  
>  	cfi_endproc
> diff --git a/sysdeps/unix/sysv/linux/alpha/sigaction.c b/sysdeps/unix/sysv/linux/alpha/sigaction.c
> deleted file mode 100644
> index 8051043587..0000000000
> --- a/sysdeps/unix/sysv/linux/alpha/sigaction.c
> +++ /dev/null
> @@ -1,38 +0,0 @@
> -/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
> -   This file is part of the GNU C Library.
> -
> -   The GNU C Library is free software; you can redistribute it and/or
> -   modify it under the terms of the GNU Lesser General Public
> -   License as published by the Free Software Foundation; either
> -   version 2.1 of the License, or (at your option) any later version.
> -
> -   The GNU C Library is distributed in the hope that it will be useful,
> -   but WITHOUT ANY WARRANTY; without even the implied warranty of
> -   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> -   Lesser General Public License for more details.
> -
> -   You should have received a copy of the GNU Lesser General Public
> -   License along with the GNU C Library.  If not, see
> -   <http://www.gnu.org/licenses/>.  */
> -
> -#include <sysdep.h>
> -#include <sys/cdefs.h>
> -#include <stddef.h>
> -
> -/*
> - * In order to get the hidden arguments for rt_sigaction set up
> - * properly, we need to call the assembly version.  Detect this in the
> - * INLINE_SYSCALL macro, and fail to expand inline in that case.
> - */
> -
> -#undef INLINE_SYSCALL
> -#define INLINE_SYSCALL(name, nr, args...)       \
> -        (__NR_##name == __NR_rt_sigaction       \
> -         ? __syscall_rt_sigaction(args)         \
> -         : INLINE_SYSCALL1(name, nr, args))
> -
> -struct kernel_sigaction;
> -extern int __syscall_rt_sigaction (int, const struct kernel_sigaction *,
> -				   struct kernel_sigaction *, size_t);
> -
> -#include <sysdeps/unix/sysv/linux/sigaction.c>
> diff --git a/sysdeps/unix/sysv/linux/alpha/sysdep.h b/sysdeps/unix/sysv/linux/alpha/sysdep.h
> index 080405021f..9148b4793b 100644
> --- a/sysdeps/unix/sysv/linux/alpha/sysdep.h
> +++ b/sysdeps/unix/sysv/linux/alpha/sysdep.h
> @@ -72,27 +72,4 @@
>  
>  #define SINGLE_THREAD_BY_GLOBAL 1
>  
> -/*
> - * In order to get the hidden arguments for rt_sigaction set up
> - * properly, we need to call the assembly version.  This shouldn't
> - * happen except for inside sigaction.c, where we handle this
> - * specially.  Catch other uses and error.
> - */
> -
> -#undef INLINE_SYSCALL
> -#define INLINE_SYSCALL(name, nr, args...)				\
> -({									\
> -	extern char ChEcK[__NR_##name == __NR_rt_sigaction ? -1 : 1]	\
> -	  __attribute__((unused));					\
> -	INLINE_SYSCALL1(name, nr, args);				\
> -})
> -
> -#undef INTERNAL_SYSCALL
> -#define INTERNAL_SYSCALL(name, err_out, nr, args...)			\
> -({									\
> -	extern char ChEcK[__NR_##name == __NR_rt_sigaction ? -1 : 1]	\
> -	  __attribute__((unused));					\
> -	INTERNAL_SYSCALL1(name, err_out, nr, args);			\
> -})
> -
>  #endif /* _LINUX_ALPHA_SYSDEP_H */
> diff --git a/sysdeps/unix/sysv/linux/sigaction.c b/sysdeps/unix/sysv/linux/sigaction.c
> index 0e6851a148..233ab1fcb5 100644
> --- a/sysdeps/unix/sysv/linux/sigaction.c
> +++ b/sysdeps/unix/sysv/linux/sigaction.c
> @@ -33,7 +33,7 @@
>  
>  /* SPARC passes the restore function as an argument to rt_sigaction.  */
>  #ifndef STUB
> -# define STUB(act)
> +# define STUB(act, sigsetsize) (sigsetsize)
>  #endif
>  
>  /* If ACT is not NULL, change the action for SIG to *ACT.
> @@ -57,7 +57,7 @@ __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
>       real size of the user-level sigset_t.  */
>    result = INLINE_SYSCALL_CALL (rt_sigaction, sig,
>  				act ? &kact : NULL,
> -				oact ? &koact : NULL, STUB(act) _NSIG / 8);
> +				oact ? &koact : NULL, STUB (act, _NSIG / 8));
>  
>    if (oact && result >= 0)
>      {
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c b/sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c
> index 191f58729e..9f1a31a3b3 100644
> --- a/sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c
> +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c
> @@ -27,11 +27,12 @@
>  static void __rt_sigreturn_stub (void);
>  static void __sigreturn_stub (void);
>  
> -#define STUB(act) \
> +#define STUB(act, sigsetsize) \
>    (act) ? ((unsigned long)((act->sa_flags & SA_SIGINFO)	\
>  			    ? &__rt_sigreturn_stub	\
>  			    : &__sigreturn_stub) - 8)	\
> -	: 0,
> +	: 0,						\
> +  (sigsetsize)
>  
>  #include <sysdeps/unix/sysv/linux/sigaction.c>
>  
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/sigaction.c b/sysdeps/unix/sysv/linux/sparc/sparc64/sigaction.c
> index cfbbc6e7b4..acc76b1bf9 100644
> --- a/sysdeps/unix/sysv/linux/sparc/sparc64/sigaction.c
> +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/sigaction.c
> @@ -24,8 +24,9 @@
>  
>  static void __rt_sigreturn_stub (void);
>  
> -#define STUB(act) \
> -  (((unsigned long) &__rt_sigreturn_stub) - 8),
> +#define STUB(act, sigsetsize) \
> +  (((unsigned long) &__rt_sigreturn_stub) - 8),	\
> +  (sigsetsize)
>  
>  #include <sysdeps/unix/sysv/linux/sigaction.c>
>  
> 

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

* Re: [PATCH 4/5] ia64: Remove kernel_sigaction.h
  2018-12-11 19:56 ` [PATCH 4/5] ia64: Remove kernel_sigaction.h Adhemerval Zanella
@ 2018-12-18 18:29   ` Adhemerval Zanella
  0 siblings, 0 replies; 16+ messages in thread
From: Adhemerval Zanella @ 2018-12-18 18:29 UTC (permalink / raw)
  To: libc-alpha

I will commit this shortly if no one opposes it.

PS: the check was done on ia64-linux-gnu (not on hppa as indicated by the
message). I will correct this on commit message.

On 11/12/2018 17:55, Adhemerval Zanella wrote:
> IA64 kernel_sigaction.h definition is the sama as the Linux generic
> one.
> 
> Checked on hppa-linux-gnu.
> 
> 	* sysdeps/unix/sysv/linux/ia64/kernel_sigaction.h: Remove file.
> ---
>  ChangeLog                                       | 2 ++
>  sysdeps/unix/sysv/linux/ia64/kernel_sigaction.h | 7 -------
>  2 files changed, 2 insertions(+), 7 deletions(-)
>  delete mode 100644 sysdeps/unix/sysv/linux/ia64/kernel_sigaction.h
> 
> diff --git a/sysdeps/unix/sysv/linux/ia64/kernel_sigaction.h b/sysdeps/unix/sysv/linux/ia64/kernel_sigaction.h
> deleted file mode 100644
> index fc9f29603c..0000000000
> --- a/sysdeps/unix/sysv/linux/ia64/kernel_sigaction.h
> +++ /dev/null
> @@ -1,7 +0,0 @@
> -/* This is the sigaction structure from the Linux 3.2 kernel.  */
> -struct kernel_sigaction
> -{
> -  __sighandler_t k_sa_handler;
> -  unsigned long sa_flags;
> -  sigset_t sa_mask;               /* mask last for extensibility */
> -};
> 

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

* Re: [PATCH 5/5] s390: Use generic kernel_sigaction.h
  2018-12-11 19:56 ` [PATCH 5/5] s390: Use generic kernel_sigaction.h Adhemerval Zanella
@ 2018-12-18 18:44   ` Adhemerval Zanella
  0 siblings, 0 replies; 16+ messages in thread
From: Adhemerval Zanella @ 2018-12-18 18:44 UTC (permalink / raw)
  To: libc-alpha

I will commit this shortly if no one opposes it.

On 11/12/2018 17:55, Adhemerval Zanella wrote:
> S390 kernel sigaction is the same as the Linux generic one.
> 
> Checked with a s390-linux-gnu and s390x-linux-gnu build.
> 
> 	* sysdeps/unix/sysv/linux/s390/kernel_sigaction.h: Use Linux generic
> 	kernel_sigction definition.
> ---
>  ChangeLog                                     |  3 ++
>  .../unix/sysv/linux/s390/kernel_sigaction.h   | 28 ++-----------------
>  2 files changed, 5 insertions(+), 26 deletions(-)
> 
> diff --git a/sysdeps/unix/sysv/linux/s390/kernel_sigaction.h b/sysdeps/unix/sysv/linux/s390/kernel_sigaction.h
> index 7a6a2c4f29..18000a62cc 100644
> --- a/sysdeps/unix/sysv/linux/s390/kernel_sigaction.h
> +++ b/sysdeps/unix/sysv/linux/s390/kernel_sigaction.h
> @@ -1,30 +1,6 @@
> -#include <bits/types/siginfo_t.h>
> -
> +/* S390 uses the generic Linux UAPI but defines SA_RESTORER.  */
>  #define SA_RESTORER	0x04000000
> -
> -/* This is the sigaction structure from the Linux 3.2 kernel.  */
> -struct kernel_sigaction
> -{
> -  union
> -  {
> -    __sighandler_t _sa_handler;
> -    void (*_sa_sigaction)(int, siginfo_t *, void *);
> -  } _u;
> -#define k_sa_handler _u._sa_handler
> -  /* The 'struct sigaction' definition in s390 kernel header
> -     arch/s390/include/uapi/asm/signal.h is used for __NR_rt_sigaction
> -     on 64 bits and for __NR_sigaction for 31 bits.
> -
> -     The expected layout for __NR_rt_sigaction for 31 bits is either
> -     'struct sigaction' from include/linux/signal_types.h or
> -     'struct compat_sigaction' from include/linux/compat.h.
> -
> -     So for __NR_rt_sigaction we can use the same layout for both s390x
> -     and s390.  */
> -  unsigned long sa_flags;
> -  void (*sa_restorer)(void);
> -  sigset_t sa_mask;
> -};
> +#include <sysdeps/unix/sysv/linux/kernel_sigaction.h>
>  
>  #define SET_SA_RESTORER(kact, act)             \
>    (kact)->sa_restorer = (act)->sa_restorer
> 

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

end of thread, other threads:[~2018-12-18 18:29 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-11 19:56 [PATCH 1/5] m68k: Fix sigaction kernel definition (BZ #23960) Adhemerval Zanella
2018-12-11 19:56 ` [PATCH 4/5] ia64: Remove kernel_sigaction.h Adhemerval Zanella
2018-12-18 18:29   ` Adhemerval Zanella
2018-12-11 19:56 ` [PATCH 5/5] s390: Use generic kernel_sigaction.h Adhemerval Zanella
2018-12-18 18:44   ` Adhemerval Zanella
2018-12-11 19:56 ` [PATCH 3/5] hppa: Remove kernel_sigaction.h Adhemerval Zanella
2018-12-18 18:28   ` Adhemerval Zanella
2018-12-11 20:09 ` [PATCH 2/5] alpha: Use Linux generic sigaction implementation Adhemerval Zanella
2018-12-18 18:28   ` Adhemerval Zanella
2018-12-11 22:47 ` [PATCH 1/5] m68k: Fix sigaction kernel definition (BZ #23960) Andreas Schwab
2018-12-12 10:41   ` Adhemerval Zanella
2018-12-12 10:44     ` Andreas Schwab
2018-12-12 19:01       ` Adhemerval Zanella
2018-12-14 18:43         ` Andreas Schwab
2018-12-16 22:57         ` Aurelien Jarno
2018-12-17 12:06           ` Adhemerval Zanella

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).