All of lore.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Jonas Bonn <jonas@southpole.se>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] openrisc: determine regs directly in copy_thread
Date: Thu, 25 Oct 2012 17:27:35 +0100	[thread overview]
Message-ID: <20121025162735.GM2616@ZenIV.linux.org.uk> (raw)
In-Reply-To: <1351179999-8376-3-git-send-email-jonas@southpole.se>

On Thu, Oct 25, 2012 at 05:46:39PM +0200, Jonas Bonn wrote:
> copy_thread can use current_pt_regs() to get the pt_regs data that
> it needs so there's no need to pass this in as an argument.
> 
> As do_fork() doesn't use the regs argument for anything other than
> to pass it straight through to copy_thread, we just pass in a NULL
> argument in its place.  The plan seems to be to eventually drop the
> regs argument to do_fork altogether.

Hmm...  That's the plan, all right, but we need one more thing before
it's safe to pass NULL here.
        if (!(clone_flags & CLONE_UNTRACED) && likely(user_mode(regs))) {
in do_fork() should (and can right now, no prereqs for that one) become
simply
        if (!(clone_flags & CLONE_UNTRACED)) {
kernel_thread() *always* passes CLONE_UNTRACED, so it's not just "likely",
it's "always true if we get to evaluating that sucker in the first place".

FWIW, I think that merging that into mainline would be a good idea -
it would make life simpler and it's obviously safe.  Another thing I probably
want to push to Linus, for pretty much the same reasons: generic variants
of fork/vfork/clone, selected by matching __ARCH_WANT_SYS_...; obviously
safe and allows to do that unification in per-arch trees.  Less PITA
regarding the merge ordering that way...

      reply	other threads:[~2012-10-25 16:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-25 15:46 [PATCH 0/2] openrisc: more kernel_thread cleanup Jonas Bonn
2012-10-25 15:46 ` [PATCH 1/2] openrisc: move sys_clone's stack determination to copy_thread Jonas Bonn
2012-10-25 15:55   ` Al Viro
2012-10-25 16:16     ` Jonas Bonn
2012-10-25 15:46 ` [PATCH 2/2] openrisc: determine regs directly in copy_thread Jonas Bonn
2012-10-25 16:27   ` Al Viro [this message]

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=20121025162735.GM2616@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=jonas@southpole.se \
    --cc=linux-kernel@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.