public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Arseny Maslennikov <ar@cs.msu.ru>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jslaby@suse.com>, Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	linux-kernel@vger.kernel.org,
	"Vladimir D . Seleznev" <vseleznv@altlinux.org>,
	<linux-api@vger.kernel.org>
Subject: Re: [PATCH 1/7] signal.h: Define SIGINFO on all architectures
Date: Tue, 11 Jun 2019 15:36:00 -0500	[thread overview]
Message-ID: <87o933507j.fsf@xmission.com> (raw)
In-Reply-To: <20190605081906.28938-2-ar@cs.msu.ru> (Arseny Maslennikov's message of "Wed, 5 Jun 2019 11:19:00 +0300")

Arseny Maslennikov <ar@cs.msu.ru> writes:

> This complementary patch defines SIGINFO as a synonym for SIGPWR
> on every architecture supported by the kernel.
> The particular signal number chosen does not really matter and is only
> required for the related tty functionality to work properly,
> so if it does not suite expectations, any suggestions are warmly
> welcome.
>
> SIGPWR looks like a nice candidate for this role, because it is
> defined on every supported arch; it is currently only used to inform
> PID 1 of power failures, and daemons that care about low-level
> events do not tend to have a controlling terminal.
>
> However, on sparcs SIGPWR is a synonym for SIGLOST, a signal unique
> to that architecture, with a narrow set of intended uses that do not
> combine well with interactively requesting status.
> SIGLOST is not used by any kernel code at the moment.
> I'm not sure there is a more reasonable alternative right now.

Is the name SIGINFO already well established.

It just is a little bit confusing with struct siginfo.

At least on x86 it looks like we have signals 32 and 33 that are
reserved and not used for anything.  Is there a reason you have
not picked one of those?

Also should this be a realtime signal with signal information
or a non-realtime signal?

I don't expect there is much to encode except that the user is asking
for information.  I half wonder if it could be done as a different
si_code to SIGWINCH.  But of course that doesn't work because it is
not a real time signal so does not queue more than one siginfo. (Sigh).

I just would like to see that we have a clear concept of how this new
signal plays into all of the signal handling bits.

Added linux-api because this is fundamentally extending the linux-api,
and we probably want man-page updates etc.

Eric

>
> Signed-off-by: Arseny Maslennikov <ar@cs.msu.ru>
> ---
>  arch/arm/include/uapi/asm/signal.h     | 1 +
>  arch/h8300/include/uapi/asm/signal.h   | 1 +
>  arch/ia64/include/uapi/asm/signal.h    | 1 +
>  arch/m68k/include/uapi/asm/signal.h    | 1 +
>  arch/mips/include/uapi/asm/signal.h    | 1 +
>  arch/parisc/include/uapi/asm/signal.h  | 1 +
>  arch/powerpc/include/uapi/asm/signal.h | 1 +
>  arch/s390/include/uapi/asm/signal.h    | 1 +
>  arch/sparc/include/uapi/asm/signal.h   | 2 ++
>  arch/x86/include/uapi/asm/signal.h     | 1 +
>  arch/xtensa/include/uapi/asm/signal.h  | 1 +
>  include/uapi/asm-generic/signal.h      | 1 +
>  12 files changed, 13 insertions(+)
>
> diff --git a/arch/arm/include/uapi/asm/signal.h b/arch/arm/include/uapi/asm/signal.h
> index 9b4185ba4f8a..b80b53a17267 100644
> --- a/arch/arm/include/uapi/asm/signal.h
> +++ b/arch/arm/include/uapi/asm/signal.h
> @@ -50,6 +50,7 @@ typedef unsigned long sigset_t;
>  #define SIGLOST		29
>  */
>  #define SIGPWR		30
> +#define SIGINFO		SIGPWR
>  #define SIGSYS		31
>  #define	SIGUNUSED	31
>  
> diff --git a/arch/h8300/include/uapi/asm/signal.h b/arch/h8300/include/uapi/asm/signal.h
> index e15521037348..7a2b783af22b 100644
> --- a/arch/h8300/include/uapi/asm/signal.h
> +++ b/arch/h8300/include/uapi/asm/signal.h
> @@ -50,6 +50,7 @@ typedef unsigned long sigset_t;
>  #define SIGLOST		29
>  */
>  #define SIGPWR		30
> +#define SIGINFO		SIGPWR
>  #define SIGSYS		31
>  #define	SIGUNUSED	31
>  
> diff --git a/arch/ia64/include/uapi/asm/signal.h b/arch/ia64/include/uapi/asm/signal.h
> index aa98ff1b9e22..b4c98cb17165 100644
> --- a/arch/ia64/include/uapi/asm/signal.h
> +++ b/arch/ia64/include/uapi/asm/signal.h
> @@ -45,6 +45,7 @@
>  #define SIGLOST		29
>  */
>  #define SIGPWR		30
> +#define SIGINFO		SIGPWR
>  #define SIGSYS		31
>  /* signal 31 is no longer "unused", but the SIGUNUSED macro remains for backwards compatibility */
>  #define	SIGUNUSED	31
> diff --git a/arch/m68k/include/uapi/asm/signal.h b/arch/m68k/include/uapi/asm/signal.h
> index 915cc755a184..a0b4e4108cb8 100644
> --- a/arch/m68k/include/uapi/asm/signal.h
> +++ b/arch/m68k/include/uapi/asm/signal.h
> @@ -50,6 +50,7 @@ typedef unsigned long sigset_t;
>  #define SIGLOST		29
>  */
>  #define SIGPWR		30
> +#define SIGINFO		SIGPWR
>  #define SIGSYS		31
>  #define	SIGUNUSED	31
>  
> diff --git a/arch/mips/include/uapi/asm/signal.h b/arch/mips/include/uapi/asm/signal.h
> index 53104b10aae2..975a6f0d3b0b 100644
> --- a/arch/mips/include/uapi/asm/signal.h
> +++ b/arch/mips/include/uapi/asm/signal.h
> @@ -43,6 +43,7 @@ typedef unsigned long old_sigset_t;		/* at least 32 bits */
>  #define SIGCHLD		18	/* Child status has changed (POSIX).  */
>  #define SIGCLD		SIGCHLD /* Same as SIGCHLD (System V).	*/
>  #define SIGPWR		19	/* Power failure restart (System V).  */
> +#define SIGINFO		SIGPWR	/* Keyboard status request (4.2 BSD). */
>  #define SIGWINCH	20	/* Window size change (4.3 BSD, Sun).  */
>  #define SIGURG		21	/* Urgent condition on socket (4.2 BSD).  */
>  #define SIGIO		22	/* I/O now possible (4.2 BSD).	*/
> diff --git a/arch/parisc/include/uapi/asm/signal.h b/arch/parisc/include/uapi/asm/signal.h
> index d38563a394f2..fe2e00d590ac 100644
> --- a/arch/parisc/include/uapi/asm/signal.h
> +++ b/arch/parisc/include/uapi/asm/signal.h
> @@ -22,6 +22,7 @@
>  #define SIGUSR2		17
>  #define SIGCHLD		18
>  #define SIGPWR		19
> +#define SIGINFO		SIGPWR
>  #define SIGVTALRM	20
>  #define SIGPROF		21
>  #define SIGIO		22
> diff --git a/arch/powerpc/include/uapi/asm/signal.h b/arch/powerpc/include/uapi/asm/signal.h
> index 85b0a7aa43e7..e7f3885905b4 100644
> --- a/arch/powerpc/include/uapi/asm/signal.h
> +++ b/arch/powerpc/include/uapi/asm/signal.h
> @@ -53,6 +53,7 @@ typedef struct {
>  #define SIGLOST		29
>  */
>  #define SIGPWR		30
> +#define SIGINFO		SIGPWR
>  #define SIGSYS		31
>  #define	SIGUNUSED	31
>  
> diff --git a/arch/s390/include/uapi/asm/signal.h b/arch/s390/include/uapi/asm/signal.h
> index 9a14a611ed82..12ee62987971 100644
> --- a/arch/s390/include/uapi/asm/signal.h
> +++ b/arch/s390/include/uapi/asm/signal.h
> @@ -58,6 +58,7 @@ typedef unsigned long sigset_t;
>  #define SIGLOST         29
>  */
>  #define SIGPWR          30
> +#define SIGINFO         SIGPWR
>  #define SIGSYS		31
>  #define SIGUNUSED       31
>  
> diff --git a/arch/sparc/include/uapi/asm/signal.h b/arch/sparc/include/uapi/asm/signal.h
> index ff9505923b9a..b655163198bb 100644
> --- a/arch/sparc/include/uapi/asm/signal.h
> +++ b/arch/sparc/include/uapi/asm/signal.h
> @@ -71,6 +71,8 @@
>  #define SIGWINCH	28
>  #define SIGLOST		29
>  #define SIGPWR		SIGLOST
> +/* XXX: is it OK for SIGINFO to collide with LOST? */
> +#define SIGINFO		SIGPWR
>  #define SIGUSR1		30
>  #define SIGUSR2		31
>  
> diff --git a/arch/x86/include/uapi/asm/signal.h b/arch/x86/include/uapi/asm/signal.h
> index e5745d593dc7..1539bb28826c 100644
> --- a/arch/x86/include/uapi/asm/signal.h
> +++ b/arch/x86/include/uapi/asm/signal.h
> @@ -55,6 +55,7 @@ typedef unsigned long sigset_t;
>  #define SIGLOST		29
>  */
>  #define SIGPWR		30
> +#define SIGINFO		SIGPWR
>  #define SIGSYS		31
>  #define	SIGUNUSED	31
>  
> diff --git a/arch/xtensa/include/uapi/asm/signal.h b/arch/xtensa/include/uapi/asm/signal.h
> index 005dec5bfde4..d644234305de 100644
> --- a/arch/xtensa/include/uapi/asm/signal.h
> +++ b/arch/xtensa/include/uapi/asm/signal.h
> @@ -65,6 +65,7 @@ typedef struct {
>  #define SIGPOLL		SIGIO
>  /* #define SIGLOST		29 */
>  #define SIGPWR		30
> +#define SIGINFO		SIGPWR
>  #define SIGSYS		31
>  #define	SIGUNUSED	31
>  
> diff --git a/include/uapi/asm-generic/signal.h b/include/uapi/asm-generic/signal.h
> index 5c716a952cbe..9f9a1db0d43c 100644
> --- a/include/uapi/asm-generic/signal.h
> +++ b/include/uapi/asm-generic/signal.h
> @@ -43,6 +43,7 @@
>  #define SIGLOST		29
>  */
>  #define SIGPWR		30
> +#define SIGINFO		SIGPWR
>  #define SIGSYS		31
>  #define	SIGUNUSED	31

  parent reply	other threads:[~2019-06-11 20:42 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-05  8:18 [PATCH 0/7] TTY Keyboard Status Request Arseny Maslennikov
2019-06-05  8:19 ` [PATCH 1/7] signal.h: Define SIGINFO on all architectures Arseny Maslennikov
2019-06-10 21:10   ` Rob Landley
2019-06-11 20:36   ` Eric W. Biederman [this message]
2019-06-11 22:38     ` Arseny Maslennikov
2019-06-05  8:19 ` [PATCH 2/7] tty: termios: Reserve space for VSTATUS in .c_cc Arseny Maslennikov
2019-06-05  8:19 ` [PATCH 3/7] n_tty: Send SIGINFO to fg pgrp on status request character Arseny Maslennikov
2019-06-05  8:19 ` [PATCH 4/7] linux/signal.h: Ignore SIGINFO by default in new tasks Arseny Maslennikov
2019-06-05  8:19 ` [PATCH 5/7] tty: Add NOKERNINFO lflag to termios Arseny Maslennikov
2019-06-05  8:19 ` [PATCH 6/7] n_tty: ->ops->write: Cut core logic out to a separate function Arseny Maslennikov
2019-06-05  8:19 ` [PATCH 7/7] n_tty: Provide an informational line on VSTATUS receipt Arseny Maslennikov
2019-06-09 17:41 ` [PATCH 0/7] TTY Keyboard Status Request Pavel Machek
2019-06-09 19:40   ` Arseny Maslennikov
2019-06-09 19:51     ` Pavel Machek
2019-06-09 20:56       ` Arseny Maslennikov
2019-06-10 21:18         ` Rob Landley
2019-06-12  9:41         ` Pavel Machek
2019-06-10 21:06 ` Rob Landley

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=87o933507j.fsf@xmission.com \
    --to=ebiederm@xmission.com \
    --cc=ar@cs.msu.ru \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=vseleznv@altlinux.org \
    /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