All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] RFC: s390: Move get_signal_to_deliver() up in do_signal
@ 2010-02-10 20:40 Serge E. Hallyn
       [not found] ` <20100210204019.GA24269-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Serge E. Hallyn @ 2010-02-10 20:40 UTC (permalink / raw)
  To: s390; +Cc: Martin Schwidefsky, Linux Containers

The current placement of get_signal_to_deliver() means that
try_to_freeze() in get_signal_to_deliver() will happen after
regs->psw.addr, regs->svcnr, and regs->gprs[2] may have been
mangled.  Since the app may get checkpointed while frozen and
then restarted, this means we have to attempt a complicated
and subtle re-calculation of the initial conditions.

If we just move the get_signal_to_deliver() above the
immediately preceding block, we enourmously simplify the
arch-specific checkpoint/restart code.

A full ltp run seems to show no regressions do to this move,
though I'm not familiar enough with the entry_64.S code in
particular to be absolutely confident.

Is this a bad idea?

Signed-off-by: Serge E. Hallyn <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
---
 arch/s390/kernel/signal.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/s390/kernel/signal.c b/arch/s390/kernel/signal.c
index 1675c48..7dbd618 100644
--- a/arch/s390/kernel/signal.c
+++ b/arch/s390/kernel/signal.c
@@ -442,6 +442,10 @@ void do_signal(struct pt_regs *regs)
 	else
 		oldset = &current->blocked;
 
+	/* Get signal to deliver.  When running under ptrace, at this point
+	   the debugger may change all our registers ... */
+	signr = get_signal_to_deliver(&info, &ka, regs, NULL);
+
 	/* Are we from a system call? */
 	if (regs->svcnr) {
 		continue_addr = regs->psw.addr;
@@ -463,10 +467,6 @@ void do_signal(struct pt_regs *regs)
 		regs->svcnr = 0;	/* Don't deal with this again. */
 	}
 
-	/* Get signal to deliver.  When running under ptrace, at this point
-	   the debugger may change all our registers ... */
-	signr = get_signal_to_deliver(&info, &ka, regs, NULL);
-
 	/* Depending on the signal settings we may need to revert the
 	   decision to restart the system call. */
 	if (signr > 0 && regs->psw.addr == restart_addr) {
-- 
1.6.1

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

end of thread, other threads:[~2010-02-15 13:26 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-10 20:40 [PATCH] RFC: s390: Move get_signal_to_deliver() up in do_signal Serge E. Hallyn
     [not found] ` <20100210204019.GA24269-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-02-11  8:48   ` Martin Schwidefsky
     [not found]     ` <20100211094838.4550edd9-Ne9dzUzLWq+XI4yAdoq52KN5r0PSdgG1zG2AekJRRhI@public.gmane.org>
2010-02-11 17:29       ` Serge E. Hallyn
     [not found]         ` <20100211172917.GD6884-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-02-11 17:48           ` Oren Laadan
     [not found]             ` <4B7442EC.5080903-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2010-02-11 18:39               ` Serge E. Hallyn
     [not found]                 ` <20100211183903.GA17753-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-02-11 23:03                   ` Serge E. Hallyn
     [not found]                     ` <20100211230331.GA28209-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-02-15 13:26                       ` Oren Laadan
2010-02-15 13:26                         ` Oren Laadan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.