From: Jessica Clarke <jrtc27@jrtc27.com>
To: Ludwig Rydberg <ludwig.rydberg@gaisler.com>
Cc: davem@davemloft.net, andreas@gaisler.com, brauner@kernel.org,
shuah@kernel.org, sparclinux@vger.kernel.org,
linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
arnd@arndb.de, glaubitz@physik.fu-berlin.de,
geert@linux-m68k.org, schuster.simon@siemens-energy.com
Subject: Re: [PATCH 2/3] sparc: Add architecture support for clone3
Date: Fri, 16 Jan 2026 16:47:14 +0000 [thread overview]
Message-ID: <aWprkg0fRoYQl5DP@Jessicas-MacBook-Pro> (raw)
In-Reply-To: <20260116153051.21678-3-ludwig.rydberg@gaisler.com>
On Fri, Jan 16, 2026 at 04:30:50PM +0100, Ludwig Rydberg wrote:
> Add support for the clone3 system call to the SPARC architectures.
>
> The implementation follows the pattern of the original clone syscall.
> However, instead of explicitly calling kernel_clone, the clone3
> handler calls the generic sys_clone3 handler in kernel/fork.
> In case no stack is provided, the parents stack is reused.
>
> The return call conventions for clone on SPARC are kept for clone3:
> Parent --> %o0 == child's pid, %o1 == 0
> Child --> %o0 == parent's pid, %o1 == 1
One of the benefits of having a new clone3 is that the interface can be
made the same across all architectures*, unlike clone, which both passes
the arguments in different orders for different architectures and, in
the case of SPARC, has this weird return convention inherited from the
SunOS syscall interface. Is there a good reason to deviate for clone3
too and keep this annoying oddity going, that requires special-casing
SPARC when other architectures can just syscall(__NR_clone3, ...)?
Jessica
* Even Itanium's clone2 could have been subsumed by it, as clone3 passes
the stack base and size rather than the desired stack pointer
next prev parent reply other threads:[~2026-01-16 16:47 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-16 15:30 [PATCH 0/3] " Ludwig Rydberg
2026-01-16 15:30 ` [PATCH 1/3] sparc: Synchronize user stack on fork and clone Ludwig Rydberg
2026-01-16 17:17 ` John Paul Adrian Glaubitz
2026-01-17 6:57 ` John Paul Adrian Glaubitz
2026-01-17 7:00 ` John Paul Adrian Glaubitz
2026-01-19 13:05 ` Ludwig Rydberg
2026-01-20 7:57 ` John Paul Adrian Glaubitz
2026-01-17 12:18 ` Michael Karcher
2026-01-16 15:30 ` [PATCH 2/3] sparc: Add architecture support for clone3 Ludwig Rydberg
2026-01-16 16:47 ` Jessica Clarke [this message]
2026-01-17 21:23 ` John Paul Adrian Glaubitz
2026-01-18 14:39 ` John Paul Adrian Glaubitz
2026-01-19 12:39 ` Ludwig Rydberg
2026-01-16 17:19 ` John Paul Adrian Glaubitz
2026-01-16 15:30 ` [PATCH 3/3] selftests/clone3: Add sys_clone3 wrapper for SPARC Ludwig Rydberg
2026-01-16 15:44 ` [PATCH 0/3] sparc: Add architecture support for clone3 John Paul Adrian Glaubitz
2026-01-16 16:26 ` John Paul Adrian Glaubitz
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=aWprkg0fRoYQl5DP@Jessicas-MacBook-Pro \
--to=jrtc27@jrtc27.com \
--cc=andreas@gaisler.com \
--cc=arnd@arndb.de \
--cc=brauner@kernel.org \
--cc=davem@davemloft.net \
--cc=geert@linux-m68k.org \
--cc=glaubitz@physik.fu-berlin.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=ludwig.rydberg@gaisler.com \
--cc=schuster.simon@siemens-energy.com \
--cc=shuah@kernel.org \
--cc=sparclinux@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®