aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndi Kleen <ak@suse.de>2005-05-20 17:27:58 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-05-20 18:48:21 -0400
commit607a16858397829806c5a4db999ce6daf327f98c (patch)
tree10f3568581880d54287382dcdfb02dcc5525df8e
parent4057923614e2868a865aa6c6e3bc53542c818d4d (diff)
[PATCH] x86_64: Fix 32bit system call restart
The test case at http://cvs.sourceforge.net/viewcvs.py/posixtest/posixtestsuite/conforman ce/interfaces/clock_nanosleep/1-5.c fails if it runs as a 32bit process on x86_86 machines. The root cause is the sub 32bit process fails to restart the syscall after it is interrupted by a signal. The syscall number of sys_restart_syscall in table sys_call_table is __NR_restart_syscall (219) while it's __NR_ia32_restart_syscall (0) in ia32_sys_call_table. When regs->rax==(unsigned long)-ERESTART_RESTARTBLOCK, function do_signal doesn't distinguish if the process is 64bit or 32bit, and always sets restart syscall number as __NR_restart_syscall (219). Signed-off-by: Zhang Yanmin <yanmin.zhang@intel.com> Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--arch/x86_64/kernel/signal.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/x86_64/kernel/signal.c b/arch/x86_64/kernel/signal.c
index d439ced150c6..3fdcdba0fec5 100644
--- a/arch/x86_64/kernel/signal.c
+++ b/arch/x86_64/kernel/signal.c
@@ -452,7 +452,9 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset)
452 regs->rip -= 2; 452 regs->rip -= 2;
453 } 453 }
454 if (regs->rax == (unsigned long)-ERESTART_RESTARTBLOCK) { 454 if (regs->rax == (unsigned long)-ERESTART_RESTARTBLOCK) {
455 regs->rax = __NR_restart_syscall; 455 regs->rax = test_thread_flag(TIF_IA32) ?
456 __NR_ia32_restart_syscall :
457 __NR_restart_syscall;
456 regs->rip -= 2; 458 regs->rip -= 2;
457 } 459 }
458 } 460 }