From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 3025 invoked from network); 11 Jun 2020 21:02:55 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 11 Jun 2020 21:02:55 -0000 Received: (qmail 17932 invoked by uid 550); 11 Jun 2020 21:02:47 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 17902 invoked from network); 11 Jun 2020 21:02:46 -0000 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Thu, 11 Jun 2020 16:02:30 -0500 From: Segher Boessenkool To: Nicholas Piggin Cc: linuxppc-dev@lists.ozlabs.org, libc-dev@lists.llvm.org, musl@lists.openwall.com, linux-api@vger.kernel.org Message-ID: <20200611210230.GH31009@gate.crashing.org> References: <20200611081203.995112-1-npiggin@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200611081203.995112-1-npiggin@gmail.com> User-Agent: Mutt/1.4.2.3i Subject: [musl] Re: Linux powerpc new system call instruction and ABI Hi! On Thu, Jun 11, 2020 at 06:12:01PM +1000, Nicholas Piggin wrote: > Calling convention > ------------------ > The proposal is for scv 0 to provide the standard Linux system call ABI > with the following differences from sc convention[1]: > > - lr is to be volatile across scv calls. This is necessary because the > scv instruction clobbers lr. From previous discussion, this should be > possible to deal with in GCC clobbers and CFI. > > - cr1 and cr5-cr7 are volatile. This matches the C ABI and would allow the > kernel system call exit to avoid restoring the volatile cr registers > (although we probably still would anyway to avoid information leaks). > > - Error handling: The consensus among kernel, glibc, and musl is to move to > using negative return values in r3 rather than CR0[SO]=1 to indicate error, > which matches most other architectures, and is closer to a function call. What about cr0 then? Will it be volatile as well (exactly like for function calls)? > Notes > ----- > - r0,r4-r8 are documented as volatile in the ABI, but the kernel patch as > submitted currently preserves them. This is to leave room for deciding > which way to go with these. The kernel has to set it to *something* that doesn't leak information ;-) Segher