From: Zhangjin Wu <falcon@tinylab.org>
To: w@1wt.eu
Cc: ammarfaizi2@gnuweeb.org, arnd@arndb.de, falcon@tinylab.org,
linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
svens@linux.ibm.com, thomas@t-8ch.de
Subject: Re: [PATCH v1 1/8] tools/nolibc: add support for powerpc
Date: Wed, 26 Jul 2023 04:52:02 +0800 [thread overview]
Message-ID: <20230725205202.36788-1-falcon@tinylab.org> (raw)
In-Reply-To: <20230725182736.GA24943@1wt.eu>
Hi Willy,
> On Tue, Jul 25, 2023 at 07:02:55PM +0800, Zhangjin Wu wrote:
> > > > With this new syscall.h, to support my_syscall<N>, the arch-<ARCH>.h
> > > > will only require to add ~10 lines to define their own syscall
> > > > instructions, registers and clobberlist, which looks like this (for
> > > > powerpc):
> > > >
> > > > #define _NOLIBC_SYSCALL_CALL "sc; bns+ 1f; neg %0, %0; 1:"
> > > >
> > > > /* PowerPC doesn't always restore r3-r12 for us */
> > > > #define _NOLIBC_SYSCALL_CLOBBERLIST
> > > > "memory", "cr0", "r12", "r11", "r10", "r9", "r8", "r7", "r6", "r5", "r4"
> > > >
> > > > /* PowerPC write GPRS in kernel side but not restore them */
> > > > #define _NOLIBC_GPRS_AS_OUTPUT_OPERANDS
> > > >
> > > > #define _NOLIBC_REG_NUM "r0"
> > > > #define _NOLIBC_REG_RET "r3"
> > > > #define _NOLIBC_REG_arg1 "r3"
> > > > #define _NOLIBC_REG_arg2 "r4"
> > > > #define _NOLIBC_REG_arg3 "r5"
> > > > #define _NOLIBC_REG_arg4 "r6"
> > > > #define _NOLIBC_REG_arg5 "r7"
> > > > #define _NOLIBC_REG_arg6 "r8"
> > > >
> > > > Before:
> > > >
> > > > $ ls tools/include/nolibc/arch-*.h | while read f; do git show dfef4fc45d5713eb23d87f0863aff9c33bd4bfaf:$f 2>/dev/null | wc -l | tr -d '\n'; echo " $f"; done
> > > > 157 tools/include/nolibc/arch-aarch64.h
> > > > 199 tools/include/nolibc/arch-arm.h
> > > > 178 tools/include/nolibc/arch-i386.h
> > > > 164 tools/include/nolibc/arch-loongarch.h
> > > > 195 tools/include/nolibc/arch-mips.h
> > > > 0 tools/include/nolibc/arch-powerpc.h
> > > > 160 tools/include/nolibc/arch-riscv.h
> > > > 186 tools/include/nolibc/arch-s390.h
> > > > 176 tools/include/nolibc/arch-x86_64.h
> > > >
> > > > After:
> > > >
> > > > $ wc -l tools/include/nolibc/arch-*.h
> > > > 54 tools/include/nolibc/arch-aarch64.h
> > > > 84 tools/include/nolibc/arch-arm.h
> > > > 90 tools/include/nolibc/arch-i386.h /* the last one use stack to pass arguments, reserve as-is */
> > > > 59 tools/include/nolibc/arch-loongarch.h
> > > > 120 tools/include/nolibc/arch-mips.h /* the last two use stack to pass arguments, reserve as-is */
> > > > 73 tools/include/nolibc/arch-powerpc.h
> > > > 58 tools/include/nolibc/arch-riscv.h
> > > > 87 tools/include/nolibc/arch-s390.h
> > > > 67 tools/include/nolibc/arch-x86_64.h
> > > >
> > > > syscall.h itself:
> > > >
> > > > $ wc -l tools/include/nolibc/syscall.h
> > > > 112 tools/include/nolibc/syscall.h
> > >
>
> [...]
>
> Hoping this clarifies my position on this.
>
Willy, Thanks very much for your detailed reply, based on your reply, I
plan to renew the powerpc patchset itself at first since both you and
Thomas have already reviewed it carefully.
After that, I will come back to read your reply again and discuss more
about our new syscall.h, I still think it is something valuable to take
a look at, although something about it still need more attention,
perhaps a RFC patchset is better for more discuss, it may show us the
profile easily.
Best regards,
Zhangjin
> Thanks,
> Willy
next prev parent reply other threads:[~2023-07-25 20:52 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-18 21:09 [PATCH v1 0/8] tools/nolibc: add 32/64-bit powerpc support Zhangjin Wu
2023-07-18 21:10 ` [PATCH v1 1/8] tools/nolibc: add support for powerpc Zhangjin Wu
2023-07-23 7:32 ` Thomas Weißschuh
2023-07-23 8:15 ` Willy Tarreau
2023-07-25 5:44 ` Zhangjin Wu
2023-07-25 6:29 ` Willy Tarreau
2023-07-25 11:02 ` Zhangjin Wu
2023-07-25 14:45 ` Ammar Faizi
2023-07-25 17:04 ` Zhangjin Wu
2023-07-25 18:23 ` Ammar Faizi
2023-07-25 20:23 ` Zhangjin Wu
2023-07-25 18:27 ` Willy Tarreau
2023-07-25 20:52 ` Zhangjin Wu [this message]
2023-07-25 6:14 ` Zhangjin Wu
2023-07-18 21:11 ` [PATCH v1 2/8] tools/nolibc: add support for powerpc64 Zhangjin Wu
2023-07-18 21:13 ` [PATCH v1 3/8] selftests/nolibc: select_null: fix up for big endian powerpc64 Zhangjin Wu
2023-07-18 22:17 ` Thomas Weißschuh
2023-07-18 23:56 ` Zhangjin Wu
2023-07-19 4:33 ` Willy Tarreau
2023-07-19 6:49 ` Zhangjin Wu
2023-07-19 20:25 ` Willy Tarreau
2023-07-20 6:11 ` Thomas Weißschuh
2023-07-18 21:14 ` [PATCH v1 4/8] selftests/nolibc: add extra config file customize support Zhangjin Wu
2023-07-22 12:00 ` Willy Tarreau
2023-07-25 14:30 ` Zhangjin Wu
2023-07-29 7:45 ` Willy Tarreau
2023-07-29 9:43 ` Zhangjin Wu
2023-07-18 21:15 ` [PATCH v1 5/8] selftests/nolibc: add XARCH and ARCH mapping support Zhangjin Wu
2023-07-22 12:03 ` Willy Tarreau
2023-07-18 21:16 ` [PATCH v1 6/8] selftests/nolibc: add test support for powerpc Zhangjin Wu
2023-07-18 21:17 ` [PATCH v1 7/8] selftests/nolibc: add test support for powerpc64le Zhangjin Wu
2023-07-22 12:07 ` Willy Tarreau
2023-07-18 21:18 ` [PATCH v1 8/8] selftests/nolibc: add test support for powerpc64 Zhangjin Wu
2023-07-22 12:10 ` Willy Tarreau
2023-07-25 5:50 ` Zhangjin Wu
2023-07-25 6:02 ` Willy Tarreau
2023-07-23 7:47 ` [PATCH v1 0/8] tools/nolibc: add 32/64-bit powerpc support Thomas Weißschuh
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=20230725205202.36788-1-falcon@tinylab.org \
--to=falcon@tinylab.org \
--cc=ammarfaizi2@gnuweeb.org \
--cc=arnd@arndb.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=svens@linux.ibm.com \
--cc=thomas@t-8ch.de \
--cc=w@1wt.eu \
/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