Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1156086ybh; Thu, 16 Jul 2020 04:54:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyKl7k+1kh4QASht6iey0lxqpehmEkw7DC17jYVezzgjz+lETntGIxQQVjGQgOcTNBTXH9s X-Received: by 2002:a17:906:945:: with SMTP id j5mr3310935ejd.436.1594900480593; Thu, 16 Jul 2020 04:54:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594900480; cv=none; d=google.com; s=arc-20160816; b=DQX+PTnV24XAsy1rrTQw3SFqCO34GOLfEoDnjSclGCISqvAA/xAjFNEE/5b+Z9mi8h oNDB3vaTQ+UruuvobXXG7fvmVSi5tuMamLRNCXA905h06vPblvKH5c0AuiePMMftNbxr 4rYUY3V71fn2Pd2UfEZecEeHfIxV48/efyaUU15OWLAmgz1MAsyquZc9VK68E9fn6yHI 812W7a3nXcz/ccZKAvnAG3dIhzmq+hH0FMnjrcA/t2t5FVKgQqgGWSJ+y0JsvsMDoqnW 2elNOZFpC+6tS0Pb+WN5wrXnSTdWfH3tlg0hmizbSLITc7uW27KBdCRK3EIgvOtAqb0Q nWcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=eybRHNyYUWY9cWXIarW5PTA1iaAwpOuVssIVwzeWPjE=; b=Vd79jzzJTwebcuYfWPZoli9jQFcFYAcF1f9peeYI7VcDVJd/9sYbhb3Kv1Omhyfydz rpJce0ZSz2QYDZH9VoRHXGsFstNHNZaK/JyBhfL66tgdiajs38H9DWE8JnAhw2z+i+O8 Nqm/rORP8apEaLA7m+G5qoM7untq+d9375vlIBrYRYIVeCGLSSY6hQrfFTKpmkNGMcb4 cE1BF/XKf5Lm50Nq+j4CCSNJjCC1Qupf4w3wJziMo5kz0chZpFIYuoh7YKi4Ft3C+Ch7 5b+ZEtARxMB7LM6u6U2fYGwLqnKjZwVSBk9gn7LYlB8uV102PmVn9+ulHHTrBp8XeN4C P7mA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-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 o10si3079335ejx.722.2020.07.16.04.54.16; Thu, 16 Jul 2020 04:54:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728093AbgGPLyL (ORCPT + 99 others); Thu, 16 Jul 2020 07:54:11 -0400 Received: from helcar.hmeau.com ([216.24.177.18]:40062 "EHLO fornost.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726383AbgGPLyL (ORCPT ); Thu, 16 Jul 2020 07:54:11 -0400 Received: from gwarestrin.arnor.me.apana.org.au ([192.168.0.7]) by fornost.hmeau.com with smtp (Exim 4.92 #5 (Debian)) id 1jw2Sm-0008KH-M7; Thu, 16 Jul 2020 21:54:09 +1000 Received: by gwarestrin.arnor.me.apana.org.au (sSMTP sendmail emulation); Thu, 16 Jul 2020 21:54:08 +1000 Date: Thu, 16 Jul 2020 21:54:08 +1000 From: Herbert Xu To: Ard Biesheuvel Cc: linux-crypto@vger.kernel.org, Martin Willi , Eric Biggers Subject: Re: [PATCH] crypto: x86/chacha-sse3 - use unaligned loads for state array Message-ID: <20200716115408.GC31166@gondor.apana.org.au> References: <20200708091118.1389-1-ardb@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200708091118.1389-1-ardb@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Wed, Jul 08, 2020 at 12:11:18PM +0300, Ard Biesheuvel wrote: > Due to the fact that the x86 port does not support allocating objects > on the stack with an alignment that exceeds 8 bytes, we have a rather > ugly hack in the x86 code for ChaCha to ensure that the state array is > aligned to 16 bytes, allowing the SSE3 implementation of the algorithm > to use aligned loads. > > Given that the performance benefit of using of aligned loads appears to > be limited (~0.25% for 1k blocks using tcrypt on a Corei7-8650U), and > the fact that this hack has leaked into generic ChaCha code, let's just > remove it. > > Cc: Martin Willi > Cc: Herbert Xu > Cc: Eric Biggers > Signed-off-by: Ard Biesheuvel > --- > arch/x86/crypto/chacha-ssse3-x86_64.S | 16 ++++++++-------- > arch/x86/crypto/chacha_glue.c | 17 ++--------------- > include/crypto/chacha.h | 4 ---- > 3 files changed, 10 insertions(+), 27 deletions(-) Patch applied. Thanks. -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt