Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1891443pxa; Thu, 6 Aug 2020 19:48:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJybfQsx77zS+0KQyVTEfYe5tl2nH/RbidvnXoHenMQxEijtSKFJP3BDSRbdm/h/HG23phff X-Received: by 2002:a17:906:68e:: with SMTP id u14mr7754490ejb.166.1596768484414; Thu, 06 Aug 2020 19:48:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596768484; cv=none; d=google.com; s=arc-20160816; b=wgPaG7UmFaBhVEJGaG4Th+2Hd4m+m0sVkcL8s3WJWP5Hn8m9QN50wbM9eOFFmmxE5Z kq2tg6km/T047k1ssduiUQhtnDU/af+7aig0fM6jZGvRh7CDZ8T327zPhgl5o50QtAYT A61xqXUbCGmcXenYaEbLLDk6CYS6ORL0f+xpk7e2feVBGNv89ZSZ60kfXNGTlgcfKTFk waaiY8BQ1VXNpcgql/cIrYfIkmKGfVhS5dGCUGEx+5zPJdBdS4bi2tZWUNZ/j1I7AenY r1Y6ufjCVsjW2xjPGWwylKQL94CWWExAMuY7zZ720iTMBDltlRju80QBGdlqzOYQgavP 7R7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=bkMZ2wPQ18TDAVveiFLYesZ06YUh8JPXdU9rJ8N5X5k=; b=gmxCaHzW8zya40ujPjSMjE5ZR3mK5nLPjZQxxXH5EulewfXGl29PcwqLu9q6SXY0KK 56ovFMbJRJS0xA465GsVMm+z7TlszEb1iRsMQUAr44sVGZC2gidKH0lvR39YmfBBa76s 8FGPNWnn/ZkuqQyjjPnwVSCJmMMQ5F4jVP+PBFl2e7hKoOhgYg4Q6Ij+vtCBCXzf1Ptp 16uzUR+AQOQgjwtcjTcGw/meIHy6cDo8Uh+jV3qprZsT6JLIMfYnGSPgxzIJH/0Ba+dV 6khiFv/qDv5Dqvm4CvAWxJOyBTmvUKLKjfVD0M4fkDClsMKrsV2a0N1bdigpAX9ZoTSh N+Jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=MPMsNyeT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f1si4304063edc.157.2020.08.06.19.47.41; Thu, 06 Aug 2020 19:48:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=MPMsNyeT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726282AbgHGCoq (ORCPT + 99 others); Thu, 6 Aug 2020 22:44:46 -0400 Received: from bilbo.ozlabs.org ([203.11.71.1]:42129 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726058AbgHGCop (ORCPT ); Thu, 6 Aug 2020 22:44:45 -0400 Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4BN8pM1JlRz9sSG; Fri, 7 Aug 2020 12:44:43 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ellerman.id.au; s=201909; t=1596768284; bh=FZuIxnPjJkYxCWMXw2mxcRhOKtZPN4eNLc1MN/Gupm4=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=MPMsNyeTn9a8d9v3fgyBEE07kO0XqO2/i5FfHbv9CyGV1GB8vH5IhwduGCenlTyPB ZYSTBZwtvBB0vFIwr9kUfvEI14D2YJ+gHaFR6FA0sPDvCvxxFpFSONBUyKuBg6bQrl U9VW0RJcVFHSTynki4Fz+vwmS8SG1pYoKBL8wXe5ZlwAHzfgPoLNq0GieUdNAoZ+BB aCj1+BSpCjXIY8vLjuh8Fnr9vMoJ/8a5RLgie/8bnzElqwrwFdXKgkTjYYEeC4F4J3 Mq7Rofv/RlSpKFLB5N2LIsV4DPkQotvYf740maIf3gyM1ZynE1dEGGcRvdpomw+GSx P0t+HR6XtxnGA== From: Michael Ellerman To: Segher Boessenkool Cc: Christophe Leroy , Christophe Leroy , Benjamin Herrenschmidt , Paul Mackerras , nathanl@linux.ibm.com, linux-arch@vger.kernel.org, arnd@arndb.de, linux-kernel@vger.kernel.org, Tulio Magno Quites Machado Filho , luto@kernel.org, tglx@linutronix.de, vincenzo.frascino@arm.com, linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH v8 5/8] powerpc/vdso: Prepare for switching VDSO to generic C implementation. In-Reply-To: <20200806183316.GV6753@gate.crashing.org> References: <2a67c333893454868bbfda773ba4b01c20272a5d.1588079622.git.christophe.leroy@c-s.fr> <878sflvbad.fsf@mpe.ellerman.id.au> <65fd7823-cc9d-c05a-0816-c34882b5d55a@csgroup.eu> <87wo2dy5in.fsf@mpe.ellerman.id.au> <20200805133505.GN6753@gate.crashing.org> <87r1sky1hm.fsf@mpe.ellerman.id.au> <20200806183316.GV6753@gate.crashing.org> Date: Fri, 07 Aug 2020 12:44:42 +1000 Message-ID: <87mu37xjhh.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Segher Boessenkool writes: > On Thu, Aug 06, 2020 at 12:03:33PM +1000, Michael Ellerman wrote: >> Segher Boessenkool writes: >> > On Wed, Aug 05, 2020 at 04:24:16PM +1000, Michael Ellerman wrote: >> >> Christophe Leroy writes: >> >> > Indeed, 32-bit doesn't have a redzone, so I believe it needs a stack >> >> > frame whenever it has anything to same. > > ^^^ > >> >> > fbb60: 94 21 ff e0 stwu r1,-32(r1) >> > >> > This is the *only* place where you can use a negative offset from r1: >> > in the stwu to extend the stack (set up a new stack frame, or make the >> > current one bigger). >> >> (You're talking about 32-bit code here right?) > > The "SYSV" ELF binding, yeah, which is used for 32-bit on Linux (give or > take, ho hum). > > The ABIs that have a red zone are much nicer here (but less simple) :-) Yep, just checking I wasn't misunderstanding your comment about negative offsets. >> >> At the same time it's much safer for us to just save/restore r2, and >> >> probably in the noise performance wise. >> > >> > If you want a function to be able to work with ABI-compliant code safely >> > (in all cases), you'll have to make it itself ABI-compliant as well, >> > yes :-) >> >> True. Except this is the VDSO which has previously been a bit wild west >> as far as ABI goes :) > > It could get away with many things because it was guaranteed to be a > leaf function. Some of those things even violate the ABIs, but you can > get away with it easily, much reduced scope. Now if this is generated > code, violating the rules will catch up with you sooner rather than > later ;-) Agreed. cheers