Re: [PATCH v2 00/44] Meta Linux Kernel Port

2012-12-18 Thread James Hogan
On 05/12/12 18:39, Al Viro wrote:
> On Wed, Dec 05, 2012 at 05:11:32PM +, Al Viro wrote:
>> On Wed, Dec 05, 2012 at 04:08:18PM +, James Hogan wrote:
>>
>>> other work not included:
>>> * switch to generic kernel_{thread,execve} (will be posted separately to
>>>   aid review)
>>
>>> other changes:
>> ...
>>> * switch to generic sys_execve
>>
>> ... which should've broken your kernel_execve().
> 
> BTW, one general note: lose the magical 7th argument.  In the few syscalls
> that do need pt_regs, you can bloody well use current_pt_regs() instead;
> it's what, (register & constant) + constant?  Passing it as explicit
> argument is saving at most two arithmetical insns on those syscalls.
> Moreover, for fork/clone/vfork we really don't need it until copy_thread();
> one of the changes in -next kills passing pt_regs * to do_fork() and through
> all that call chain (furthermore, if you make that
>   childregs->ctx.AX[0].U0 = ALIGN(usp, 8);
> in copy_thread() conditional on usp != 0, you can go with generic
> variants from kernel/fork.c; again, see linux-next for examples of that).
> What's left?  sigreturn and sigaltstack?
> 
> Seriously, drop that struct pt_regs *; it makes things uglier, (slightly)
> hurts the syscall overhead and doesn't help the few syscalls that even
> look at that argument.
> 

Done (with generic clone), thanks for pointing out the linux-next
changes. I'll base the next patchset on -next.

Thanks for all the review comments so far, they're much appreciated.

Cheers
James

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2 00/44] Meta Linux Kernel Port

2012-12-18 Thread James Hogan
On 05/12/12 18:39, Al Viro wrote:
 On Wed, Dec 05, 2012 at 05:11:32PM +, Al Viro wrote:
 On Wed, Dec 05, 2012 at 04:08:18PM +, James Hogan wrote:

 other work not included:
 * switch to generic kernel_{thread,execve} (will be posted separately to
   aid review)

 other changes:
 ...
 * switch to generic sys_execve

 ... which should've broken your kernel_execve().
 
 BTW, one general note: lose the magical 7th argument.  In the few syscalls
 that do need pt_regs, you can bloody well use current_pt_regs() instead;
 it's what, (register  constant) + constant?  Passing it as explicit
 argument is saving at most two arithmetical insns on those syscalls.
 Moreover, for fork/clone/vfork we really don't need it until copy_thread();
 one of the changes in -next kills passing pt_regs * to do_fork() and through
 all that call chain (furthermore, if you make that
   childregs-ctx.AX[0].U0 = ALIGN(usp, 8);
 in copy_thread() conditional on usp != 0, you can go with generic
 variants from kernel/fork.c; again, see linux-next for examples of that).
 What's left?  sigreturn and sigaltstack?
 
 Seriously, drop that struct pt_regs *; it makes things uglier, (slightly)
 hurts the syscall overhead and doesn't help the few syscalls that even
 look at that argument.
 

Done (with generic clone), thanks for pointing out the linux-next
changes. I'll base the next patchset on -next.

Thanks for all the review comments so far, they're much appreciated.

Cheers
James

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2 00/44] Meta Linux Kernel Port

2012-12-06 Thread James Hogan
On 05/12/12 17:11, Al Viro wrote:
> On Wed, Dec 05, 2012 at 04:08:18PM +, James Hogan wrote:
> 
>> other work not included:
>> * switch to generic kernel_{thread,execve} (will be posted separately to
>>   aid review)
> 
>> other changes:
> ...
>> * switch to generic sys_execve
> 
> ... which should've broken your kernel_execve().
> 

Hi Al,

Yes, you're right. I should have taken more care separating that patch
out. Sorry about that.

Cheers
James

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2 00/44] Meta Linux Kernel Port

2012-12-06 Thread James Hogan
On 05/12/12 17:11, Al Viro wrote:
 On Wed, Dec 05, 2012 at 04:08:18PM +, James Hogan wrote:
 
 other work not included:
 * switch to generic kernel_{thread,execve} (will be posted separately to
   aid review)
 
 other changes:
 ...
 * switch to generic sys_execve
 
 ... which should've broken your kernel_execve().
 

Hi Al,

Yes, you're right. I should have taken more care separating that patch
out. Sorry about that.

Cheers
James

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2 00/44] Meta Linux Kernel Port

2012-12-05 Thread Al Viro
On Wed, Dec 05, 2012 at 05:11:32PM +, Al Viro wrote:
> On Wed, Dec 05, 2012 at 04:08:18PM +, James Hogan wrote:
> 
> > other work not included:
> > * switch to generic kernel_{thread,execve} (will be posted separately to
> >   aid review)
> 
> > other changes:
> ...
> > * switch to generic sys_execve
> 
> ... which should've broken your kernel_execve().

BTW, one general note: lose the magical 7th argument.  In the few syscalls
that do need pt_regs, you can bloody well use current_pt_regs() instead;
it's what, (register & constant) + constant?  Passing it as explicit
argument is saving at most two arithmetical insns on those syscalls.
Moreover, for fork/clone/vfork we really don't need it until copy_thread();
one of the changes in -next kills passing pt_regs * to do_fork() and through
all that call chain (furthermore, if you make that
childregs->ctx.AX[0].U0 = ALIGN(usp, 8);
in copy_thread() conditional on usp != 0, you can go with generic
variants from kernel/fork.c; again, see linux-next for examples of that).
What's left?  sigreturn and sigaltstack?

Seriously, drop that struct pt_regs *; it makes things uglier, (slightly)
hurts the syscall overhead and doesn't help the few syscalls that even
look at that argument.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2 00/44] Meta Linux Kernel Port

2012-12-05 Thread Al Viro
On Wed, Dec 05, 2012 at 04:08:18PM +, James Hogan wrote:

> other work not included:
> * switch to generic kernel_{thread,execve} (will be posted separately to
>   aid review)

> other changes:
...
> * switch to generic sys_execve

... which should've broken your kernel_execve().
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2 00/44] Meta Linux Kernel Port

2012-12-05 Thread Al Viro
On Wed, Dec 05, 2012 at 04:08:18PM +, James Hogan wrote:

 other work not included:
 * switch to generic kernel_{thread,execve} (will be posted separately to
   aid review)

 other changes:
...
 * switch to generic sys_execve

... which should've broken your kernel_execve().
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2 00/44] Meta Linux Kernel Port

2012-12-05 Thread Al Viro
On Wed, Dec 05, 2012 at 05:11:32PM +, Al Viro wrote:
 On Wed, Dec 05, 2012 at 04:08:18PM +, James Hogan wrote:
 
  other work not included:
  * switch to generic kernel_{thread,execve} (will be posted separately to
aid review)
 
  other changes:
 ...
  * switch to generic sys_execve
 
 ... which should've broken your kernel_execve().

BTW, one general note: lose the magical 7th argument.  In the few syscalls
that do need pt_regs, you can bloody well use current_pt_regs() instead;
it's what, (register  constant) + constant?  Passing it as explicit
argument is saving at most two arithmetical insns on those syscalls.
Moreover, for fork/clone/vfork we really don't need it until copy_thread();
one of the changes in -next kills passing pt_regs * to do_fork() and through
all that call chain (furthermore, if you make that
childregs-ctx.AX[0].U0 = ALIGN(usp, 8);
in copy_thread() conditional on usp != 0, you can go with generic
variants from kernel/fork.c; again, see linux-next for examples of that).
What's left?  sigreturn and sigaltstack?

Seriously, drop that struct pt_regs *; it makes things uglier, (slightly)
hurts the syscall overhead and doesn't help the few syscalls that even
look at that argument.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/