From: Yoshinori Sato <ysato@users.sourceforge.jp>
To: Rich Felker <dalias@libc.org>
Cc: musl@lists.openwall.com, "D. Jeff Dionne" <Jeff@uClinux.org>,
shumpei.kawasaki@swhwc.com
Subject: Re: Moving forward with sh2/nommu
Date: Fri, 12 Jun 2015 13:26:55 +0900 [thread overview]
Message-ID: <87mw055z74.wl-ysato@users.sourceforge.jp> (raw)
In-Reply-To: <20150611172227.GY17573@brightrain.aerifal.cx>
On Fri, 12 Jun 2015 02:22:27 +0900,
Rich Felker wrote:
>
> On Thu, Jun 11, 2015 at 11:12:52AM -0400, Rich Felker wrote:
> > > >> 3. We need sh/vfork.s since the default vfork.c just uses fork, which
> > > >> won't work. I have a version locally but it doesn't make sense to
> > > >> commit without runtime trap number selection.
> > > >
> > > > Done and updated to use runtime selection in the (ugly) patch.
> > >
> > > If they ask for vfork() they should get vfork()...?
> >
> > Yes. The "runtime selection" is about the syscall trap number, not
> > whether or not to use vfork. I committed vfork to upstream musl now,
> > but with a SH3/4 trap number to be consistent with the code that's
> > upstream now. Later I'll either convert them all to trap 31 (0x1f) if
> > that ends up being acceptable, or merge the runtime-selection code,
> > but I think it makes sense to make the change across all files at
> > once, whichever way it's done.
>
> Ah, maybe I misunderstood. If you were asking abaout the original
> remark that the default vfork.c uses fork, the reason is simply that
> you can't write vfork() in C. The return from vfork() in the child
> will clobber vfork's stack frame, which may contain the return address
> or saved registers, and then when the parent resumes, very bad things
> will happen. vfork() has to be implemented in asm to ensure that any
> state it needs to be able to return in the parent is kept in registers
> rather than memory. Thus, each arch needs an arch-specific version,
> and we just hadn't gotten around to adding the sh version yet.
>
> Rich
No. vfork kept only last return address.
It isn't necessary to preserve the value of anything but that.
Child process can't return caller routine.
--
Yoshinori Sato
<ysato@users.sourceforge.jp>
next prev parent reply other threads:[~2015-06-12 4:26 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-01 15:11 Rich Felker
2015-06-02 6:09 ` Rob Landley
2015-06-02 16:45 ` Rich Felker
2015-06-02 23:49 ` Rich Felker
2015-06-10 3:30 ` Rich Felker
2015-06-11 4:02 ` Rob Landley
2015-06-11 15:12 ` Rich Felker
2015-06-11 17:22 ` Rich Felker
2015-06-12 4:26 ` Yoshinori Sato [this message]
2015-06-12 4:35 ` Rich Felker
2015-06-12 4:49 ` uClinux.org
2015-06-12 6:37 ` Rich Felker
2015-06-12 6:46 ` D. Jeff Dionne
2015-06-12 4:08 ` Yoshinori Sato
2015-06-12 4:28 ` Rich Felker
2015-06-16 6:38 ` Yoshinori Sato
2015-06-16 7:02 ` Rich Felker
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=87mw055z74.wl-ysato@users.sourceforge.jp \
--to=ysato@users.sourceforge.jp \
--cc=Jeff@uClinux.org \
--cc=dalias@libc.org \
--cc=musl@lists.openwall.com \
--cc=shumpei.kawasaki@swhwc.com \
/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.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).