[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZMATKempQBPGCY2v@biznet-home.integral.gnuweeb.org>
Date: Wed, 26 Jul 2023 01:23:37 +0700
From: Ammar Faizi <ammarfaizi2@...weeb.org>
To: Zhangjin Wu <falcon@...ylab.org>
Cc: Arnd Bergmann <arnd@...db.de>, Sven Schnelle <svens@...ux.ibm.com>,
Thomas Weißschuh <thomas@...ch.de>,
Willy Tarreau <w@....eu>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Linux Kselftest Mailing List
<linux-kselftest@...r.kernel.org>
Subject: Re: [PATCH v1 1/8] tools/nolibc: add support for powerpc
On Wed, Jul 26, 2023 at 01:04:26AM +0800, Zhangjin Wu wrote:
> My old 'reply' is not rigorous, since the syscall6() uses stack to pass
> the 6th argument, so, our new syscall.h didn't support it currently,
> the syscalls I have tested about "=r" instead of "=a" were only syscall1-5().
Yeah, it won't fit with the new design.
i386 runs out of GPRs very quickly. Given that, it had a hard time
implementing syscall6() properly in nolibc. The calling convention
itself actually doesn't require stack for executing 'int $0x80'.
The reason of why it uses stack is because the %ebp register cannot be
listed in the clobber list nor in the constraint if -fomit-frame-pointer
is not activated. Thus, we have to carefully preserve the value on the
stack before using %ebp as the 6-th argument to the syscall. It's a hack
to make it work on i386.
> Ok, so, with the new syscalls.h proposed, we'd better keep i386
> syscall6() as-is.
>
> For the left syscall1-5(), is there any risk when use '=r' instead of 'r'?
Using "=r" instead of "r" doesn't make sense.
Did you mean "=r" instead of "=a"?
If that's what you mean:
So far I don't see the risk of using "=r" instead of "=a" as long as the
variable is properly marked as 'register' + asm("eax").
--
Ammar Faizi
Powered by blists - more mailing lists