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.1 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,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 29773 invoked from network); 19 May 2021 11:12:57 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 19 May 2021 11:12:57 -0000 Received: (qmail 18361 invoked by uid 550); 19 May 2021 11:12:55 -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 18330 invoked from network); 19 May 2021 11:12:54 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:subject:to:cc:references:in-reply-to:mime-version :message-id:content-transfer-encoding; bh=kdQAEAu76INNncaho8Bt0bdchs3rDGFoPptw8O5fZ+g=; b=tpVWgGTA4m2hNOvhlCU5yRq1j46tosc/esW4axep8ee0UqBruPl/LtBbT0vktDzlb8 RfAMxKLMvJdbrH0bMfJit6+1ob5zha/3FTdym+4E8DrDm0MdRPtH5ypvMOuSDJqAUOfN y6tB9utCHbDDoH253iYXn4t/RJ0Fm+c513E5wrLqxb4bX0OOLABmlbYA1f+3VD+ZQ5BK JOQjPL9MVq08k1ysMoed06xeTUbZp9S73KsUN34NhLyeyxI+/Y3DJ7tACVepzNr6r8vX c4DsxCR9c5Cqa6+ieRLRT9KT7cI5oMY+/Qf2t30P//dvh8tiAz7WDNYMI0/FrTN7VYBn kkIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:subject:to:cc:references:in-reply-to :mime-version:message-id:content-transfer-encoding; bh=kdQAEAu76INNncaho8Bt0bdchs3rDGFoPptw8O5fZ+g=; b=nvpZgQRlz09zohHUAgtCg5sjld2fpTrydk97E0opFqTQDh9rQoYEm5ESbnqxWq3QKE KGdRoBUxIrDg6JybxpZcAG2brGZTwK5Qfe6S9jpTKbMIM6AF7oLDe5os0YYolYCb5O4z AwO0NCpPFvF9hnnCyb3F6eDNPH3BkA0hcVBEt2gDI2udOC7sKi/Xlb6z7j3MZZrg0RTh 3Ep2qVWOUTQuyLWPFOqgt6yHYvyAJ5zPzuXmf/kRKO+dcOkneTHP7nyFaJ3FpLYSJo3X FFZlFjMXfYmUgmRWa+r2wqv3p0jNgYmRhasIDVBy0oakQ+u4gFpcXs0CWW1o+PJzb2r6 eiQg== X-Gm-Message-State: AOAM5330nNNSMeWAcsjK7IXNf/Q5bWRz5ClwP98aospWwK/coFEVOSZy e1PbkX/v9dJD+flf6d4cLlE= X-Google-Smtp-Source: ABdhPJw7V3xAbm9WRiDnAy2CSI5boC9catqyT3n26FSZl9aoWuFPkpEQmN7mgJUwOoadbbwf1M7Ojw== X-Received: by 2002:a17:903:49:b029:f1:75c4:3eb3 with SMTP id l9-20020a1709030049b02900f175c43eb3mr10341165pla.76.1621422762320; Wed, 19 May 2021 04:12:42 -0700 (PDT) Date: Wed, 19 May 2021 21:12:36 +1000 From: Nicholas Piggin To: Joakim Tjernlund , "ldv@altlinux.org" , "mpe@ellerman.id.au" Cc: "libc-dev@lists.llvm.org" , "linux-api@vger.kernel.org" , "linuxppc-dev@lists.ozlabs.org" , "musl@lists.openwall.com" References: <20200611081203.995112-1-npiggin@gmail.com> <20210518231331.GA8464@altlinux.org> <9b5ea7059c5a5d4e9ccccd7d73ce2c66b2203f52.camel@infinera.com> <1621410291.c7si38sa9q.astroid@bobo.none> <1621413143.oec64jaci5.astroid@bobo.none> In-Reply-To: <1621413143.oec64jaci5.astroid@bobo.none> MIME-Version: 1.0 Message-Id: <1621422559.vsmpjhjqzq.astroid@bobo.none> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [musl] Re: Linux powerpc new system call instruction and ABI Excerpts from Nicholas Piggin's message of May 19, 2021 6:42 pm: > Excerpts from Joakim Tjernlund's message of May 19, 2021 6:08 pm: >> On Wed, 2021-05-19 at 17:55 +1000, Nicholas Piggin wrote: >>> Excerpts from Joakim Tjernlund's message of May 19, 2021 5:33 pm: >>> > On Wed, 2021-05-19 at 02:13 +0300, Dmitry V. Levin wrote: >>> > > Hi, >>> > >=20 >>> > > On Thu, Jun 11, 2020 at 06:12:01PM +1000, Nicholas Piggin wrote: >>> > > [...] >>> > > > - Error handling: The consensus among kernel, glibc, and musl is = to move to >>> > > > =C2=A0=C2=A0using negative return values in r3 rather than CR0[SO= ]=3D1 to indicate error, >>> > > > =C2=A0=C2=A0which matches most other architectures, and is closer= to a function call. >>> >=20 >>> > What about syscalls like times(2) which can return -1 without it bein= g an error? >>>=20 >>> They do become errors / indistinguishable and have to be dealt with by=20 >>> libc or userspace. Which does follow what most architectures do (all=20 >>> except ia64, mips, sparc, and powerpc actually). >>>=20 >>> Interesting question though, it should have been noted. >>>=20 >>> Thanks, >>> Nick >>=20 >> I always figured the ppc way was superior. It begs the question if not t= he other archs should >> change instead? >=20 > It is superior in some ways, not enough to be worth being different. >=20 > Other archs are unlikely to change because it would be painful for > not much benefit. New system calls just should be made to not return > error numbers. If we ever had a big new version of syscall ABI in > Linux, we can always use another scv vector number for it. Or... is it possible at syscall entry to peek the address of the instruction which caused the call and see if that was a scv instruction? That would be about as reliable as possible without having that new flag bit. Thanks, Nick