From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Metcalf Subject: Re: [PATCH RFC 8/8] tile: implement syscall restart generically Date: Mon, 31 Oct 2011 11:48:21 -0400 Message-ID: <4EAEC345.90704@tilera.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: Jonas Bonn Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org List-Id: linux-arch.vger.kernel.org On 10/23/2011 6:20 AM, Jonas Bonn wrote: > Manipulating task state to effect re-execution of an interrupted syscall > used to be purely architecture specific code. However, as most arch's > were essentially just making minor adjustments to almost identical logic, > this code could be moved to a common implementation. > > The generic variant introduces the function handle_syscall_restart() to be > called after get_signal_to_deliver(). The architecture specific register > manipulations required to effect the actual restart are now implemented > in the generic syscall interface found in asm/syscall.h > > This patch transitions this architecture's signal handling code over to > using the generic syscall restart code by: > > i) Implementing the register manipulations in asm/syscall.h > ii) Replacing the restart logic with a call to handle_syscall_restart > > Cc: Chris Metcalf > Signed-off-by: Jonas Bonn I like the idea, though the patch isn't quite right: - You need to move the definition of INT_SWINT_1_SIGRETURN from to . You then have to add #includes of to signal.c and stack.c in arch/tile/kernel. (And probably use syscall_clear() in signal.c.) - In syscall_do_restartblock() you need to use regs->regs[], not regs->gprs[]. -- Chris Metcalf, Tilera Corp. http://www.tilera.com From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from usmamail.tilera.com ([206.83.70.75]:18113 "EHLO USMAMAIL.TILERA.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933538Ab1JaPxn (ORCPT ); Mon, 31 Oct 2011 11:53:43 -0400 Message-ID: <4EAEC345.90704@tilera.com> Date: Mon, 31 Oct 2011 11:48:21 -0400 From: Chris Metcalf MIME-Version: 1.0 Subject: Re: [PATCH RFC 8/8] tile: implement syscall restart generically References: In-Reply-To: Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Sender: linux-arch-owner@vger.kernel.org List-ID: To: Jonas Bonn Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org Message-ID: <20111031154821.wJ8E8QSxEVPfGg3aCihpZP7nF7MU3IIpv_vrZLgkilU@z> On 10/23/2011 6:20 AM, Jonas Bonn wrote: > Manipulating task state to effect re-execution of an interrupted syscall > used to be purely architecture specific code. However, as most arch's > were essentially just making minor adjustments to almost identical logic, > this code could be moved to a common implementation. > > The generic variant introduces the function handle_syscall_restart() to be > called after get_signal_to_deliver(). The architecture specific register > manipulations required to effect the actual restart are now implemented > in the generic syscall interface found in asm/syscall.h > > This patch transitions this architecture's signal handling code over to > using the generic syscall restart code by: > > i) Implementing the register manipulations in asm/syscall.h > ii) Replacing the restart logic with a call to handle_syscall_restart > > Cc: Chris Metcalf > Signed-off-by: Jonas Bonn I like the idea, though the patch isn't quite right: - You need to move the definition of INT_SWINT_1_SIGRETURN from to . You then have to add #includes of to signal.c and stack.c in arch/tile/kernel. (And probably use syscall_clear() in signal.c.) - In syscall_do_restartblock() you need to use regs->regs[], not regs->gprs[]. -- Chris Metcalf, Tilera Corp. http://www.tilera.com