linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] make do_signal static on i386
@ 2002-10-10  7:23 Pavel Machek
  0 siblings, 0 replies; 7+ messages in thread
From: Pavel Machek @ 2002-10-10  7:23 UTC (permalink / raw)
  To: sfr; +Cc: Linus, LKML, Jeff Dike

Hi!

> I am not sure whether we need the FASTCALL() or whether the change
> in the comment in asm-um/signal.h makes sense.  (Does UML work on
> x86_64, yet?)
>

I dont think it does... 

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

* Re: [PATCH] make do_signal static on i386
  2002-10-09 19:37   ` Daniel Jacobowitz
@ 2002-10-09 20:22     ` george anzinger
  0 siblings, 0 replies; 7+ messages in thread
From: george anzinger @ 2002-10-09 20:22 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: Stephen Rothwell, Linus, LKML, Jeff Dike

Daniel Jacobowitz wrote:
> 
> On Wed, Oct 09, 2002 at 10:40:39AM -0700, george anzinger wrote:
> > This will cause problems for nano_sleep and
> > clock_nanosleep.  These system calls need to call
> > do_signal() in order to meet the POSIX standard which states
> > that they are interrupted only by signals that are delivered
> > to user code.  Other signals are not to interrupt the
> > sleep.  This is why do_signal() returns this information to
> > the caller.
> >
> > I suppose one could argue that such functions should be in
> > signal.c, but save for this signal issue the code is
> > common.  Seems a waste to support the same code in N
> > platforms.
> 
> IMO, calling the architecture's do_signal function to handle that is
> entirely the wrong way to go.  They don't even all have the same
> arguments, and the wrappers hi-res-timers put around sys_nanosleep are
> hideous.

Ah, but they should, unless you mean the register structure
is different...
> 
> All of this should be handled correctly in kernel/signal.c, and things
> like triggering the debugger should be done from there, not duplicated
> in each platform's signal delivery code.

The other side of this nasty mess is getting a handle on the
registers.  They are all passed differently from the system
call stuff in entry.S (or what ever).
> 
> Ideally we should even trigger the debugger without necessarily
> knocking the sleeping process out of sleep.

Actually it is the other way round, the debugger is
triggering the task and asking it to go to a "collection"
point.

I would love to do it otherwise.  But this is what we have
today.  And the debugger is not the only case of signals
that do not get delivered to user code.  For the moment, I
would like to make sure the problem can still be addressed. 
At least today, a solution is possible.

As to how to deliver such events, what is needed is a way to
make a task arrive at a known point and to wait there.  Sure
sounds like a signal to me.  I don't see how this can be
done with out waking sleepers, but then there are lots of
things I don't see :)


-- 
George Anzinger   george@mvista.com
High-res-timers: 
http://sourceforge.net/projects/high-res-timers/
Preemption patch:
http://www.kernel.org/pub/linux/kernel/people/rml

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

* Re: [PATCH] make do_signal static on i386
  2002-10-09 17:40 ` george anzinger
@ 2002-10-09 19:37   ` Daniel Jacobowitz
  2002-10-09 20:22     ` george anzinger
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel Jacobowitz @ 2002-10-09 19:37 UTC (permalink / raw)
  To: george anzinger; +Cc: Stephen Rothwell, Linus, LKML, Jeff Dike

On Wed, Oct 09, 2002 at 10:40:39AM -0700, george anzinger wrote:
> This will cause problems for nano_sleep and
> clock_nanosleep.  These system calls need to call
> do_signal() in order to meet the POSIX standard which states
> that they are interrupted only by signals that are delivered
> to user code.  Other signals are not to interrupt the
> sleep.  This is why do_signal() returns this information to
> the caller.
> 
> I suppose one could argue that such functions should be in
> signal.c, but save for this signal issue the code is
> common.  Seems a waste to support the same code in N
> platforms.

IMO, calling the architecture's do_signal function to handle that is
entirely the wrong way to go.  They don't even all have the same
arguments, and the wrappers hi-res-timers put around sys_nanosleep are
hideous.

All of this should be handled correctly in kernel/signal.c, and things
like triggering the debugger should be done from there, not duplicated
in each platform's signal delivery code.

Ideally we should even trigger the debugger without necessarily
knocking the sleeping process out of sleep.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

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

* Re: [PATCH] make do_signal static on i386
  2002-10-09  8:10 Stephen Rothwell
  2002-10-09 11:30 ` Jeff Dike
@ 2002-10-09 17:40 ` george anzinger
  2002-10-09 19:37   ` Daniel Jacobowitz
  1 sibling, 1 reply; 7+ messages in thread
From: george anzinger @ 2002-10-09 17:40 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: Linus, LKML, Jeff Dike

This will cause problems for nano_sleep and
clock_nanosleep.  These system calls need to call
do_signal() in order to meet the POSIX standard which states
that they are interrupted only by signals that are delivered
to user code.  Other signals are not to interrupt the
sleep.  This is why do_signal() returns this information to
the caller.

I suppose one could argue that such functions should be in
signal.c, but save for this signal issue the code is
common.  Seems a waste to support the same code in N
platforms.

-g

Stephen Rothwell wrote:
> 
> Hi Linus,
> 
> This patch makes do_signal static in arch/i386/kernel/signal.c which
> means its declaration can be removed from asm-i386/signal.h which may
> help Jeff out with UML.
> 
> I am not sure whether we need the FASTCALL() or whether the change
> in the comment in asm-um/signal.h makes sense.  (Does UML work on
> x86_64, yet?)
> 
> --
> Cheers,
> Stephen Rothwell                    sfr@canb.auug.org.au
> http://www.canb.auug.org.au/~sfr/
> 
> diff -ruN 2.5.41-1.715/arch/i386/kernel/signal.c 2.5.41-1.715-si.1/arch/i386/kernel/signal.c
> --- 2.5.41-1.715/arch/i386/kernel/signal.c      2002-10-02 11:23:54.000000000 +1000
> +++ 2.5.41-1.715-si.1/arch/i386/kernel/signal.c 2002-10-09 17:52:15.000000000 +1000
> @@ -27,6 +27,8 @@
> 
>  #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
> 
> +static int FASTCALL(do_signal(struct pt_regs *regs, sigset_t *oldset));
> +
>  /*
>   * Atomically swap in the new signal mask, and wait for a signal.
>   */
> @@ -545,7 +547,7 @@
>   * want to handle. Thus you cannot kill init even with a SIGKILL even by
>   * mistake.
>   */
> -int do_signal(struct pt_regs *regs, sigset_t *oldset)
> +static int do_signal(struct pt_regs *regs, sigset_t *oldset)
>  {
>         siginfo_t info;
>         int signr;
> diff -ruN 2.5.41-1.715/include/asm-i386/signal.h 2.5.41-1.715-si.1/include/asm-i386/signal.h
> --- 2.5.41-1.715/include/asm-i386/signal.h      2002-01-31 07:12:46.000000000 +1100
> +++ 2.5.41-1.715-si.1/include/asm-i386/signal.h 2002-10-09 17:54:28.000000000 +1000
> @@ -2,7 +2,6 @@
>  #define _ASMi386_SIGNAL_H
> 
>  #include <linux/types.h>
> -#include <linux/linkage.h>
> 
>  /* Avoid too many header ordering problems.  */
>  struct siginfo;
> @@ -217,9 +216,6 @@
>         return word;
>  }
> 
> -struct pt_regs;
> -extern int FASTCALL(do_signal(struct pt_regs *regs, sigset_t *oldset));
> -
>  #endif /* __KERNEL__ */
> 
>  #endif
> diff -ruN 2.5.41-1.715/include/asm-um/signal.h 2.5.41-1.715-si.1/include/asm-um/signal.h
> --- 2.5.41-1.715/include/asm-um/signal.h        2002-09-16 13:40:57.000000000 +1000
> +++ 2.5.41-1.715-si.1/include/asm-um/signal.h   2002-10-09 17:56:20.000000000 +1000
> @@ -6,7 +6,7 @@
>  #ifndef __UM_SIGNAL_H
>  #define __UM_SIGNAL_H
> 
> -/* Need to kill the do_signal() declaration in the i386 signal.h */
> +/* Need to kill the do_signal() declaration in the x86_64 signal.h */
> 
>  #define do_signal do_signal_renamed
>  #include "asm/arch/signal.h"
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

-- 
George Anzinger   george@mvista.com
High-res-timers: 
http://sourceforge.net/projects/high-res-timers/
Preemption patch:
http://www.kernel.org/pub/linux/kernel/people/rml

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

* Re: [PATCH] make do_signal static on i386
  2002-10-09  8:10 Stephen Rothwell
@ 2002-10-09 11:30 ` Jeff Dike
  2002-10-09 17:40 ` george anzinger
  1 sibling, 0 replies; 7+ messages in thread
From: Jeff Dike @ 2002-10-09 11:30 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: Linus, linux-kernel

sfr@canb.auug.org.au said:
> This patch makes do_signal static in arch/i386/kernel/signal.c which
> means its declaration can be removed from asm-i386/signal.h which may
> help Jeff out with UML. 

Cool, anything which makes the other arch headers more UML-friendly is
good.

> (Does UML work on x86_64, yet?)

Not yet.

				Jeff


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

* Re: [PATCH] make do_signal static on i386
       [not found] <20021009181003.022da660.sfr@canb.auug.org.au.suse.lists.linux.kernel>
@ 2002-10-09  8:18 ` Andi Kleen
  0 siblings, 0 replies; 7+ messages in thread
From: Andi Kleen @ 2002-10-09  8:18 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linux-kernel

Stephen Rothwell <sfr@canb.auug.org.au> writes:

> I am not sure whether we need the FASTCALL() or whether the change

The FASTCALL was only needed when it was still called from entry.S
(= in 2.4) 

> in the comment in asm-um/signal.h makes sense.  (Does UML work on
> x86_64, yet?)

I doubt that it works. At least I never tried it.

-Andi


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

* [PATCH] make do_signal static on i386
@ 2002-10-09  8:10 Stephen Rothwell
  2002-10-09 11:30 ` Jeff Dike
  2002-10-09 17:40 ` george anzinger
  0 siblings, 2 replies; 7+ messages in thread
From: Stephen Rothwell @ 2002-10-09  8:10 UTC (permalink / raw)
  To: Linus; +Cc: LKML, Jeff Dike

Hi Linus,

This patch makes do_signal static in arch/i386/kernel/signal.c which
means its declaration can be removed from asm-i386/signal.h which may
help Jeff out with UML.

I am not sure whether we need the FASTCALL() or whether the change
in the comment in asm-um/signal.h makes sense.  (Does UML work on
x86_64, yet?)

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

diff -ruN 2.5.41-1.715/arch/i386/kernel/signal.c 2.5.41-1.715-si.1/arch/i386/kernel/signal.c
--- 2.5.41-1.715/arch/i386/kernel/signal.c	2002-10-02 11:23:54.000000000 +1000
+++ 2.5.41-1.715-si.1/arch/i386/kernel/signal.c	2002-10-09 17:52:15.000000000 +1000
@@ -27,6 +27,8 @@
 
 #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
 
+static int FASTCALL(do_signal(struct pt_regs *regs, sigset_t *oldset));
+
 /*
  * Atomically swap in the new signal mask, and wait for a signal.
  */
@@ -545,7 +547,7 @@
  * want to handle. Thus you cannot kill init even with a SIGKILL even by
  * mistake.
  */
-int do_signal(struct pt_regs *regs, sigset_t *oldset)
+static int do_signal(struct pt_regs *regs, sigset_t *oldset)
 {
 	siginfo_t info;
 	int signr;
diff -ruN 2.5.41-1.715/include/asm-i386/signal.h 2.5.41-1.715-si.1/include/asm-i386/signal.h
--- 2.5.41-1.715/include/asm-i386/signal.h	2002-01-31 07:12:46.000000000 +1100
+++ 2.5.41-1.715-si.1/include/asm-i386/signal.h	2002-10-09 17:54:28.000000000 +1000
@@ -2,7 +2,6 @@
 #define _ASMi386_SIGNAL_H
 
 #include <linux/types.h>
-#include <linux/linkage.h>
 
 /* Avoid too many header ordering problems.  */
 struct siginfo;
@@ -217,9 +216,6 @@
 	return word;
 }
 
-struct pt_regs;
-extern int FASTCALL(do_signal(struct pt_regs *regs, sigset_t *oldset));
-
 #endif /* __KERNEL__ */
 
 #endif
diff -ruN 2.5.41-1.715/include/asm-um/signal.h 2.5.41-1.715-si.1/include/asm-um/signal.h
--- 2.5.41-1.715/include/asm-um/signal.h	2002-09-16 13:40:57.000000000 +1000
+++ 2.5.41-1.715-si.1/include/asm-um/signal.h	2002-10-09 17:56:20.000000000 +1000
@@ -6,7 +6,7 @@
 #ifndef __UM_SIGNAL_H
 #define __UM_SIGNAL_H
 
-/* Need to kill the do_signal() declaration in the i386 signal.h */
+/* Need to kill the do_signal() declaration in the x86_64 signal.h */
 
 #define do_signal do_signal_renamed
 #include "asm/arch/signal.h"

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

end of thread, other threads:[~2002-10-10  7:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-10  7:23 [PATCH] make do_signal static on i386 Pavel Machek
     [not found] <20021009181003.022da660.sfr@canb.auug.org.au.suse.lists.linux.kernel>
2002-10-09  8:18 ` Andi Kleen
  -- strict thread matches above, loose matches on Subject: below --
2002-10-09  8:10 Stephen Rothwell
2002-10-09 11:30 ` Jeff Dike
2002-10-09 17:40 ` george anzinger
2002-10-09 19:37   ` Daniel Jacobowitz
2002-10-09 20:22     ` george anzinger

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 NNTP newsgroup(s).