From: Michal Simek <monstr@monstr.eu>
To: LKML <linux-kernel@vger.kernel.org>
Cc: John Williams <john.williams@petalogix.com>,
Arnd Bergmann <arnd@arndb.de>,
Grant Likely <grant.likely@secretlab.ca>,
Ingo Molnar <mingo@elte.hu>,
Andrew Morton <akpm@linux-foundation.org>,
Tejun Heo <tj@kernel.org>, Oleg Nesterov <oleg@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
John Linn <John.Linn@xilinx.com>
Subject: microblaze: clone syscall: Potentially ABI breaking by passing parent/child_tidptr - old glibc 2.3.6.
Date: Thu, 15 Mar 2012 15:59:21 +0100 [thread overview]
Message-ID: <4F6203C9.3010608@monstr.eu> (raw)
Hi All,
We have updated our toolchain to the latest & greatest based on an eglibc with ntpl for microblaze.
And I would like to check one thing with you to be sure that we don't break ABI compatibility.
In current kernel code (without ntpl), kernel sys_clone wrapper(in entry.S) clears 2 arguments (or setup them to NULL)
which is parent_tidptr and child_tidptr.
Obviously we have to use these two parameters to get things to work on eglibc that's why I have to remove
that clearing.
I have looked at the kernel code(fork.c and core.c files) and I haven't found any reason why
passing parent_tidptr and child_tidptr from glibc and not to clearing them in the kernel should break
old glibc toolchain and break ABI.
For old glibc if clone_flags is setup to (CLONE_PARENT_SETTID | CLONE_CHILD_CLEARTID | CLONE_CHILD_SETTID)
to get parent/child_tidptr use in the kernel (but both are NULL).
From code I have seen it always ends with unsuccessful attempt to return value back to user space
because kernel ignores return values from put_user macros (It also means that put_user fails
because pointer is NULL).
For new case(with passing parent/child_tidptr) from old glibc, kernel will just do what it is expected
to do which is setup/clear proper values to provided pointers.
Also from man page if I compare both cases (with setup pointers to NULL and passing them from glibc)
kernel will setup/clear thread ID to proper location prepared by glibc.
My point is if there is any option if we start to pass parent/child_tidptr for old glibc that it will
break anything.
Can you correct my understanding?
Thanks,
Michal
--
Michal Simek, Ing. (M.Eng)
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel 2.6 Microblaze Linux - http://www.monstr.eu/fdt/
Microblaze U-BOOT custodian
reply other threads:[~2012-03-15 14:59 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=4F6203C9.3010608@monstr.eu \
--to=monstr@monstr.eu \
--cc=John.Linn@xilinx.com \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=grant.likely@secretlab.ca \
--cc=john.williams@petalogix.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=oleg@redhat.com \
--cc=peterz@infradead.org \
--cc=tj@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.