Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1029953pxa; Thu, 20 Aug 2020 00:05:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxkYEOx3r5Bp9YnVlXbnzrbsxEZxIcf/Yr87mkMaOya6FQtRCfdquXFL6VnmKQ9Rsgb+ibG X-Received: by 2002:a17:906:c143:: with SMTP id dp3mr1878834ejc.504.1597907107862; Thu, 20 Aug 2020 00:05:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597907107; cv=none; d=google.com; s=arc-20160816; b=XE8OqnZPSK1AgWz0G55J5hD6c8a1Z3HIkLc2mPKlAhkdi7PDtrZcqOdW1ym2XsO3Kj 2E3gdI985ghHDdlvR+hZ0BGEeFqp0oFg9VTmZyi6N3+bCAO2+7PDf7G+CYsyEFIT/3xy jc/c5D8pmvOCTnFl7C+JxDv5QhuvosQm9YHq200eS1SlxeOwNnKGo7ja3XE081KmRR0G uaJ4WOUnegHJMCmkISIu1n2/BjBv6CzRj9msuMQzgKwp1GPic9WqPzJspNADDYOYd3Pg hDV9i6jXLs2+ZnRCSYxe1m1vrqmPyO8fJewQjQsJ4OeptFC1MBoDL93vqtsumgBWAUfN aT+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=ba9cSIZhP+6Gb3XMbmNMqHrN83S2vBN8NC7SAzX4eFU=; b=e1CvEd5Tp9a0nsPZKnSsMN4MeRJf/Tc2YE6c6R/XrNsk0QhfILdQvTYZczgjnyzAi0 RhRJlESR+1LMTZognzvk6U7QU+ofKgmK62sXhb78CnEbB7sA/BezmX6ieGRb7Q7jyDNl ywCspqnpTfn5AGoHo7otfsb8DPuLrAVhLG/4IWZek+XP+r8DmGeWRWherbRhHuEqkw2F 9hrpE2et1Swa4Dgs8WZhKpC+J/UJSY2nXEFdPBkOBqt4w/DnEnOy96RR87KpyLmTiGKp dh6ZBQs0rrMid/iCXC+ApcBmBFhcV/2jHcb721PJ3qJhs53LubSbXvf2Psp4JdaIaw1O 3axg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gFlnGd9h; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z61si789058ede.593.2020.08.20.00.04.43; Thu, 20 Aug 2020 00:05:07 -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; dkim=pass header.i=@kernel.org header.s=default header.b=gFlnGd9h; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726750AbgHTHEj (ORCPT + 99 others); Thu, 20 Aug 2020 03:04:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:37932 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725819AbgHTHEi (ORCPT ); Thu, 20 Aug 2020 03:04:38 -0400 Received: from mail-ot1-f41.google.com (mail-ot1-f41.google.com [209.85.210.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1E35E20855 for ; Thu, 20 Aug 2020 07:04:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597907078; bh=ba9cSIZhP+6Gb3XMbmNMqHrN83S2vBN8NC7SAzX4eFU=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=gFlnGd9hvzKHH5oDhmDzOeaTA1MWEsovPvQ1HaIKBRt9L0CpgaKkT0rDvAM8CFQsY anLaq293se1DX5Iqw3EvSXqgxJ81Xw6Wx0UsHrOrtAJLWoylGGHdwXGAKqZ0K8NkSs b/oOOFHICWIr2iEtawHVMuMhI+QJUlr4njboFP9M= Received: by mail-ot1-f41.google.com with SMTP id x24so675769otp.3 for ; Thu, 20 Aug 2020 00:04:38 -0700 (PDT) X-Gm-Message-State: AOAM530mOinE2FGg84a4NkVopoHAqnurM3ZSl+HA+wwsXr0Sdnpc8fVI 7jzAYDHuOBoPofB0XX7Dzjeo402RTHRqPnL9iyk= X-Received: by 2002:a9d:774d:: with SMTP id t13mr1164113otl.108.1597907077488; Thu, 20 Aug 2020 00:04:37 -0700 (PDT) MIME-Version: 1.0 References: <20200818135128.GA25652@gondor.apana.org.au> <2aad9569-877e-4398-88ef-e40d9bbf7656@candelatech.com> <20200818140532.GA25807@gondor.apana.org.au> <20200818221550.GA27421@gondor.apana.org.au> <20200818222719.GA27622@gondor.apana.org.au> <20200818223359.GA27712@gondor.apana.org.au> <8b248ef3-d4c7-43fd-6ae4-1c3381597579@candelatech.com> <20200820070142.GA21343@gondor.apana.org.au> In-Reply-To: <20200820070142.GA21343@gondor.apana.org.au> From: Ard Biesheuvel Date: Thu, 20 Aug 2020 09:04:26 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 0/5] crypto: Implement cmac based on cbc skcipher To: Herbert Xu Cc: Ben Greear , Linux Crypto Mailing List , Eric Biggers Content-Type: text/plain; charset="UTF-8" Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Thu, 20 Aug 2020 at 09:01, Herbert Xu wrote: > > On Thu, Aug 20, 2020 at 08:58:15AM +0200, Ard Biesheuvel wrote: > > > > But if we look at the actual issue at hand, we might also look into > > amortizing the FPU preserve/restore over multiple invocations of a > > cipher. I proposed a patch a while ago that makes cipher an internal > > crypto API abstraction, and we could easily add pre/post hooks that > > preserve/restore the FPU in this case, in which case we would not need > > any changes at higher levels. > > I think any use of SIMD crypto_cipher on bulk data is just wrong. > Because the performance degradation when SIMD cannot be used is > too great for this to make sense. > > So optimising the FPU overhead is attacking the wrong problem. > I don't disagree with that, especially given all the effort that went into optimizing FPU preserve/restore on both arm64 and x86. But the bottom line is that this is what is causing the degradation in Ben's case, so we cannot disregard it.