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 16680 invoked from network); 14 Jun 2020 09:26:33 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 14 Jun 2020 09:26:33 -0000 Received: (qmail 21644 invoked by uid 550); 14 Jun 2020 09:26:27 -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 21612 invoked from network); 14 Jun 2020 09:26:26 -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=iwrVWbIqEV3s+7RFsDYwNIYHhfGqPzI2P1CNqw2alCA=; b=nMR4K/Mqy3PRx+ALb0wSOCgfj2S27/GQsy+gft4Tt9G7IIDoBJWqkfEWvdLq7Mno+c qHeFLRK9JVqJi9g+sG7BRdachupsVK6zNNeama6V7Kem7Qb8KbBrgG/ZEtjsXWj44NbI h0U3451Ast3krN3qKBz9b2Zhvpsva/MOHtwiQ4sweU8Ulxo0vvCM3pPYZJjYyF0dNctP BRwTQHaaYwdVy7QASoxWyD+wPXrcKMRhiKgAbc39xoN4WdXZ4wQG0tdRavDjWTWdAEV/ a1ck6NiQ4KllivNeW7csw885uU76kWCJFmUo8KXfhFTLocVmWzxggESP3fNz1YAIbJHk CEHg== 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=iwrVWbIqEV3s+7RFsDYwNIYHhfGqPzI2P1CNqw2alCA=; b=BBhdyrbRY4T12OdbPAX4wJ2gvOoj55IWfchlEejsg2ovpMBwZ8F4TK1UT9GOy56RYM ttYghDBvJt7a+d4Y652J5IPd3ZIt23RM+SlVuThlufkctrWkhIsPLYC/1LlzomUMjkDH Lecni5YJN5lHWvmOFSN907I8ymLF+eaITd3kVg7h+aofczcSV0DTWKl6QdWl+Wo3ctwj 7Z0Y0utHBjsTVMF3RjT+kzprOt40wcR2NpnO4IvJnqwVXxjN/OR9+3YSUn+LcaXdlpmq jzKhIzljWI/zVrnWLmyRseq9edwqjJuNXCeMjDd7NU0d2oLo9xdng8F4lBk8HvalcLph +VYA== X-Gm-Message-State: AOAM533b3qjUOxm87WMV0YETL9HkQTfT1Xd1eT/T6rwKSvmRgLGlAtEo l5rtOtfPHISxnuffEjCARyA= X-Google-Smtp-Source: ABdhPJyFqXqjBDwwikwmkiIchCvnrkZX7lREZ3x6s2VU5MZ5m6VjbNN+BDnw0N7aKFLlFyyRC8ReyA== X-Received: by 2002:a17:90a:a62:: with SMTP id o89mr6206780pjo.188.1592126774348; Sun, 14 Jun 2020 02:26:14 -0700 (PDT) Date: Sun, 14 Jun 2020 19:26:07 +1000 From: Nicholas Piggin To: Segher Boessenkool 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> <20200611210230.GH31009@gate.crashing.org> In-Reply-To: <20200611210230.GH31009@gate.crashing.org> MIME-Version: 1.0 Message-Id: <1592126681.37ybf0zhke.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 Segher Boessenkool's message of June 12, 2020 7:02 am: > Hi! >=20 > 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=20 >> with the following differences from sc convention[1]: >>=20 >> - lr is to be volatile across scv calls. This is necessary because the=20 >> scv instruction clobbers lr. From previous discussion, this should be=20 >> possible to deal with in GCC clobbers and CFI. >>=20 >> - cr1 and cr5-cr7 are volatile. This matches the C ABI and would allow t= he >> kernel system call exit to avoid restoring the volatile cr registers >> (although we probably still would anyway to avoid information leaks). >>=20 >> - Error handling: The consensus among kernel, glibc, and musl is to move= to >> using negative return values in r3 rather than CR0[SO]=3D1 to indicate= error, >> which matches most other architectures, and is closer to a function ca= ll. >=20 > What about cr0 then? Will it be volatile as well (exactly like for > function calls)? Yes, same as for sc (except for SO bit). Which is a bit unclear in this section. >> Notes >> ----- >> - r0,r4-r8 are documented as volatile in the ABI, but the kernel patch a= s >> submitted currently preserves them. This is to leave room for deciding >> which way to go with these. >=20 > The kernel has to set it to *something* that doesn't leak information ;-) For "sc" system calls these were defined as volatile (and used to just=20 leak information), so now we just zero them. Thanks, Nick