From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E18F1C433DB for ; Tue, 30 Mar 2021 10:37:44 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 57C44619AB for ; Tue, 30 Mar 2021 10:37:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 57C44619AB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=V3Z4XDmIq5D/nroJwGcXQujkIPIm1arSVp5xABm75Bs=; b=eyKoX4C1JpGibxWj2sTSrtP1b rvhWFdjm87ArwlqdSMFN/G9zb8C3bBcAzRCiAIve1HpF9Njyonv+Lhgsz7rOv5z2wqolxhZVi1p9x R35MC88bG+rT3lvcGmYHeHUtzCml7AU4yJh/lF9sr6dCdzcPkumFLILcD/odAvLPM4Nq8Otnk4Akh n33UfgQg6TLQT8lWga0addtIUMure/8T5Mr+1GKfcm+dHxsI4hN16loDgCVpBvnBfU1QoE9LmTePu yhrSeC0xAsn/9OK1dyZP377WuUQSt6N3ZXwjsC6NEhhxTfDZ/gRCzUzG7bh7L5rJh/bHqq25nYhuC mx+fgVLPw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lRBjS-003Px2-LY; Tue, 30 Mar 2021 10:36:22 +0000 Received: from mail.kernel.org ([198.145.29.99]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lRBjM-003Puv-9g for linux-arm-kernel@lists.infradead.org; Tue, 30 Mar 2021 10:36:20 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id A4CAF619A6; Tue, 30 Mar 2021 10:36:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1617100573; bh=vlejUKjTN3abqWjJfwmpRpsVi7zGnnH1VNzjwBkSdpA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Gn0F7rfpSJGa1lUn7RpxMmByH6rnRx0GkGAAOSQ9Mo2889QfJDudDHMrq6u19X7+p ZOD+ZKii11jl2u6IO5tb0jJSG2cBlGPtsSUBHgq64doV+qVgGNQZUWgY5jrBVhE90H dNr2jr/sgwn/MzxT1oem6Lsekm+J+9PjhaHhLk3AGAoxnVU/gq5CN5uhRgdCZok9yz 0lS6xeCBCckQSQ8Ed2lbYNJfgOHHVMCr/o3zDqgyBMrgDo+buzsMVIvxQwBVhmZa0D do8Xpu5JFEp7BE7rN9o29obvSgyppymcMKn4/HW69Ehe4+HmYFprsP1aQ+pVJ0VQcy mOKV6oi0K4cYw== Date: Tue, 30 Mar 2021 11:36:07 +0100 From: Will Deacon To: Ard Biesheuvel Cc: linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Dave Martin , Mark Brown , Herbert Xu , Eric Biggers , Catalin Marinas , Thomas Gleixner , Peter Zijlstra , Sebastian Andrzej Siewior , Ingo Molnar , Andy Lutomirski Subject: Re: [PATCH v2 3/9] arm64: fpsimd: run kernel mode NEON with softirqs disabled Message-ID: <20210330103605.GC5352@willie-the-truck> References: <20210302090118.30666-1-ardb@kernel.org> <20210302090118.30666-4-ardb@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210302090118.30666-4-ardb@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210330_113616_585654_20521E62 X-CRM114-Status: GOOD ( 18.52 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Mar 02, 2021 at 10:01:12AM +0100, Ard Biesheuvel wrote: > Kernel mode NEON can be used in task or softirq context, but only in > a non-nesting manner, i.e., softirq context is only permitted if the > interrupt was not taken at a point where the kernel was using the NEON > in task context. > > This means all users of kernel mode NEON have to be aware of this > limitation, and either need to provide scalar fallbacks that may be much > slower (up to 20x for AES instructions) and potentially less safe, or > use an asynchronous interface that defers processing to a later time > when the NEON is guaranteed to be available. > > Given that grabbing and releasing the NEON is cheap, we can relax this > restriction, by increasing the granularity of kernel mode NEON code, and > always disabling softirq processing while the NEON is being used in task > context. > > Signed-off-by: Ard Biesheuvel > --- > arch/arm64/crypto/aes-modes.S | 2 +- > arch/arm64/crypto/sha1-ce-core.S | 2 +- > arch/arm64/crypto/sha2-ce-core.S | 2 +- > arch/arm64/crypto/sha3-ce-core.S | 4 +-- > arch/arm64/crypto/sha512-ce-core.S | 2 +- > arch/arm64/include/asm/assembler.h | 28 +++++++++++++++----- > arch/arm64/kernel/asm-offsets.c | 2 ++ > arch/arm64/kernel/fpsimd.c | 4 +-- > 8 files changed, 31 insertions(+), 15 deletions(-) Acked-by: Will Deacon Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel