[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <49937766.4070102@gmail.com>
Date: Thu, 12 Feb 2009 10:12:06 +0900
From: Tejun Heo <htejun@...il.com>
To: Ingo Molnar <mingo@...e.hu>
CC: Brian Gerst <brgerst@...il.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/3] x86: Pass in pt_regs pointer for syscalls that need
it
Ingo Molnar wrote:
> * Tejun Heo <htejun@...il.com> wrote:
>
>> Brian Gerst wrote:
>>> x86-64 doesn't have the tail-call problem because it doesn't use the
>>> pt_regs on stack trick for syscall args. All the args are passed in
>>> registers.
>> Yeah, I was saying that we can do about the same thing on x86_32 by
>> passing in pointer to pt_regs and defining proper syscall wrappers.
>> It will cost a bit of performance by increasing register pressure tho.
>
> Do you mean converting:
>
> ptregscall int sys_execve(struct pt_regs *regs, char __user *u_filename,
> char __user * __user *argv,
> char __user * __user *envp)
>
> to:
>
> ptregscall int sys_execve(struct pt_regs *regs)
> {
> char __user *u_filename = syscall_arg1(regs);
> char __user * __user *argv = syscall_arg2(regs);
> char __user * __user *envp = syscall_arg3(regs);
>
> etc.?
Not exactly. include/linux/syscalls.h already has syscall wrapping
macros defined, with slight modification to allow archs to define its
own __SC_DECL and __SC_LONG (probably should use different name tho),
the outer function can be easily defined to take pt_regs pointer and
pass in the correct argument to the actual implementation function.
The only added overhead would be pt_regs pointer having to be loaded
into %edi and it having to stay somewhere in the callee till the last
parameter access.
Thanks.
--
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists