Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3515925rwb; Sat, 12 Nov 2022 07:09:13 -0800 (PST) X-Google-Smtp-Source: AA0mqf7Nld69jzAdGk9AOzlLL6OVvCXLsZUUWpEukA/e+9zdmVHdPWhQl9Qbh1ZlIr20+DMOBDy3 X-Received: by 2002:a17:902:aa83:b0:186:880c:1680 with SMTP id d3-20020a170902aa8300b00186880c1680mr7004645plr.164.1668265753517; Sat, 12 Nov 2022 07:09:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668265753; cv=none; d=google.com; s=arc-20160816; b=S+FtbdLd0qtK3fqwg25SmASVsywisAqHC68hcMXb9OyoJdYAfJ1HtCck3JukzRxJvI NqZWToXwgn52mE8V7f/vJ0VRM0z6myPjTlPRLz/dYX16t7xH2CFjkHXvYe5ACTdkn86Y OOMpct+hUp9u42oZfI8iismX6Jf7U/iebn+/GLOh23aCP8G20GJ2+4NqO2EAK/pHdXGC YS4dTy0r42tfSy9+YoY/6fbVQu7Dpo1FBGHhPkfh/GiWV1ldg4lgK34xNcmrhG5bFGPb bf3YSyJonKzPtz8ZAmDfAFH5Rju1TU16eWZ0kG9nTvznClFvRZ/3iF337imaRU4Ms10U 6wtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=3F4+VB1FtnQwz7mDslMdGDKPNn1tDTimpcK5/kWhhAA=; b=YjXOKyClsqeeFNWrfKC/WusaKc4GsN+GokYFup2tFoFlmyTr3TpB4U8myKAiVQ5fBU BXstJUWna66KhtXHSNf/7HEfPeyLKbnG+kLQ/8BXvBL+ffAPirAs4ULyW02L/JTOsxWi SuJANkbwPkPSexqBxH7mgBYUv1eWYy2x599nI2Icr9GbkWtAnEWHPHqZia1M5OHdyUgo eBYc9n9m4zRRe5kGeZ/aXPCTL2AvT8KLPNCEi/LVOTKaeKSZ3t2Mw06SRqazcCZQI/GJ uAaYuNRmb0b5/S4td1OoEHFZdWwgKL31aDT8Vao6JgVxsWASgcc8WGQ/teIkmgWrurYF JZQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=imQeOftf; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ik9-20020a170902ab0900b00176be2315dcsi4915125plb.260.2022.11.12.07.08.44; Sat, 12 Nov 2022 07:09:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=imQeOftf; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S234005AbiKLPAM (ORCPT + 99 others); Sat, 12 Nov 2022 10:00:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231377AbiKLPAL (ORCPT ); Sat, 12 Nov 2022 10:00:11 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8789D85 for ; Sat, 12 Nov 2022 07:00:09 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 5815AB80937 for ; Sat, 12 Nov 2022 15:00:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BF3E9C433D7 for ; Sat, 12 Nov 2022 15:00:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668265206; bh=NWz/jQZUJJPvDahD/g7+rxLhPhTnTwb/EaNjaU+YyI4=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=imQeOftfBGcVWEu6WLs8cLPjS+eA3hwALlldy8Nt2t5gAQh2hTp9lt5MaxqTEaCvs 37yjDMLA37pTJrSQfedYTtgWr73m5Ne3rioS4MzCZjJ0EXP0Zi8e9Vapp9BVaUI8A+ 0UfA9OJOocMmr5b3yzzMB9vrwjBCMgPp0GXvvy8Si5RehsqfkWOfJ9qyUWRWmc5mbd QYZrqOT6L7a5Cr2PWEN+F3RNuW6euaII72PlVhxejqUHFwuriaeedKnmklygWYWFwF 8Podct5iLZ3cWjsmS1p2H561mXjuhrVOBdRbcbfbmDjA7p0yFQ4Mmt+46IvwUtF2va /nvOs0F1oX2Qw== Received: by mail-lf1-f46.google.com with SMTP id f37so12449970lfv.8 for ; Sat, 12 Nov 2022 07:00:06 -0800 (PST) X-Gm-Message-State: ANoB5pnJcXD7cBxQBFz5w76PGKIoQmJppTIpZR1wjNRBcognDivREjDs NOcTYlwxfOwVZEbnZu8VessJMVwBXVr21GDTOBU= X-Received: by 2002:a05:6512:138f:b0:4ab:534b:1b2c with SMTP id p15-20020a056512138f00b004ab534b1b2cmr2016483lfa.426.1668265204749; Sat, 12 Nov 2022 07:00:04 -0800 (PST) MIME-Version: 1.0 References: <20201210024342.GA26428@gondor.apana.org.au> <20201210111427.GA28014@gondor.apana.org.au> <20201210121627.GB28441@gondor.apana.org.au> <20201215091902.GA21455@gondor.apana.org.au> <062a2258-fad4-2c6f-0054-b0f41786ff85@candelatech.com> <6e20b593-393c-9fa1-76aa-b78951b1f2f3@candelatech.com> In-Reply-To: <6e20b593-393c-9fa1-76aa-b78951b1f2f3@candelatech.com> From: Ard Biesheuvel Date: Sat, 12 Nov 2022 15:59:53 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2] crypto: aesni - add ccm(aes) algorithm implementation To: Ben Greear Cc: Herbert Xu , Linux Crypto Mailing List , Eric Biggers Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Fri, 11 Nov 2022 at 23:29, Ben Greear wrote: > > On 11/9/22 2:05 AM, Ard Biesheuvel wrote: > > On Wed, 9 Nov 2022 at 04:52, Herbert Xu wrote: > >> > >> On Tue, Nov 08, 2022 at 10:50:48AM -0800, Ben Greear wrote: > >>> > >>> While rebasing my patches onto 6.1-rc4, I noticed my aesni for ccm(aes) patch didn't apply cleanly, > >>> and I found this patch described below is applied now. Does this upstream patch mean that aesni is already > >>> supported upstream now? Or is it specific to whatever xctr is? If so, > >>> any chance the patch is wanted upstream now? > >> > >> AFAICS the xctr patch has nothing to do with what you were trying > >> to achieve with wireless. My objection still stands with regards > >> to wireless, we should patch wireless to use the async crypto > >> interface and not hack around it in the Crypto API. > >> > > > > Indeed. Those are just add/add conflicts because both patches > > introduce new code into the same set of files. The resolution is > > generally to keep both sides. > > > > As for Herbert's objection: I will note here that in the meantime, > > arm64 now has gotten rid of the scalar fallbacks entirely in AEAD and > > skipcher implementations, because those are only callable in task or > > softirq context, and the arm64 SIMD wrappers now disable softirq > > processing. This means that the condition that results in the fallback > > being needed can no longer occur, making the SIMD helper dead code on > > arm64. > > > > I suppose we might do the same thing on x86, but since the kernel mode > > SIMD handling is highly arch specific, you'd really need to raise this > > with the x86 maintainers. > > > > Hello Ard, > > Could you please review the attached patch to make sure I merged it properly? My concern > is the cleanup section and/or some problems I might have introduced related to the similarly > named code that was added upstream. > I don't think the logic is quite right, although it rarely matter. I've pushed my version here - it invokes the static call for CTR so it will use the faster AVX version if the CPU supports it. https://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git/log/?h=aesni-ccm-v6.1