Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp820893rwb; Thu, 15 Dec 2022 02:58:20 -0800 (PST) X-Google-Smtp-Source: AA0mqf4IXsRq6fkHKtNl1Zch/MsTMjrPOyuD3GGiQOZWrtrwDLOOs7Zt+m041XSiN2MlsghR6CyB X-Received: by 2002:a17:906:4899:b0:7c1:6fe:f4a2 with SMTP id v25-20020a170906489900b007c106fef4a2mr21419028ejq.45.1671101900336; Thu, 15 Dec 2022 02:58:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671101900; cv=none; d=google.com; s=arc-20160816; b=VBYN2JcTET72XJt12E03gN5W8M4HYYWAsv/W28d0HPFk4T6eWsobY0M9oPEO8UdlO3 iiLnNo4jhq/SI3Ph6fkMKJ9CABw3pZgSxaPLlMuqB9lFbKgu0z1TXLdBQmSgRe49axVh M/0AV2M7OmvxHjdvCeOfiixWh4jJNRIZtiySr9tC3I3umAcuRuM3E8ts1dI6HO+wng0D hPzoHeL/qSzxWAZMD7gC9Eh1ASaFCCSFGg01PW5tYxz/34HFod0Uug2moMy3Oa+vgm3T SLyySVWKBPusl2dSZAIH8VyVfkjC7XiTlS9El/X7ye1EUqP8PVW7xvkpktJ4iSc84uXq TWLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=k8z9NPwjR/1WjDLafqFssLJg9DyvbaDVrEj71me8s10=; b=h78rBarEhGHeVHP92RqctEgMhB3fjG9J0DTCQI8Xk9xMqL6OwMhrKTIjiFoVAwgniK 2zkNWRPUoH87Rh/8spCDchRLEaxmw0qwcEO4JSGpBiPgrwZ1B1bb42IdAWDDOlaiBADW rC0DONlanUZbSll8Gyt3v9ex6dMg0juU/I3lgcHF6wWvlKGydtrzdHNsvdnvN0ClUlu2 wsFx+F6BbEjV06PUK3hqsimO/utSzXu5ajhOlrwvOE/nV5zWFBp/jKqq8uGpJmdbzgdd LyX30hhnL1euGsbL8Ad/9UacstGaU49mh+PguR6YNCeu4N3C31YBKzJHdlqES5rZeSxE OEKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b="FqN/U+Fp"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gs13-20020a1709072d0d00b007b284329e36si8893940ejc.131.2022.12.15.02.57.55; Thu, 15 Dec 2022 02:58:20 -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=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b="FqN/U+Fp"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229448AbiLOKvw (ORCPT + 99 others); Thu, 15 Dec 2022 05:51:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229997AbiLOKvs (ORCPT ); Thu, 15 Dec 2022 05:51:48 -0500 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B33565F66 for ; Thu, 15 Dec 2022 02:51:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=k8z9NPwjR/1WjDLafqFssLJg9DyvbaDVrEj71me8s10=; b=FqN/U+FpVhHgwuSC0KHPwZ7IOl AP1BieXhX0Fq2O01OJNw6WTgryTAF1ZXW+l2yug8M6gafkp1whJgQcUW6XdOPWtTnDmOn4MsCAy3G x6Xkhl+gUH1E37i5LhfMKOBY+iae1t+dGijFsP47jRrDxTYu+aMm7hrWdYwr//01fPLBAa157/2W1 OvCJ7StosCbcLfDes7Y/TZSyrVNgY+RECLJmTyOkk4w8z753UWZgxHEjC//1VJP20CHsEFxibN/9G pgmcE3YxDyVtfMRXGTg0y7iGqUDTT8cmk3LDzJS/g06///Rmpe5iexuOzI44kRl+UuvI+PHzGd4Wm YRTAXDnA==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:35714) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1p5lq0-0002kH-CX; Thu, 15 Dec 2022 10:51:40 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1p5lpy-0008II-Qi; Thu, 15 Dec 2022 10:51:38 +0000 Date: Thu, 15 Dec 2022 10:51:38 +0000 From: "Russell King (Oracle)" To: Ard Biesheuvel Cc: Linus Walleij , linux-arm-kernel@lists.infradead.org, linux-crypto@vger.kernel.org, Arnd Bergmann Subject: Re: [PATCH v2 2/2] ARM: permit non-nested kernel mode NEON in softirq context Message-ID: References: <20221207103936.2198407-1-ardb@kernel.org> <20221207103936.2198407-3-ardb@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Russell King (Oracle) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE 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 Thu, Dec 15, 2022 at 11:43:22AM +0100, Ard Biesheuvel wrote: > On Thu, 15 Dec 2022 at 11:27, Linus Walleij wrote: > > > > On Wed, Dec 7, 2022 at 11:39 AM Ard Biesheuvel wrote: > > > > > We currently only permit kernel mode NEON in process context, to avoid > > > the need to preserve/restore the NEON register file when taking an > > > exception while running in the kernel. > > > > > > Like we did on arm64, we can relax this restriction substantially, by > > > permitting kernel mode NEON from softirq context, while ensuring that > > > softirq processing is disabled when the NEON is being used in task > > > context. This guarantees that only NEON context belonging to user space > > > needs to be preserved and restored, which is already taken care of. > > > > > > This is especially relevant for network encryption, where incoming > > > frames are typically handled in softirq context, and deferring software > > > decryption to a kernel thread or falling back to C code are both > > > undesirable from a performance PoV. > > > > > > Signed-off-by: Ard Biesheuvel > > > > So boosting WireGuard as primary SW network encryption user? > > Essentially, although the use case that inspired this work is related > to IPsec not WireGuard, and the crypto algorithm in that case (GCM) is > ~3x faster than WG's chacha20poly1305, which makes the performance > overhead of asynchronous completion even more significant. (Note that > GCM needs the AES and PMULL instructions which are usually only > available when running the 32-bit kernel on a 64-bit core, whereas > chacha20poly1305 uses ordinary NEON instructions.) > > But Martin responded with a Tested-by regarding chacha20poly1305 on > IPsec (not WG) where there is also a noticeable speedup, so WG on > ARM32 should definitely benefit from this as well. It'll be interesting to see whether there is any noticable difference with my WG VPN. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!