From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SUSPICIOUS_RECIPS autolearn=ham autolearn_force=no version=3.4.2 Received: (qmail 3369 invoked from network); 25 Apr 2020 03:33:36 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with UTF8ESMTPZ; 25 Apr 2020 03:33:36 -0000 Received: (qmail 11433 invoked by uid 550); 25 Apr 2020 03:33:32 -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 11415 invoked from network); 25 Apr 2020 03:33:31 -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=zq/PxwzV2d2pv7ZxLs5gTdqBJ4G3tFPgkx7FiWQoE1Q=; b=GUGSdyJ/mRmE8koXK42Ga/MJmPG5a1DXTZ7gf88UwoLctcvaQXOfPlaYW5lisOx1KA 9m+fCwbnq8AS27zCet4Rl48xj7kn4s4rmL9eeqPVkXm4RMJKR2iOuAhGtMjdiIbrMobZ o3gQCqxcrWBIWh+/6Y98Jns63TXjaXVfYH7m8UNkr7ZAYQjUxsM+SLM+Yb15VKwiPaFy qypYyYhuib8SGUPE+THlhoQptaVeYbLRMLt5X7dnooXECesUzBX0qofe4G1pWvYicPL3 CHUDCPCbpp7EKYMYq5aNBuUa7ykP/nNiWegbopMHmVzDAIWjMae9RGJk5sRnMjx+j8xN 5W6A== 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=zq/PxwzV2d2pv7ZxLs5gTdqBJ4G3tFPgkx7FiWQoE1Q=; b=sMTZxXYzm0CeIXU+FQxMVzC5v1LnJ31dhzQCTGJDVtaQKRra4lls+q2042a4Osqb5I IDeRIW/iKt4k0wsJ251SLGmRX838QxeKqcE3j1LDNzvADju4dSikI7QIFkkhhX+2puDx MDBnphrpC+ATaG5A3V1DM27Kvw2SfoD0ramU49uXLAOQhYRpBBlxv2Xa/HXQbw4ectNH iYkclp93dYyVaLS1A/1k6Ov+ANojMKigWHtigiWrokWutn1/wLKr67l3Zoyc+ULATcY9 Im84UvX+uTYLzxgjGIfyAYCbB6vW5/BtM7FDL3mWhOP0ZERCPj+HSUCfIe1uYBq1UA+x WDzg== X-Gm-Message-State: AGi0Pub/BRX6XI6xE8gq8B5CyMQD4CbrZiJtyRJicjSODEVdDPhZpCYC 23wZSLj0JPeU/7Vxzf9QcVQ= X-Google-Smtp-Source: APiQypLZeLwCzg/ULJrK5hnsg/ulTWDl8qxC/67iRD5FVpsWwjGkOdxbOKIQClArFWUlnfmy8ToYQw== X-Received: by 2002:a63:e94f:: with SMTP id q15mr12534145pgj.339.1587785599218; Fri, 24 Apr 2020 20:33:19 -0700 (PDT) Date: Sat, 25 Apr 2020 13:30:01 +1000 From: Nicholas Piggin To: Rich Felker Cc: Adhemerval Zanella , libc-alpha@sourceware.org, libc-dev@lists.llvm.org, linuxppc-dev@lists.ozlabs.org, musl@lists.openwall.com References: <20200416175932.GZ11469@brightrain.aerifal.cx> <4f824a37-e660-8912-25aa-fde88d4b79f3@linaro.org> <20200416183151.GA11469@brightrain.aerifal.cx> <1587344003.daumxvs1kh.astroid@bobo.none> <20200420013412.GZ11469@brightrain.aerifal.cx> <1587348538.l1ioqml73m.astroid@bobo.none> <20200420040926.GA11469@brightrain.aerifal.cx> <1587356128.aslvdnmtbw.astroid@bobo.none> <20200420172715.GC11469@brightrain.aerifal.cx> <1587531042.1qvc287tsc.astroid@bobo.none> <20200423023642.GP11469@brightrain.aerifal.cx> In-Reply-To: <20200423023642.GP11469@brightrain.aerifal.cx> MIME-Version: 1.0 Message-Id: <1587784441.81hgf5xa06.astroid@bobo.none> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [musl] Powerpc Linux 'scv' system call ABI proposal take 2 Excerpts from Rich Felker's message of April 23, 2020 12:36 pm: > On Wed, Apr 22, 2020 at 04:18:36PM +1000, Nicholas Piggin wrote: >> Yeah I had a bit of a play around with musl (which is very nice code I >> must say). The powerpc64 syscall asm is missing ctr clobber by the way. = =20 >> Fortunately adding it doesn't change code generation for me, but it=20 >> should be fixed. glibc had the same bug at one point I think (probably=20 >> due to syscall ABI documentation not existing -- something now lives in=20 >> linux/Documentation/powerpc/syscall64-abi.rst). >=20 > Do you know anywhere I can read about the ctr issue, possibly the > relevant glibc bug report? I'm not particularly familiar with ppc > register file (at least I have to refamiliarize myself every time I > work on this stuff) so it'd be nice to understand what's > potentially-wrong now. Ah I was misremembering, glibc was (and still is) actually missing cr=20 clobbers from its "vsyscall", probably because it copied syscall which=20 only clobbers cr0, but vsyscall clobbers cr0-1,5-7 like a normal=20 function call. musl is missing the ctr register clobber from syscalls. powerpc has gpr0-31 GPRs, cr0-7 condition regs, and lr and ctr branch=20 registers (lr is generally used for function returns, ctr for other=20 indirect branches). ctr is volatile (caller saved) across C function=20 calls, and sc system calls on Linux. Thanks, Nick