Re: [PATCHv2 1/1] Documentation: describe how to add a system call

2015-08-01 Thread H. Peter Anvin
Desnoyers ,"linux-...@vger.kernel.org" ,"linux-kernel@vger.kernel.org" ,Peter Zijlstra Message-ID: Let me see if I can unbury it - probably not until Monday, though. On July 31, 2015 11:18:06 PM PDT, Josh Triplett wrote: >On Fri, Jul 31, 2015 at 09:56:46PM -0700, H. Peter Anvin wrote: >> On

Re: [PATCHv2 1/1] Documentation: describe how to add a system call

2015-08-01 Thread Josh Triplett
On Fri, Jul 31, 2015 at 09:56:46PM -0700, H. Peter Anvin wrote: > On 07/31/2015 09:32 PM, Josh Triplett wrote: > > > > Sure, agreed. But I really hope we don't create new kernel ABIs that > > involve constructs like that. > > > > It's worth noting I have pushed for auto-marshalling in general

Re: [PATCHv2 1/1] Documentation: describe how to add a system call

2015-08-01 Thread H. Peter Anvin
Desnoyers mathieu.desnoy...@efficios.com,linux-...@vger.kernel.org linux-...@vger.kernel.org,linux-kernel@vger.kernel.org linux-kernel@vger.kernel.org,Peter Zijlstra a.p.zijls...@chello.nl Message-ID: d190a265-cbf0-460e-b12a-df0e802c5...@zytor.com Let me see if I can unbury it - probably not

Re: [PATCHv2 1/1] Documentation: describe how to add a system call

2015-08-01 Thread Josh Triplett
On Fri, Jul 31, 2015 at 09:56:46PM -0700, H. Peter Anvin wrote: On 07/31/2015 09:32 PM, Josh Triplett wrote: Sure, agreed. But I really hope we don't create new kernel ABIs that involve constructs like that. It's worth noting I have pushed for auto-marshalling in general for a long

Re: [PATCHv2 1/1] Documentation: describe how to add a system call

2015-07-31 Thread H. Peter Anvin
On 07/31/2015 09:32 PM, Josh Triplett wrote: > > Sure, agreed. But I really hope we don't create new kernel ABIs that > involve constructs like that. > It's worth noting I have pushed for auto-marshalling in general for a long time, not the least to get rid of the awful syscall(3) wrapper. I

Re: [PATCHv2 1/1] Documentation: describe how to add a system call

2015-07-31 Thread Josh Triplett
On Fri, Jul 31, 2015 at 03:54:56PM -0700, Andy Lutomirski wrote: > On Fri, Jul 31, 2015 at 3:08 PM, wrote: > > On Fri, Jul 31, 2015 at 02:19:29PM -0700, Andy Lutomirski wrote: > >> On Fri, Jul 31, 2015 at 1:59 PM, wrote: > >> > Agreed. I think the proposal above would be a net improvement,

Re: [PATCHv2 1/1] Documentation: describe how to add a system call

2015-07-31 Thread Andy Lutomirski
On Fri, Jul 31, 2015 at 3:08 PM, wrote: > On Fri, Jul 31, 2015 at 02:19:29PM -0700, Andy Lutomirski wrote: >> On Fri, Jul 31, 2015 at 1:59 PM, wrote: >> > Agreed. I think the proposal above would be a net improvement, but >> > ideally you'd want something that's annotated and generates

Re: [PATCHv2 1/1] Documentation: describe how to add a system call

2015-07-31 Thread josh
On Fri, Jul 31, 2015 at 02:19:29PM -0700, Andy Lutomirski wrote: > On Fri, Jul 31, 2015 at 1:59 PM, wrote: > > Agreed. I think the proposal above would be a net improvement, but > > ideally you'd want something that's annotated and generates automatic > > marshalling code. > > > > I assume

Re: [PATCHv2 1/1] Documentation: describe how to add a system call

2015-07-31 Thread Andy Lutomirski
On Fri, Jul 31, 2015 at 1:59 PM, wrote: > On Fri, Jul 31, 2015 at 11:56:06AM -0700, Kees Cook wrote: >> On Thu, Jul 30, 2015 at 6:02 PM, Josh Triplett wrote: >> > On Thu, Jul 30, 2015 at 01:03:43PM -0700, Kees Cook wrote: >> >> On Thu, Jul 30, 2015 at 12:04 PM, Josh Triplett >> >> wrote: >>

Re: [PATCHv2 1/1] Documentation: describe how to add a system call

2015-07-31 Thread josh
On Fri, Jul 31, 2015 at 11:56:06AM -0700, Kees Cook wrote: > On Thu, Jul 30, 2015 at 6:02 PM, Josh Triplett wrote: > > On Thu, Jul 30, 2015 at 01:03:43PM -0700, Kees Cook wrote: > >> On Thu, Jul 30, 2015 at 12:04 PM, Josh Triplett > >> wrote: > >> > On Thu, Jul 30, 2015 at 11:21:54AM -0700,

Re: [PATCHv2 1/1] Documentation: describe how to add a system call

2015-07-31 Thread Kees Cook
On Thu, Jul 30, 2015 at 6:02 PM, Josh Triplett wrote: > On Thu, Jul 30, 2015 at 01:03:43PM -0700, Kees Cook wrote: >> On Thu, Jul 30, 2015 at 12:04 PM, Josh Triplett >> wrote: >> > On Thu, Jul 30, 2015 at 11:21:54AM -0700, Kees Cook wrote: >> >> I like this, it's a good description of both

Re: [PATCHv2 1/1] Documentation: describe how to add a system call

2015-07-31 Thread David Drysdale
On Fri, Jul 31, 2015 at 2:06 PM, Josh Triplett wrote: > On Fri, Jul 31, 2015 at 10:48:32AM +0100, David Drysdale wrote: >> On Thu, Jul 30, 2015 at 7:50 PM, Josh Triplett wrote: >> > On Thu, Jul 30, 2015 at 08:52:11AM +0100, David Drysdale wrote: >> >> +needs to be governed by the appropriate

Re: [PATCHv2 1/1] Documentation: describe how to add a system call

2015-07-31 Thread Josh Triplett
On Fri, Jul 31, 2015 at 10:48:32AM +0100, David Drysdale wrote: > On Thu, Jul 30, 2015 at 7:50 PM, Josh Triplett wrote: > > On Thu, Jul 30, 2015 at 08:52:11AM +0100, David Drysdale wrote: > >> Add a document describing the process of adding a new system call, > >> including the need for a flags

Re: [PATCHv2 1/1] Documentation: describe how to add a system call

2015-07-31 Thread David Drysdale
On Thu, Jul 30, 2015 at 7:50 PM, Josh Triplett wrote: > On Thu, Jul 30, 2015 at 08:52:11AM +0100, David Drysdale wrote: >> 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

Re: [PATCHv2 1/1] Documentation: describe how to add a system call

2015-07-31 Thread Josh Triplett
On Fri, Jul 31, 2015 at 03:54:56PM -0700, Andy Lutomirski wrote: On Fri, Jul 31, 2015 at 3:08 PM, j...@joshtriplett.org wrote: On Fri, Jul 31, 2015 at 02:19:29PM -0700, Andy Lutomirski wrote: On Fri, Jul 31, 2015 at 1:59 PM, j...@joshtriplett.org wrote: Agreed. I think the proposal

Re: [PATCHv2 1/1] Documentation: describe how to add a system call

2015-07-31 Thread H. Peter Anvin
On 07/31/2015 09:32 PM, Josh Triplett wrote: Sure, agreed. But I really hope we don't create new kernel ABIs that involve constructs like that. It's worth noting I have pushed for auto-marshalling in general for a long time, not the least to get rid of the awful syscall(3) wrapper. I even

Re: [PATCHv2 1/1] Documentation: describe how to add a system call

2015-07-31 Thread Josh Triplett
On Fri, Jul 31, 2015 at 10:48:32AM +0100, David Drysdale wrote: On Thu, Jul 30, 2015 at 7:50 PM, Josh Triplett j...@joshtriplett.org wrote: On Thu, Jul 30, 2015 at 08:52:11AM +0100, David Drysdale wrote: Add a document describing the process of adding a new system call, including the need

Re: [PATCHv2 1/1] Documentation: describe how to add a system call

2015-07-31 Thread David Drysdale
On Fri, Jul 31, 2015 at 2:06 PM, Josh Triplett j...@joshtriplett.org wrote: On Fri, Jul 31, 2015 at 10:48:32AM +0100, David Drysdale wrote: On Thu, Jul 30, 2015 at 7:50 PM, Josh Triplett j...@joshtriplett.org wrote: On Thu, Jul 30, 2015 at 08:52:11AM +0100, David Drysdale wrote: +needs to be

Re: [PATCHv2 1/1] Documentation: describe how to add a system call

2015-07-31 Thread Kees Cook
On Thu, Jul 30, 2015 at 6:02 PM, Josh Triplett j...@joshtriplett.org wrote: On Thu, Jul 30, 2015 at 01:03:43PM -0700, Kees Cook wrote: On Thu, Jul 30, 2015 at 12:04 PM, Josh Triplett j...@joshtriplett.org wrote: On Thu, Jul 30, 2015 at 11:21:54AM -0700, Kees Cook wrote: I like this, it's a

Re: [PATCHv2 1/1] Documentation: describe how to add a system call

2015-07-31 Thread josh
On Fri, Jul 31, 2015 at 02:19:29PM -0700, Andy Lutomirski wrote: On Fri, Jul 31, 2015 at 1:59 PM, j...@joshtriplett.org wrote: Agreed. I think the proposal above would be a net improvement, but ideally you'd want something that's annotated and generates automatic marshalling code. I

Re: [PATCHv2 1/1] Documentation: describe how to add a system call

2015-07-31 Thread josh
On Fri, Jul 31, 2015 at 11:56:06AM -0700, Kees Cook wrote: On Thu, Jul 30, 2015 at 6:02 PM, Josh Triplett j...@joshtriplett.org wrote: On Thu, Jul 30, 2015 at 01:03:43PM -0700, Kees Cook wrote: On Thu, Jul 30, 2015 at 12:04 PM, Josh Triplett j...@joshtriplett.org wrote: On Thu, Jul 30,

Re: [PATCHv2 1/1] Documentation: describe how to add a system call

2015-07-31 Thread Andy Lutomirski
On Fri, Jul 31, 2015 at 1:59 PM, j...@joshtriplett.org wrote: On Fri, Jul 31, 2015 at 11:56:06AM -0700, Kees Cook wrote: On Thu, Jul 30, 2015 at 6:02 PM, Josh Triplett j...@joshtriplett.org wrote: On Thu, Jul 30, 2015 at 01:03:43PM -0700, Kees Cook wrote: On Thu, Jul 30, 2015 at 12:04 PM,

Re: [PATCHv2 1/1] Documentation: describe how to add a system call

2015-07-31 Thread Andy Lutomirski
On Fri, Jul 31, 2015 at 3:08 PM, j...@joshtriplett.org wrote: On Fri, Jul 31, 2015 at 02:19:29PM -0700, Andy Lutomirski wrote: On Fri, Jul 31, 2015 at 1:59 PM, j...@joshtriplett.org wrote: Agreed. I think the proposal above would be a net improvement, but ideally you'd want something

Re: [PATCHv2 1/1] Documentation: describe how to add a system call

2015-07-31 Thread David Drysdale
On Thu, Jul 30, 2015 at 7:50 PM, Josh Triplett j...@joshtriplett.org wrote: On Thu, Jul 30, 2015 at 08:52:11AM +0100, David Drysdale wrote: Add a document describing the process of adding a new system call, including the need for a flags argument for future compatibility, and covering

Re: [PATCHv2 1/1] Documentation: describe how to add a system call

2015-07-30 Thread Josh Triplett
On Thu, Jul 30, 2015 at 06:02:34PM -0700, Josh Triplett wrote: > On Thu, Jul 30, 2015 at 01:03:43PM -0700, Kees Cook wrote: > > On Thu, Jul 30, 2015 at 12:04 PM, Josh Triplett > > wrote: > > > On Thu, Jul 30, 2015 at 11:21:54AM -0700, Kees Cook wrote: > > >> I like this, it's a good description

Re: [PATCHv2 1/1] Documentation: describe how to add a system call

2015-07-30 Thread Josh Triplett
On Thu, Jul 30, 2015 at 01:03:43PM -0700, Kees Cook wrote: > On Thu, Jul 30, 2015 at 12:04 PM, Josh Triplett wrote: > > On Thu, Jul 30, 2015 at 11:21:54AM -0700, Kees Cook wrote: > >> I like this, it's a good description of both options. I'm still biased > >> about the approach: I prefer flags,

Re: [PATCHv2 1/1] Documentation: describe how to add a system call

2015-07-30 Thread Kees Cook
On Thu, Jul 30, 2015 at 12:04 PM, Josh Triplett wrote: > On Thu, Jul 30, 2015 at 11:21:54AM -0700, Kees Cook wrote: >> I like this, it's a good description of both options. I'm still biased >> about the approach: I prefer flags, since pointers to user structures >> complicate syscall filtering.

Re: [PATCHv2 1/1] Documentation: describe how to add a system call

2015-07-30 Thread Josh Triplett
On Thu, Jul 30, 2015 at 11:21:54AM -0700, Kees Cook wrote: > I like this, it's a good description of both options. I'm still biased > about the approach: I prefer flags, since pointers to user structures > complicate syscall filtering. ;) Seems like we should do two things to make that easier:

Re: [PATCHv2 1/1] Documentation: describe how to add a system call

2015-07-30 Thread Josh Triplett
On Thu, Jul 30, 2015 at 08:52:11AM +0100, David Drysdale wrote: > 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

Re: [PATCHv2 1/1] Documentation: describe how to add a system call

2015-07-30 Thread Josh Triplett
On Thu, Jul 30, 2015 at 10:38:31AM +0200, Ingo Molnar wrote: > When the system call is extended in the future on the kernel side, with 'u64 > param_4', then the structure expands from an old size of 24 to a new size of > 32 > bytes. The following scenarios might occur: > > - the common case:

Re: [PATCHv2 1/1] Documentation: describe how to add a system call

2015-07-30 Thread Kees Cook
On Thu, Jul 30, 2015 at 4:10 AM, David Drysdale wrote: > On Thu, Jul 30, 2015 at 9:38 AM, Ingo Molnar wrote: >> >> * David Drysdale wrote: >> >>> +Designing the API >>> +- >>> + >>> +A new system call forms part of the API of the kernel, and has to be >>> supported >>>

Re: [PATCHv2 1/1] Documentation: describe how to add a system call

2015-07-30 Thread Greg Kroah-Hartman
On Thu, Jul 30, 2015 at 06:30:07PM +0200, Cyril Hrubis wrote: > Hi! > > +Testing > > +--- > > + > > +A new system call should obviously be tested; it is also useful to provide > > +reviewers with a demonstration of how user space programs will use the > > system > > +call. A good way to

Re: [PATCHv2 1/1] Documentation: describe how to add a system call

2015-07-30 Thread Cyril Hrubis
Hi! > +Testing > +--- > + > +A new system call should obviously be tested; it is also useful to provide > +reviewers with a demonstration of how user space programs will use the system > +call. A good way to combine these aims is to include a simple self-test > +program in a new directory

Re: [PATCHv2 1/1] Documentation: describe how to add a system call

2015-07-30 Thread David Drysdale
On Thu, Jul 30, 2015 at 9:38 AM, Ingo Molnar wrote: > > * David Drysdale wrote: > >> +Designing the API >> +- >> + >> +A new system call forms part of the API of the kernel, and has to be >> supported >> +indefinitely. As such, it's a very good idea to explicitly discuss the >>

Re: [PATCHv2 1/1] Documentation: describe how to add a system call

2015-07-30 Thread Ingo Molnar
* David Drysdale wrote: > +Designing the API > +- > + > +A new system call forms part of the API of the kernel, and has to be > supported > +indefinitely. As such, it's a very good idea to explicitly discuss the > +interface on the kernel mailing list, and to plan for future

[PATCHv2 1/1] Documentation: describe how to add a system call

2015-07-30 Thread David Drysdale
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

Re: [PATCHv2 1/1] Documentation: describe how to add a system call

2015-07-30 Thread Kees Cook
On Thu, Jul 30, 2015 at 12:04 PM, Josh Triplett j...@joshtriplett.org wrote: On Thu, Jul 30, 2015 at 11:21:54AM -0700, Kees Cook wrote: I like this, it's a good description of both options. I'm still biased about the approach: I prefer flags, since pointers to user structures complicate

Re: [PATCHv2 1/1] Documentation: describe how to add a system call

2015-07-30 Thread Josh Triplett
On Thu, Jul 30, 2015 at 01:03:43PM -0700, Kees Cook wrote: On Thu, Jul 30, 2015 at 12:04 PM, Josh Triplett j...@joshtriplett.org wrote: On Thu, Jul 30, 2015 at 11:21:54AM -0700, Kees Cook wrote: I like this, it's a good description of both options. I'm still biased about the approach: I

Re: [PATCHv2 1/1] Documentation: describe how to add a system call

2015-07-30 Thread Josh Triplett
On Thu, Jul 30, 2015 at 06:02:34PM -0700, Josh Triplett wrote: On Thu, Jul 30, 2015 at 01:03:43PM -0700, Kees Cook wrote: On Thu, Jul 30, 2015 at 12:04 PM, Josh Triplett j...@joshtriplett.org wrote: On Thu, Jul 30, 2015 at 11:21:54AM -0700, Kees Cook wrote: I like this, it's a good

Re: [PATCHv2 1/1] Documentation: describe how to add a system call

2015-07-30 Thread Josh Triplett
On Thu, Jul 30, 2015 at 11:21:54AM -0700, Kees Cook wrote: I like this, it's a good description of both options. I'm still biased about the approach: I prefer flags, since pointers to user structures complicate syscall filtering. ;) Seems like we should do two things to make that easier: 1)

[PATCHv2 1/1] Documentation: describe how to add a system call

2015-07-30 Thread David Drysdale
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 drysd...@google.com Reviewed-by: Michael Kerrisk

Re: [PATCHv2 1/1] Documentation: describe how to add a system call

2015-07-30 Thread Ingo Molnar
* David Drysdale drysd...@google.com wrote: +Designing the API +- + +A new system call forms part of the API of the kernel, and has to be supported +indefinitely. As such, it's a very good idea to explicitly discuss the +interface on the kernel mailing list, and to plan

Re: [PATCHv2 1/1] Documentation: describe how to add a system call

2015-07-30 Thread Kees Cook
On Thu, Jul 30, 2015 at 4:10 AM, David Drysdale drysd...@google.com wrote: On Thu, Jul 30, 2015 at 9:38 AM, Ingo Molnar mi...@kernel.org wrote: * David Drysdale drysd...@google.com wrote: +Designing the API +- + +A new system call forms part of the API of the kernel, and

Re: [PATCHv2 1/1] Documentation: describe how to add a system call

2015-07-30 Thread Josh Triplett
On Thu, Jul 30, 2015 at 10:38:31AM +0200, Ingo Molnar wrote: When the system call is extended in the future on the kernel side, with 'u64 param_4', then the structure expands from an old size of 24 to a new size of 32 bytes. The following scenarios might occur: - the common case: new

Re: [PATCHv2 1/1] Documentation: describe how to add a system call

2015-07-30 Thread Greg Kroah-Hartman
On Thu, Jul 30, 2015 at 06:30:07PM +0200, Cyril Hrubis wrote: Hi! +Testing +--- + +A new system call should obviously be tested; it is also useful to provide +reviewers with a demonstration of how user space programs will use the system +call. A good way to combine these aims

Re: [PATCHv2 1/1] Documentation: describe how to add a system call

2015-07-30 Thread Cyril Hrubis
Hi! +Testing +--- + +A new system call should obviously be tested; it is also useful to provide +reviewers with a demonstration of how user space programs will use the system +call. A good way to combine these aims is to include a simple self-test +program in a new directory under

Re: [PATCHv2 1/1] Documentation: describe how to add a system call

2015-07-30 Thread Josh Triplett
On Thu, Jul 30, 2015 at 08:52:11AM +0100, David Drysdale wrote: 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

Re: [PATCHv2 1/1] Documentation: describe how to add a system call

2015-07-30 Thread David Drysdale
On Thu, Jul 30, 2015 at 9:38 AM, Ingo Molnar mi...@kernel.org wrote: * David Drysdale drysd...@google.com wrote: +Designing the API +- + +A new system call forms part of the API of the kernel, and has to be supported +indefinitely. As such, it's a very good idea to