From: Al Viro <viro@ZenIV.linux.org.uk>
To: Chris Zankel <chris@zankel.net>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
linux-kernel@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [GIT PULL] xtensa patchset for 3.7
Date: Thu, 4 Oct 2012 00:48:09 +0100 [thread overview]
Message-ID: <20121003234809.GG23473@ZenIV.linux.org.uk> (raw)
In-Reply-To: <506CBAFC.8010908@zankel.net>
On Wed, Oct 03, 2012 at 03:23:56PM -0700, Chris Zankel wrote:
> Hi Linus,
>
> Please pull the changes for the Xtensa architecture for v3.7.
>
> Thanks,
> -Chris
BTW, could you do an xtensa counterpart of the stuff in
git.kernel.org/pub/scm/linux/kernel/git/viro/signal#experimental-kernel_thread?
Basically,
* switch kernel_thread() away from "syscall in kernel" model;
select GENERIC_KERNEL_THREAD in Kconfig and have copy_thread() check
p->flags & PF_KTHREAD instead of user_mode(regs). If it's true, set the
child up so that it would wake up not in ret_from_fork() but in
ret_from_kernel_thread(), the latter being
schedule_tail(last);
fn(arg);
sys_exit(0);
where fn and arg would be picked from something set by copy_thread() - either
pt_regs or callee-saved registers if your switch_to() deals with those (in
the latter case you'll obviously have then already in place by the time your
newborn kernel thread wakes up). Have the same value for kernel stack pointer
regardless of user_mode. Use 'usp' for fn, 'unused' for arg and expect regs
to be NULL. Kill kernel_thread() in entry.S.
* add ret_from_kernel_execve() that would simply set sp to value
normal for common_exception_return (i.e. what you used to set it when
going into ret_from_kernel_thread()/ret_from_fork()) and branch to said
common_exception_return(). Define __ARCH_WANT_KERNEL_EXECVE in unistd.h
and kill kernel_execve() in entry.S. ret_from_kernel_execve() will get as
its argument task_pt_regs(current), which often spares us some calculations.
* define __ARCH_WANT_SYS_EXECVE in unistd.h, kill xtensa_execve();
just use sys_execve instead.
* as an optimization, define current_pt_regs() as
(struct pt_regs *)((unsigned long)current_thread_info() +
KERNEL_STACK_SIZE - (XCHAL_NUM_AREGS-16)*4) - 1). I.e. an equivalent of
task_pt_regs(current) without useless work - task_stack_page(current) is
expanded to task_stack_page(current_thread_info()->task), which is
equal to current_thread_info()...
That would probably allow more glue removal - no more syscalls from the
kernel, for one thing. For another, xtensa_clone() won't need to locate
struct pt_regs * - current_pt_regs() would work just as well and be faster
anyway. The same goes for xtensa_rt_sigreturn() and xtensa_sigaltstack()...
next prev parent reply other threads:[~2012-10-03 23:48 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-03 22:23 [GIT PULL] xtensa patchset for 3.7 Chris Zankel
2012-10-03 22:41 ` Linus Torvalds
2012-10-03 22:59 ` Chris Zankel
2012-10-03 23:07 ` Linus Torvalds
2012-10-03 23:12 ` Randy Dunlap
2012-10-09 4:31 ` Chris Zankel
2012-10-03 23:48 ` Al Viro [this message]
2012-10-04 0:07 ` Max Filippov
2012-10-04 18:45 ` Geert Uytterhoeven
2012-10-04 19:21 ` Chris Zankel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20121003234809.GG23473@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=akpm@linux-foundation.org \
--cc=chris@zankel.net \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox