From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751953AbdIOVGh (ORCPT ); Fri, 15 Sep 2017 17:06:37 -0400 Received: from mail-wr0-f195.google.com ([209.85.128.195]:34779 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751873AbdIOVGe (ORCPT ); Fri, 15 Sep 2017 17:06:34 -0400 X-Google-Smtp-Source: ADKCNb7OPw1b9Q1uTFEi4lpJqdqrS1tdPgoHGonv/BhWq2va+0lHxYHb3q1soNJwezBOlWdy18i9Ug== Date: Fri, 15 Sep 2017 23:06:29 +0200 From: Ingo Molnar To: Eric Biggers Cc: Josh Poimboeuf , x86@kernel.org, linux-kernel@vger.kernel.org, Tim Chen , Mathias Krause , Chandramouli Narayanan , Jussi Kivilinna , Peter Zijlstra , Herbert Xu , "David S. Miller" , linux-crypto@vger.kernel.org, Eric Biggers , Andy Lutomirski , Jiri Slaby Subject: Re: [PATCH 00/12] x86/crypto: Fix RBP usage in several crypto .S files Message-ID: <20170915210629.p5tv42za4ux7s2sy@gmail.com> References: <20170902000919.GA139193@gmail.com> <20170907071534.ztbxvyfoo7m7esmw@gmail.com> <20170907175800.GA92996@gmail.com> <20170907212646.q3y5wmhyaaqblg5m@gmail.com> <20170908175705.GA623@zzz.localdomain> <20170913212428.kibwbqs2f7dkeslb@treble> <20170913223303.pskmy2v7nto6rvtg@treble> <20170915045451.GA26063@zzz.localdomain> <20170915053431.xizfyla7lobrwqn3@gmail.com> <20170915160732.GA687@zzz.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170915160732.GA687@zzz.localdomain> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Eric Biggers wrote: > On Fri, Sep 15, 2017 at 07:34:31AM +0200, Ingo Molnar wrote: > > > > * Eric Biggers wrote: > > > > > Hi Josh, > > > > > > On Wed, Sep 13, 2017 at 05:33:03PM -0500, Josh Poimboeuf wrote: > > > > And here's v2 of the sha512-avx2 patch. It should hopefully gain back > > > > most of the performance lost by v1. > > > > > > > > From: Josh Poimboeuf > > > > Subject: [PATCH] x86/crypto: Fix RBP usage in sha512-avx2-asm.S > > > > > > > > Using RBP as a temporary register breaks frame pointer convention and > > > > breaks stack traces when unwinding from an interrupt in the crypto code. > > > > > > > > Mix things up a little bit to get rid of the RBP usage, without > > > > destroying performance. Use RDI instead of RBP for the TBL pointer. > > > > That will clobber CTX, so save CTX on the stack and use RDI as CTX > > > > before it gets clobbered, and R12 as CTX after it gets clobbered. > > > > > > > > Also remove the unused y4 variable. > > > > > > > > > > I tested the v2 patches for both sha256-avx2 and sha512-avx2 on Skylake. They > > > both pass the crypto self-tests, and there was no noticable performance > > > difference compared to the unpatched versions. Thanks! > > > > Cool, thanks for review and the testing! Can we add your Tested-by + Acked-by tags > > to the patches? > > > > Yes, that's fine for all the patches in the series. > > Will these patches go in through the crypto tree or through the x86 tree? Indeed, I suspect they should go through the crypto tree, these fixes are independent, they don't depend on anything in the x86 tree. Thanks, Ingo