linux-um archives
 help / color / mirror / Atom feed
From: Jeff Dike <jdike@addtoit.com>
To: "Stroesser, Bodo" <Bodo.Stroesser@fujitsu-siemens.com>
Cc: user-mode-linux-devel@lists.sourceforge.net,
	BlaisorBlade <blaisorblade_spam@yahoo.it>
Subject: Re: [uml-devel] Minor problems with interrupted systemcalls
Date: Fri, 24 Sep 2004 17:32:23 -0400	[thread overview]
Message-ID: <200409242132.i8OLWNZX003930@ccure.user-mode-linux.org> (raw)
In-Reply-To: Your message of "Wed, 22 Sep 2004 19:12:37 +0200." <8B6FF516CBA0194AB0996705076B02520F7C38@ABGEX01E.abg.fsc.net>

OK, following is my breakup of your signal patch.  It all looks right to me,
and cleans up that code nicely.  Let me know if you see any problems here.

These are also available from the incremental patches page
	http://user-mode-linux.sourceforge.net/patches.html
and I would appreciate testing.

This one changes the do_signal interface to eliminate its argument.  Also,
remove the calls from the system call handlers since they are redundant.  In
all cases, pending signals are checked for in the interrupt handler.
Temporarily, do_signal passes the current error to kern_do_signal.

				Jeff

Index: 2.6.9-rc/arch/um/include/kern_util.h
===================================================================
--- 2.6.9-rc.orig/arch/um/include/kern_util.h	2004-09-24 12:58:02.000000000 -0400
+++ 2.6.9-rc/arch/um/include/kern_util.h	2004-09-24 14:10:16.000000000 -0400
@@ -29,7 +29,7 @@
 extern void syscall_segv(int sig);
 extern int current_pid(void);
 extern unsigned long alloc_stack(int order, int atomic);
-extern int do_signal(int error);
+extern int do_signal(void);
 extern int is_stack_fault(unsigned long sp);
 extern unsigned long segv(unsigned long address, unsigned long ip, 
 			  int is_write, int is_user, void *sc);
Index: 2.6.9-rc/arch/um/kernel/process_kern.c
===================================================================
--- 2.6.9-rc.orig/arch/um/kernel/process_kern.c	2004-09-24 13:05:44.000000000 -0400
+++ 2.6.9-rc/arch/um/kernel/process_kern.c	2004-09-24 16:17:07.000000000 -0400
@@ -139,7 +139,7 @@
 void interrupt_end(void)
 {
 	if(need_resched()) schedule();
-	if(test_tsk_thread_flag(current, TIF_SIGPENDING)) do_signal(0);
+	if(test_tsk_thread_flag(current, TIF_SIGPENDING)) do_signal();
 }
 
 void release_thread(struct task_struct *task)
Index: 2.6.9-rc/arch/um/kernel/signal_kern.c
===================================================================
--- 2.6.9-rc.orig/arch/um/kernel/signal_kern.c	2004-09-24 13:05:44.000000000 -0400
+++ 2.6.9-rc/arch/um/kernel/signal_kern.c	2004-09-24 16:04:00.000000000 -0400
@@ -163,9 +163,10 @@
 	return(0);
 }
 
-int do_signal(int error)
+int do_signal(void)
 {
-	return(kern_do_signal(&current->thread.regs, NULL, error));
+	return(kern_do_signal(&current->thread.regs, NULL,
+			      PT_REGS_SYSCALL_RET(&current->thread.regs)));
 }
 
 /*
Index: 2.6.9-rc/arch/um/kernel/skas/syscall_user.c
===================================================================
--- 2.6.9-rc.orig/arch/um/kernel/skas/syscall_user.c	2004-09-13 22:37:13.000000000 -0400
+++ 2.6.9-rc/arch/um/kernel/skas/syscall_user.c	2004-09-24 14:10:16.000000000 -0400
@@ -10,10 +10,6 @@
 #include "sysdep/ptrace.h"
 #include "sysdep/sigcontext.h"
 
-/* XXX Bogus */
-#define ERESTARTSYS	512
-#define ERESTARTNOINTR	513
-#define ERESTARTNOHAND	514
 
 void handle_syscall(union uml_pt_regs *regs)
 {
@@ -26,9 +22,6 @@
 	result = execute_syscall(regs);
 
 	REGS_SET_SYSCALL_RETURN(regs->skas.regs, result);
-	if((result == -ERESTARTNOHAND) || (result == -ERESTARTSYS) || 
-	   (result == -ERESTARTNOINTR))
-		do_signal(result);
 
 	syscall_trace(regs, 0);
 	record_syscall_end(index, result);
Index: 2.6.9-rc/arch/um/kernel/tt/syscall_user.c
===================================================================
--- 2.6.9-rc.orig/arch/um/kernel/tt/syscall_user.c	2004-09-13 22:37:13.000000000 -0400
+++ 2.6.9-rc/arch/um/kernel/tt/syscall_user.c	2004-09-24 16:04:02.000000000 -0400
@@ -17,10 +17,6 @@
 #include "syscall_user.h"
 #include "tt.h"
 
-/* XXX Bogus */
-#define ERESTARTSYS	512
-#define ERESTARTNOINTR	513
-#define ERESTARTNOHAND	514
 
 void syscall_handler_tt(int sig, union uml_pt_regs *regs)
 {
@@ -42,9 +38,6 @@
 	UPT_SC(regs) = sc;
 
 	SC_SET_SYSCALL_RETURN(sc, result);
-	if((result == -ERESTARTNOHAND) || (result == -ERESTARTSYS) || 
-	   (result == -ERESTARTNOINTR))
-		do_signal(result);
 
 	syscall_trace(regs, 0);
 	record_syscall_end(index, result);



-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

  reply	other threads:[~2004-09-24 20:27 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-22 17:12 [uml-devel] Minor problems with interrupted systemcalls Stroesser, Bodo
2004-09-24 21:32 ` Jeff Dike [this message]
2004-09-24 21:32 ` Jeff Dike
2004-09-24 21:32 ` Jeff Dike
2004-09-24 21:32 ` Jeff Dike
2004-09-24 21:32 ` Jeff Dike
  -- strict thread matches above, loose matches on Subject: below --
2004-09-29 16:34 Stroesser, Bodo
2004-09-29 21:10 ` Jeff Dike
2004-09-20 10:06 Stroesser, Bodo
2004-09-21 17:31 ` BlaisorBlade
2004-09-17 17:46 Stroesser, Bodo
2004-09-18 16:17 ` BlaisorBlade

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=200409242132.i8OLWNZX003930@ccure.user-mode-linux.org \
    --to=jdike@addtoit.com \
    --cc=Bodo.Stroesser@fujitsu-siemens.com \
    --cc=blaisorblade_spam@yahoo.it \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    /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