From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BE23EC2D0C0 for ; Tue, 24 Dec 2019 02:24:24 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 92B8B206D3 for ; Tue, 24 Dec 2019 02:24:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="O/dNgugQ"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="oPvK6VPz" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 92B8B206D3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=GhpSyF6XUbTyEnH6iRPJ8UkyrauWPURgMr9j2UGZV+A=; b=O/dNgugQzVDinJ ZhhZGaUbaSLlch7iPcpmGSwYh14TQVlgRCK+XLAFv/ZQceSotTiKZk7UbiIyeRC6wYjNygLfaxsNv +xbAX25JJ4qWxhbJ4dTzb9fYsTj4663JNCQ0y/Y44l8GGlhKfBjiEyTGPKWU7bT/PBmc9t93qo8ws +gYHzrn3RppGwj76cdnawRSpAbeX5RsezYU9oj2M4ZC6rzwknohfQCGNpCKgUU2u+u97KzT1s/6xE c9mGTwx9A1AtgzxN/21m8y/vBovNuGINnPmL/4cJDxxzoKln+dvtjxHo2EAPcs/rGUuQq3lHRFYPt HDe5BDoCOtEha6ZAmCTg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ijZrz-0000On-Jf; Tue, 24 Dec 2019 02:24:23 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ijZrx-0000OT-0r for linux-arm-kernel@lists.infradead.org; Tue, 24 Dec 2019 02:24:22 +0000 Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3BB5821775 for ; Tue, 24 Dec 2019 02:24:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577154260; bh=SPQ7Bj4a4eNp21OAcqYrY8SxuFJJaC2a6yGdIeeRS1o=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=oPvK6VPzi1k2yyEjQny+BqytBOGY+Pvm5TAIa+d74eS8hvsJFnqaOLMcPbR1MVHcg TJAbv69cwFBjDUU1LcTUwFGC1sdBHfjcRbhYXPuD/8fDpRJfQhxnnenWDdYNTNMhtK WQtdttyNyw+EIZ8phdY7Uk7eLt21kAD5fLV0wvro= Received: by mail-wr1-f44.google.com with SMTP id b6so18666313wrq.0 for ; Mon, 23 Dec 2019 18:24:20 -0800 (PST) X-Gm-Message-State: APjAAAUue2CyMbwNQ/kTIaNtA+vqqY4T0idbqBCM07wdqG6ZJ6+E5bKv s45KOWAFQThHRNLOAU6JGc4yCLxP82eJPROanp86wQ== X-Google-Smtp-Source: APXvYqxjzD58lmej1/f4cJSP7HhlmKnh8jXfi6lwDjHJL4b+9GZQPe+XjiFw3YmwCo3ewdHy4fkwT46pqN+EiY2Rfws= X-Received: by 2002:adf:f491:: with SMTP id l17mr32117348wro.149.1577154258620; Mon, 23 Dec 2019 18:24:18 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Andy Lutomirski Date: Mon, 23 Dec 2019 18:24:05 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH v2 02/10] lib: vdso: move call to fallback out of common code. To: Christophe Leroy X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191223_182421_083474_FFA1578B X-CRM114-Status: GOOD ( 15.92 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Arnd Bergmann , Benjamin Herrenschmidt , X86 ML , LKML , "open list:MIPS" , Paul Mackerras , Andrew Lutomirski , Michael Ellerman , Thomas Gleixner , Vincenzo Frascino , linuxppc-dev , linux-arm-kernel Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Dec 23, 2019 at 6:31 AM Christophe Leroy wrote: > > On powerpc, VDSO functions and syscalls cannot be implemented in C > because the Linux kernel ABI requires that CR[SO] bit is set in case > of error and cleared when no error. > > As this cannot be done in C, C VDSO functions and syscall'based > fallback need a trampoline in ASM. > > By moving the fallback calls out of the common code, arches like > powerpc can implement both the call to C VDSO and the fallback call > in a single trampoline function. Maybe the issue is that I'm not a powerpc person, but I don't understand this. The common vDSO code is in C. Presumably this means that you need an asm trampoline no matter what to call the C code. Is the improvement that, with this change, you can have the asm trampoline do a single branch, so it's logically: ret = [call the C code]; if (ret == 0) { set success bit; } else { ret = fallback; if (ret == 0) set success bit; else set failure bit; } return ret; instead of: ret = [call the C code, which includes the fallback]; if (ret == 0) set success bit; else set failure bit; It's not obvious to me that the former ought to be faster. > > The two advantages are: > - No need play back and forth with CR[SO] and negative return value. > - No stack frame is required in VDSO C functions for the fallbacks. How is no stack frame required? Do you mean that the presence of the fallback causes worse code generation? Can you improve the fallback instead? _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel