From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by sourceware.org (Postfix) with ESMTPS id 27389385DC1C for ; Sat, 25 Apr 2020 03:33:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 27389385DC1C Received: by mail-pf1-x444.google.com with SMTP id y25so5777690pfn.5 for ; Fri, 24 Apr 2020 20:33:20 -0700 (PDT) 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=ZWy92/rfmOe2Q1y5BLuTqjDbweG/C4vpvrKxjhjt9meoPTQugAclMSf4/yW6faCLf1 k+G7wN9O/emIwDfhn9gw1gQCLFWsYXMGfgrS+1eq3U7k+e0ZdDgMu8vvGtPKFsnn5ygZ yMwR1Xm2iUNdzY5RtItv1d573A5pe/BvxnWZOgUy2c/lUXaVKHQZdjM09iIb/8D56e2t 5cxcJTeTc30lcMEMeRqqGalCVgKn30OeMQogWbzwSAdrxlO3GqAxj5J6PrG32VHprF1L jF0DykfRPjfJK/oNfHw8pG978NVdNoN8QehqjXWSl/o/bJnQttPO3/jgHo5OaE14zW6U ws8g== X-Gm-Message-State: AGi0Pua/ZR8ixRuA4rfelP2FRxsYJ89bDD6tCw6rc2mQONK96nDUS6MQ vDE2/l+KEBcjIb1SqQ/Qa9PP+p2o4WM= 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) Received: from localhost ([203.220.177.17]) by smtp.gmail.com with ESMTPSA id x16sm6977578pfm.146.2020.04.24.20.33.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Apr 2020 20:33:18 -0700 (PDT) Date: Sat, 25 Apr 2020 13:30:01 +1000 From: Nicholas Piggin Subject: Re: [musl] Powerpc Linux 'scv' system call ABI proposal take 2 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 X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, SUSPICIOUS_RECIPS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Apr 2020 03:33:21 -0000 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