From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io1-xd41.google.com (mail-io1-xd41.google.com [IPv6:2607:f8b0:4864:20::d41]) by sourceware.org (Postfix) with ESMTPS id 6856D385B835 for ; Thu, 16 Apr 2020 15:22:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 6856D385B835 Received: by mail-io1-xd41.google.com with SMTP id w1so21414583iot.7 for ; Thu, 16 Apr 2020 08:22:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=afYWrqA88mrip3QSImFNIDtSBq4hgCooB2bEshcSTUU=; b=Rs00gC+kTHKkNjNLbNEAzsO0I9iu00PYcKPhrCiPyKh6Yacqc8A1VKfkM8tRbYCFeR MNrEg/ziTNdY0pLINOnSB+6jfkQcCTd3XnG1tRSIevav7XtrFfhsG1PyfCeIRTYjHmf9 hyWXCpK4a+DTW3IALxxc/roIUKZ085LR35+AEiPz/T5bvH0EtpH+/l5/nKokMN7mSvRB nkeJ/tlrfO2KkSYW9xpSsXLgBZ7zK0WBvtUdbRFrO+6omuhKGbbWDa+ieqd1HyDVftXX TJKqudASTa1dPQr04UZQJH3V+c1rP9l/TcL5qgWLRI/+rmDwTHlXVduexFW/hYok4afF n4QQ== X-Gm-Message-State: AGi0PuY3Lk+S1a5wiiW/25k11EPJBHLGM+UmYGkNcNF1l13t/f1Hyvh6 ON4ERqMgcyaYqW+qPQ3nC1I/u8jtHy8xRFtQVuE= X-Google-Smtp-Source: APiQypJUIhVkThLxveROFDaNJzF1F6H0SxF4p1b4jiq/KAWUdQRgChQRLh3E7aB3e3zkhDSizJovVvQtFX0qWwawXhQ= X-Received: by 2002:a5e:db4d:: with SMTP id r13mr31582305iop.28.1587050530903; Thu, 16 Apr 2020 08:22:10 -0700 (PDT) MIME-Version: 1.0 References: <1586931450.ub4c8cq8dj.astroid@bobo.none> <20200415225539.GL11469@brightrain.aerifal.cx> <1586994952.nnxigedbu2.astroid@bobo.none> In-Reply-To: <1586994952.nnxigedbu2.astroid@bobo.none> Reply-To: noloader@gmail.com From: Jeffrey Walton Date: Thu, 16 Apr 2020 11:21:56 -0400 Message-ID: Subject: Re: [musl] Powerpc Linux 'scv' system call ABI proposal take 2 To: musl@lists.openwall.com Cc: libc-alpha@sourceware.org, libc-dev@lists.llvm.org, linuxppc-dev@lists.ozlabs.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, KAM_NUMSUBJECT, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, 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: Thu, 16 Apr 2020 15:22:12 -0000 On Wed, Apr 15, 2020 at 8:17 PM Nicholas Piggin wrote: > > Excerpts from Rich Felker's message of April 16, 2020 8:55 am: > > On Thu, Apr 16, 2020 at 07:45:09AM +1000, Nicholas Piggin wrote: > >> I would like to enable Linux support for the powerpc 'scv' instruction, > >> as a faster system call instruction. > >> > >> This requires two things to be defined: Firstly a way to advertise to > >> userspace that kernel supports scv, and a way to allocate and advertise > >> support for individual scv vectors. Secondly, a calling convention ABI > >> for this new instruction. > >> ... > > Note that any libc that actually makes use of the new functionality is > > not going to be able to make clobbers conditional on support for it; > > branching around different clobbers is going to defeat any gains vs > > always just treating anything clobbered by either method as clobbered. > > Well it would have to test HWCAP and patch in or branch to two > completely different sequences including register save/restores yes. > You could have the same asm and matching clobbers to put the sequence > inline and then you could patch the one sc/scv instruction I suppose. Could GCC function multiversioning work here? https://gcc.gnu.org/wiki/FunctionMultiVersioning It seems like selecting a runtime version of a function is the sort of thing you are trying to do. Jeff