lkml.org 
[lkml]   [2012]   [Nov]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH v1 30/31] ARC: switch to generic kernel_execve() and sys_execve()
On Wed, Nov 07, 2012 at 10:47:53AM +0100, Vineet Gupta wrote:
> +; When we land here, pt_regs have already been updated in-place correctly
> +; A pointer to them is also passed by kernel_execve, we just need to make sure
> +; that SP is set to point to them.
> +ARC_ENTRY ret_from_kernel_execve
> + ; Force SP to "normal" pt_regs just populated.
> + b.d ret_from_system_call
> + mov sp, r0

won't that splatter crap into regs->r0? IOW, why not branch to
ret_from_exception here?

> +ARC_EXIT ret_from_kernel_execve

Another thing: why not fold that branch to ret_from_exception into the end of
ret_from_kernel_thread() (instead of calling sys_exit()), select
GENERIC_KERNEL_EXECVE and lose __ARCH_WANT_KERNEL_EXECVE.

Actually, now that I look at your ret_from_kernel_thread... How the hell
will it cope with kernel_thread() payload trying to return? AFAICS, this
j.d [r1] will lose the return address, won't it? And while we are at it,
I would suggest passing callback and its argument via callee-saved registers -
makes for simpler life in ret_from_kernel_thread(), since switch_to() itself
will take care of loading those...


\
 
 \ /
  Last update: 2012-11-16 05:41    [W:0.175 / U:0.772 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site