Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp972563pxb; Tue, 9 Feb 2021 18:28:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJw8GL3TVnYaoflUyTrR7/7Fgejdhh0Mc8/e7ODoT7nLjmE+4LWjTy0oEfDKAKcJr85ayhlA X-Received: by 2002:a17:906:6b02:: with SMTP id q2mr738780ejr.122.1612924102312; Tue, 09 Feb 2021 18:28:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612924102; cv=none; d=google.com; s=arc-20160816; b=Wo+SyrNKssFw98w2cBMEZiV0WniN+Zx4G+jqF7pkkRw0JnWu1oSYX+c8YX+nINz9Ma q+hgdSr52M/5p/ur3ax93NgFrXSor2XOpbANKOpUDgNDVmI6ymT/xYpOYZAvqsBTyF9Y 9MdFBzY+yKWJc+QkmVUtDXT4LQm0escCWTzUF2hhC4Z4Ns1tATNoVu8Rop/vv4cit7n4 ZFX22yMavUn2KInXyB9r5em8e1+6NEsCCFZAkry0juYJ9p3n+hRTscR+qW7lN9S48Xeb zmj+Vp0/uAsvZBJ3xtwPGihFRdd/7QzHkJie21AT06alt5AcLiG2yobGjBlYpv7PSZpy 86yA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:message-id :mime-version:in-reply-to:references:cc:to:subject:from:date :dkim-signature; bh=cujEpEkxco6B8FhFOweauGZMK6zlCmv92EUaCj1tfZU=; b=WLbB/42Lze1/W1+3AP1BHJIwgb6eh60/ar6bG4Vq74jmWBCw+qlly8ywNwQrH7azwR JnuYBp3ApGkzh70trbnaYqVIuYPr+Dvn9NyypHHl6hi1EGuyDSKXRhf4H8SK2MlEv/4d Bg1gZTinwKQgR5QPAJD55mfCC3f/g4Q7Ek6Ec0/4QcEbu9ObuLOC115+l9Fp41UW7F5d KAkOGVoeaATBeqopexmlDQ7BLG7KmFbLsnNTixlQs1Vj97itqwodMNycKDlWHeFxrWRm PyX5B7t/Bme2uHRWjwim4VEl9GyMPkg92RMd0/HD/qcd6XY4hYskYGIsg3cslEwgrRcs 5Tuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=QcB3JRfz; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dn20si379706ejc.418.2021.02.09.18.27.59; Tue, 09 Feb 2021 18:28:22 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=QcB3JRfz; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235011AbhBJC0G (ORCPT + 99 others); Tue, 9 Feb 2021 21:26:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235191AbhBJB5Q (ORCPT ); Tue, 9 Feb 2021 20:57:16 -0500 Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB13EC061756 for ; Tue, 9 Feb 2021 17:56:35 -0800 (PST) Received: by mail-pl1-x636.google.com with SMTP id e9so351064plh.3 for ; Tue, 09 Feb 2021 17:56:35 -0800 (PST) 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=cujEpEkxco6B8FhFOweauGZMK6zlCmv92EUaCj1tfZU=; b=QcB3JRfzVYnUQKD4IJqERWsSeLYwfEHpJ5NGQfTXsDT2iBtVBJrKBYZB/3BvissB96 b81RVHnG94ZBmU2/7MkhzEwUuW3SfpukAisiI8EgrpVB4muQPHBJRlX5YYayteadex4n l0Q65zSqJKetfa2EuqteJV/vKyOu6CIO49lBRssfiOAI7ztW9wosy93mgL9/1whL+rkm xbc+T8P+zRK/mNvcXK1fNTgIJsTwFpf4vH3VSGfAzCTjKbbCRLPjAsspCpzquYoAUCNz AWZjdDR7fOIOp9gBMZXNUaEuaGlWydZUXv/P2rGGcx6x5Y+Uz659BM7RKu18uTZQUEEV pThA== 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=cujEpEkxco6B8FhFOweauGZMK6zlCmv92EUaCj1tfZU=; b=QPsaLr7m3WLqbt5waAJ7g63F+iahXaT1zGkndFvprPtvunOQPJv4j1ehD6qmsq8RGY VTar9X+yv0+QxsYFE3z7WsZBIVvv+O8zqcl/MPKFE/UYIONGMBEunctCLuR1JyBKd3Fa h2RyXtwvq3OBkfyQHuPjYOKX1zo5XMLTZALIc6PBfzhT2fTh26rakITdCHxPcP2wRuMI +T+GgJOvfpZp8+/B6iqgiXZHq0RzH7dPp8XpCbJCYPZhKSOmiEYxNWsduxctVqrnY/KV SnMbY3QmqjGUmxPS9QSRTGmmWIMgBEpevuw7QBR5kKvfxz8eztzrLc5yFmefbZmILexs rEdA== X-Gm-Message-State: AOAM532EBbG11nRLELCm01tGPI3xbUDuoHW7BTiTIu1Fpm6C7LTPL/qo aAtGOi2wS70djo8G/6SKZMU= X-Received: by 2002:a17:90a:5601:: with SMTP id r1mr761643pjf.236.1612922195487; Tue, 09 Feb 2021 17:56:35 -0800 (PST) Received: from localhost (14-201-150-91.tpgi.com.au. [14.201.150.91]) by smtp.gmail.com with ESMTPSA id bk12sm279994pjb.1.2021.02.09.17.56.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Feb 2021 17:56:34 -0800 (PST) Date: Wed, 10 Feb 2021 11:56:28 +1000 From: Nicholas Piggin Subject: Re: [PATCH v5 16/22] powerpc/syscall: Avoid stack frame in likely part of system_call_exception() To: Benjamin Herrenschmidt , Christophe Leroy , Michael Ellerman , msuchanek@suse.de, Paul Mackerras Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org References: <981edfd50d4c980634b74c4bb76b765c499a87ec.1612796617.git.christophe.leroy@csgroup.eu> <1612834634.qle1lc7n6y.astroid@bobo.none> In-Reply-To: MIME-Version: 1.0 Message-Id: <1612921956.st2b8xlrew.astroid@bobo.none> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Excerpts from Christophe Leroy's message of February 10, 2021 2:13 am: >=20 >=20 > Le 09/02/2021 =C3=A0 02:55, Nicholas Piggin a =C3=A9crit=C2=A0: >> Excerpts from Christophe Leroy's message of February 9, 2021 1:10 am: >>> When r3 is not modified, reload it from regs->orig_r3 to free >>> volatile registers. This avoids a stack frame for the likely part >>> of system_call_exception() >>=20 >> This doesn't on my 64s build, but it does reduce one non volatile >> register save/restore. With quite a bit more register pressure >> reduction 64s can avoid the stack frame as well. >=20 > The stack frame is not due to the registers because on PPC64 you have the= redzone that you don't=20 > have on PPC32. >=20 > As far as I can see, this is due to a call to .arch_local_irq_restore(). >=20 > On ppc32 arch_local_irq_restore() is just a write to MSR. Oh you're right there. We can actually inline fast paths of that I have=20 a patch somewhere, but not sure if it's worthwhile. >> It's a cool trick but quite code and compiler specific so I don't know >> how worthwhile it is to keep considering we're calling out into random >> kernel C code after this. >>=20 >> Maybe just keep it PPC32 specific for the moment, will have to do more >> tuning for 64 and we have other stuff to do there first. >>=20 >> If you are happy to make it 32-bit only then >=20 > I think we can leave without this, that's only one or two cycles won. Okay for this round let's drop it for now. Thanks, Nick