Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp1364346ybg; Wed, 29 Jul 2020 12:10:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzT/IGFrF9tVezzHDl7TCXJylwNbuQVY8PDunFy2MSTIYRynxh76nJzsGfYj2RWcLj00AcO X-Received: by 2002:a05:6402:559:: with SMTP id i25mr32060462edx.35.1596049843777; Wed, 29 Jul 2020 12:10:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596049843; cv=none; d=google.com; s=arc-20160816; b=S4dt5cF3bij/6moo2lYb1RA78aHdGqXzcOUeCd3LNrJyknoBNzFkQvbznIYAtSYFO0 0ETzrDGyCK9VRlNv6uV89nx3KxfQbav7V1vEYYwI+qMNnbtz1wIB9S+KxDrczi503brl LX4VpgP29ud+FM7oKaAdAeqo751fxZqdaCt1qnpRY52B0qJXKaJXIsA+vHPQEVMzqJRg pBS5Dr9Ujl4aP6VlXrdrUTO1ldvodtm3XbQr0DcpG6qSP2AiHDc35YNbEvfYvqYw/SYx /U5pWEjDrGn7AiUd5yAxUG5RpWpCJhLVZQfaSwRyNYfWp1+sXywgtWL3T0+xx485slEC QkjA== 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=JAY0E04suE1r0WNg+NTZ8akBfxrE4ggKq6Kcc7CCTQk=; b=zsj9EjdJTipYpDD9htmik2SlEPOPsj5+cb88GmqTn2MOVq2Y2kbbsBdr0Gg75z8aqO XPDWniHT5HiuqvZ1MnsE+29DZ6/RlqUlvK6C7VQAIkorHUzjXAjlbSdfCuu+TOy3uuis /NVxOdyUfRBJBWTbTVVmfQRiFXkxVHMbLbmMG2cEltanAcOoMdRuXDai78d1AhZYGjEH O718kf170/pWdC1ar2V6wGbZ+Vo9k6PT3EtNYPHUCFvmv8sfAQQAj2arHupX2FSLIAwr IKDDlcshohG/Ufncgsw1k18pJ/lhn6860fafhGi3BZyZOY8+isTAxXUkInd7Px1RwX2k 91/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MBZhmxSF; 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 z8si1687637ejm.420.2020.07.29.12.10.10; Wed, 29 Jul 2020 12:10:43 -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=MBZhmxSF; 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 S1726391AbgG2TJy (ORCPT + 99 others); Wed, 29 Jul 2020 15:09:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:53526 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726365AbgG2TJy (ORCPT ); Wed, 29 Jul 2020 15:09:54 -0400 Received: from mail-ot1-f44.google.com (mail-ot1-f44.google.com [209.85.210.44]) (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 CFDFC2083B for ; Wed, 29 Jul 2020 19:09:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596049793; bh=e4NlcxK1OiAY2qaQZ7JbXhrA+36s0OFXU/vLnOuqsjQ=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=MBZhmxSFoMOsS0hpyExXoGHyh9k95ZyJADO2MnyHQZTr7/2rXExi4vIWtOwaRl2yO kQU6EWmQz6uV0GI66Cr0FfdYfw0s2eo6FcdNKah2iTf4UJRaLJPoPDHV1ERZAymwpp KBGGQLYL8VLT66x09Av9iYAsN/rz4xSYpRtYG6sU= Received: by mail-ot1-f44.google.com with SMTP id p25so8948203oto.6 for ; Wed, 29 Jul 2020 12:09:53 -0700 (PDT) X-Gm-Message-State: AOAM533vCnvsABAYNYYoFwhH9ninBRGhQFHTMzq2CMEGicOG24ZNcy6K l03Z9LOGXCVvuNjyjuopZwQi8Db6EF41B5TcFB4= X-Received: by 2002:a9d:3a04:: with SMTP id j4mr16626300otc.108.1596049793119; Wed, 29 Jul 2020 12:09:53 -0700 (PDT) MIME-Version: 1.0 References: <2a55b661-512b-9479-9fff-0f2e2a581765@candelatech.com> <04d8e7e3-700b-44b2-e8f2-5126abf21a62@candelatech.com> In-Reply-To: <04d8e7e3-700b-44b2-e8f2-5126abf21a62@candelatech.com> From: Ard Biesheuvel Date: Wed, 29 Jul 2020 22:09:41 +0300 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Help getting aesni crypto patch upstream To: Ben Greear Cc: Linux Crypto Mailing List 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 Wed, 29 Jul 2020 at 15:27, Ben Greear wrote: > > On 7/28/20 11:06 PM, Ard Biesheuvel wrote: > > On Wed, 29 Jul 2020 at 01:03, Ben Greear wrote: > >> > >> Hello, > >> > >> As part of my wifi test tool, I need to do decrypt AES on the CPU, and the only way this > >> performs well is to use aesni. I've been using a patch for years that does this, but > >> recently somewhere between 5.4 and 5.7, the API I've been using has been removed. > >> > >> Would anyone be interested in getting this support upstream? I'd be happy to pay for > >> the effort. > >> > >> Here is the patch in question: > >> > >> https://github.com/greearb/linux-ct-5.7/blob/master/wip/0001-crypto-aesni-add-ccm-aes-algorithm-implementation.patch > >> > >> Please keep me in CC, I'm not subscribed to this list. > >> > > > > Hi Ben, > > > > Recently, the x86 FPU handling was improved to remove the overhead of > > preserving/restoring of the register state, so the issue that this > > patch fixes may no longer exist. Did you try? > > > > In any case, according to the commit log on that patch, the problem is > > in the MAC generation, so it might be better to add a cbcmac(aes) > > implementation only, and not duplicate all the CCM boilerplate. > > > > Hello, > > I don't know all of the details, and do not understand the crypto subsystem, > but I am pretty sure that I need at least some of this patch. > Whether this is true is what I am trying to get clarified. Your patch works around a performance bottleneck related to the use of AES-NI instructions in the kernel, which has been addressed recently. If the issue still exists, we can attempt to devise a fix for it, which may or may not be based on this patch. > If you can suggest a patch to try I'll be happy to test it to see how it > performs. > Please share performance numbers of an old kernel with this patch applied, and a recent one without. If that shows there is in fact an issue, we will do something about it. > > -- > Ben Greear > Candela Technologies Inc http://www.candelatech.com