Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753357AbbHJHnp (ORCPT ); Mon, 10 Aug 2015 03:43:45 -0400 Received: from mail-vk0-f45.google.com ([209.85.213.45]:34200 "EHLO mail-vk0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752814AbbHJHnm (ORCPT ); Mon, 10 Aug 2015 03:43:42 -0400 MIME-Version: 1.0 In-Reply-To: <20150805162131.GB16341@amd> References: <1438353346-67177-1-git-send-email-drysdale@google.com> <1438353346-67177-2-git-send-email-drysdale@google.com> <20150805162131.GB16341@amd> From: David Drysdale Date: Mon, 10 Aug 2015 08:43:21 +0100 Message-ID: Subject: Re: [PATCHv3 1/1] Documentation: describe how to add a system call To: Pavel Machek Cc: Linux API , Michael Kerrisk , Andrew Morton , Arnd Bergmann , Shuah Khan , Jonathan Corbet , Eric B Munson , Randy Dunlap , Cyril Hrubis , Josh Triplett , Andrea Arcangeli , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Oleg Nesterov , Linus Torvalds , Greg Kroah-Hartman , Andy Lutomirski , Al Viro , Rusty Russell , Peter Zijlstra , Vivek Goyal , Alexei Starovoitov , David Herrmann , "Theodore Ts'o" , Kees Cook , Milosz Tanski , Fam Zheng , Mathieu Desnoyers , linux-doc@vger.kernel.org, "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2539 Lines: 68 On Wed, Aug 5, 2015 at 5:21 PM, Pavel Machek wrote: > Hi! > >> Add a document describing the process of adding a new system call, >> including the need for a flags argument for future compatibility, and >> covering 32-bit/64-bit concerns (albeit in an x86-centric way). >> >> Signed-off-by: David Drysdale >> Reviewed-by: Michael Kerrisk >> Reviewed-by: Eric B Munson >> Reviewed-by: Kees Cook >> Reviewed-by: Randy Dunlap >> --- >> Documentation/adding-syscalls.txt | 531 ++++++++++++++++++++++++++++++++++++++ >> 1 file changed, 531 insertions(+) >> create mode 100644 Documentation/adding-syscalls.txt > > We usually align documentation to less than 80 columns, afaict. Ah, a few re-worded paragraphs crept over the limit. Reflowed. >> +call. To make sure that userspace programs can safely use flags between kernel >> +versions, check whether the flags value holds any unknown flags, and reject the >> +sycall (with EINVAL) if it does: > > syscall? Fixed, thanks. >> +New system call proposals, like any change to the kernel's API, should always >> +be cc'ed to linux-api@vger.kernel.org > > . at and of sentence? Fixed. >> +System Calls Returning Elsewhere >> +-------------------------------- >> + >> +For most system calls, once the system call is complete the user program >> +continues exactly where it left off -- at the next instruction, with the same >> +stack and registers as before the system call, and with the same virtual >> +memory space. > > Umm. Normally we place return value in register. And I'm not sure.. do > syscalls preserve registers that are normally caller-clobbered in the ABI? Reworded to: For most system calls, once the system call is complete the user program continues exactly where it left off -- at the next instruction, with the stack the same and most of the registers the same as before the system call, and with the same virtual memory space. > Thanks, > Pavel Thanks for the updates, David > -- > (english) http://www.livejournal.com/~pavelmachek > (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html -- 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/