From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966528AbdLSHyv (ORCPT ); Tue, 19 Dec 2017 02:54:51 -0500 Received: from mail-wm0-f43.google.com ([74.125.82.43]:43189 "EHLO mail-wm0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966514AbdLSHyr (ORCPT ); Tue, 19 Dec 2017 02:54:47 -0500 X-Google-Smtp-Source: ACJfBov1MNv25jL2dzh8vMAFtKkgGFRMMh0nocuAHGSTXAfFmZWy1NWfwpsgPXF2C+aTxBTljdXY8w== Date: Tue, 19 Dec 2017 08:54:43 +0100 From: Ingo Molnar To: Eric Biggers Cc: linux-crypto@vger.kernel.org, Herbert Xu , "David S . Miller" , Josh Poimboeuf , Jussi Kivilinna , x86@kernel.org, linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com, Eric Biggers , Peter Zijlstra Subject: Re: [PATCH] crypto: x86/twofish-3way - Fix %rbp usage Message-ID: <20171219075443.tdpt2l72eelhpi7j@gmail.com> References: <001a113f2cd26f3532055f0f4a79@google.com> <20171219004026.170565-1-ebiggers3@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171219004026.170565-1-ebiggers3@gmail.com> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Eric Biggers wrote: > There may be a small overhead caused by replacing 'xchg REG, REG' with > the needed sequence 'mov MEM, REG; mov REG, MEM; mov REG, REG' once per > round. But, counterintuitively, when I tested "ctr-twofish-3way" on a > Haswell processor, the new version was actually about 2% faster. > (Perhaps 'xchg' is not as well optimized as plain moves.) XCHG has implicit LOCK semantics on all x86 CPUs, so that's not a surprising result I think. Thanks, Ingo