Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp2969224rdg; Mon, 16 Oct 2023 23:43:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH3kiCF5gK0p9S9GzmNIj+fSKMEzD3a1E6WaBC3QU3YijDlBTbqYq32QThpkSwqMHGOcpY1 X-Received: by 2002:a05:6870:4c0d:b0:1dc:d8c6:39f with SMTP id pk13-20020a0568704c0d00b001dcd8c6039fmr1518074oab.14.1697525038859; Mon, 16 Oct 2023 23:43:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697525038; cv=none; d=google.com; s=arc-20160816; b=GLxLiT27nIelhjX39H9a8ZvWvByi7KE+my3qXoZmtR4R/FZi1kAXQUb/sxCqIhMLga kJkqm7OIAu9qDa872LvKCCvMF95KQmTfKEBNaV/Qik/sHVaNuQcnENb0nmlRZLAtFhE8 BgtOtupuT3gvZ+1TGhZFfCG7kAQKuin1b7cEFhaTDJ/GJrxyEtUcEN2o4/kYlKnEP/Sh 7S6TIsIVnzKJQq6aWPOo5jNutgWyNVMe96C2ojz+oOctvvV4Lf+Cr1Etrq0TWPFDwP3p d/Nwqw6qmftbladV95DrB9UwgviNJVm7NyAL3NMbMb+vPBTsxBvqUMSSNJ+o9Bsp/ceC Rs+A== 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=IFaG/um3npeX2OHKPdvivfG0cR/la4R29jkJUiShJnA=; fh=5aG9yKXvZQ7k6V0O4+Rh+eMhYdRW0ouGvt46cfna0fI=; b=SOrHgKgxhYgX+/5HJVDRv5FlWYy6iMdu/GgdLs2exIsoBYYpqOHkMegeX09ZIYigmW 0d5tJbtjEXacrRroA7eWmA5lDISbo426D8FvYNgAUzRat9ac5TFC8B1hzby235A70N5n FnpOgQkOX0X7Rcj9RjWQpvRg9eG2nOwAFTZbTYbvuaImEDFVS9mxtOmgPNDn3WgCqf2T lAK6QQ66DN6whKKkO0xsM2KXIHS+McFmC9V/hqbarM+upwVM7EfbHzNFdPXB7BafSRjr rMSohytNE+UHaISj12k5UV6jBvW6ZoUbGeSPdBtvzmB4q4cySMINWvPIkQVGBQnGqtbp Vq/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CtZxMROG; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id n3-20020a6546c3000000b00577475ee5f6si1067803pgr.618.2023.10.16.23.43.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 23:43:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CtZxMROG; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 2D29780307BA; Mon, 16 Oct 2023 23:43:56 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234032AbjJQGnp (ORCPT + 99 others); Tue, 17 Oct 2023 02:43:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229666AbjJQGnp (ORCPT ); Tue, 17 Oct 2023 02:43:45 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7E9595 for ; Mon, 16 Oct 2023 23:43:43 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 76B35C433CA for ; Tue, 17 Oct 2023 06:43:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697525023; bh=F8JeGIf5fTjeDtn0mUwOr+jYS5d6XeOTNY/HUJJf2yw=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=CtZxMROGhxdmOhrZYL29MudLcCSM3Mgd1CAsvuBE9gENODEAhCORdXTrs+O6mBUl5 IpESHo3FPx+Iwyl5VoqcklH6Cx7OQChvwXhvWStsnDFngMyWF1Z6aXjuL88UQQMpJq QbI2XKWuVIM84/z1XIjD3wvN0lRi4l3dd+LbjsSP64dXtbrqY0HyzAVwAj4Xn8/wnY pxaoLJ7nav6UtBPrQm7dpsvnYifSHelrtvSxerCED5aorHQ6pqhAa3zOh5rUBvsey8 /2wmIx2ZD7w5hgq3/9Vf1JAl4Hh4Rc5I+BEzp002nNvWpMUx2fYdWFf7fLyK2v6cOL uvcKXrY0pYFaw== Received: by mail-lj1-f178.google.com with SMTP id 38308e7fff4ca-2c51682fddeso29248591fa.1 for ; Mon, 16 Oct 2023 23:43:43 -0700 (PDT) X-Gm-Message-State: AOJu0YzjPo8nMVyRZCzenlDsX2sF7iJ53a0lcFOZ4JNkudBqkk4OHnxG Tud5E1dyfigHaYc3TMORxxQTMqW9aCbAZwQEPvQ= X-Received: by 2002:a2e:9594:0:b0:2c5:d0c:237e with SMTP id w20-20020a2e9594000000b002c50d0c237emr427190ljh.17.1697525021653; Mon, 16 Oct 2023 23:43:41 -0700 (PDT) MIME-Version: 1.0 References: <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> <32a44a29-c5f4-f5fa-496f-a9dc98d8209d@candelatech.com> <20231017031603.GB1907@sol.localdomain> In-Reply-To: <20231017031603.GB1907@sol.localdomain> From: Ard Biesheuvel Date: Tue, 17 Oct 2023 08:43:29 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2] crypto: aesni - add ccm(aes) algorithm implementation To: Eric Biggers Cc: Ben Greear , Herbert Xu , Linux Crypto Mailing List Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Mon, 16 Oct 2023 23:43:56 -0700 (PDT) On Tue, 17 Oct 2023 at 05:16, Eric Biggers wrote: > > On Mon, Oct 16, 2023 at 01:50:05PM -0700, Ben Greear wrote: > > On 11/12/22 06:59, Ard Biesheuvel wrote: > > > 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 > > > > Hello Ard, > > > > It looks like something changed again in the intel-aesni logic for 6.6 kernel. I was able to do a small > > change to the patch to get it to compile, but the kernel crashes when I bring up a wlan port in > > 6.6. When I remove the aesni patch, the station comes up without crashing. The aesni patch worked > > fine in 6.5 as far as I can tell. > > > > I'm attaching my slightly modified version of the patch you sent previous. If you have time to > > investigate this it would be much appreciated. > > > > Thanks, > > Ben > > If this patch is useful, shouldn't it be upstreamed? > It was rejected by Herbert on the basis that the wireless stack should be converted to use the async API instead.