Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1004567pxb; Thu, 4 Feb 2021 02:38:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJz+DbTEYWVfzcFA2KAFyEQvOcti9g5bMpM4uLRbs8Jn4L+LII3aB9v9cMvEyn0m+GAgN+yJ X-Received: by 2002:a05:6402:149a:: with SMTP id e26mr7438341edv.254.1612435119501; Thu, 04 Feb 2021 02:38:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612435119; cv=none; d=google.com; s=arc-20160816; b=PHZEkQwT2GtuSKk85D3MfP8fMq0SontpXEZCJzgPsWh4F9xo2ncziNoMY348s0u01K GXhvhwVLf3fpkLhaYAuP+HE8eqE1PmaTtlixpA+uYXMbWal8nVfsa6aRqaqNeyXqj5Bm PC/Q79aoVjWR8IXQipaCfp3KODDeKC0aneH19Q6DGoMSWlZ0Hba8SE2BUS1D+nQmBReC D2AoePUF07zk2s/3koEKOtnWG/xHf1dpU2Mog35voQdGXD2LQRzKoLPxaIaCc8B/W4k0 9cgzgqWQQeZAMCMIPNOiHUmsRJFPT7z6OL/xIYjZHv0yaLXEtCWl/gu+tIMIzHqOGGAb fbeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=qJY7KWNPnD+ntomz0DBB8Q+cQlm62uTCZkRji84sFcg=; b=rF5AOz3Z9csiy3nxddzFnNSFaF0JZQVsThSpsm7TmX9fE7tmUmdiOfzTrOyTJOuwp/ NAXbnvemp1hlSa4m2SmWKnpuXN8T2q5bnBwqaKD+ENwwcmCN4yyQrv/NWXVdlvPwiYCn Sy6NY15zby7ozvma5A3hTUFdWF2z4TWDBRuhLJJkSqOM8K+pFHHr3GEKwXB0snED0JNf cuQa55SKe344NyDjI7s7BqcL55gwO4+wUwTquSZ2PRqoX1YEKrVE7B9BUc+0HQsWTlDz TM7JoV4hMcM6hPX6AQhkKEk4uuXe2pplFKh/bG5Ywr1XjBsRqYpAifBTHyC9XJD49kH9 NQBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Pyoh2quC; 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 c5si3026810edw.359.2021.02.04.02.37.52; Thu, 04 Feb 2021 02:38:39 -0800 (PST) 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=k20201202 header.b=Pyoh2quC; 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 S235394AbhBDKf6 (ORCPT + 99 others); Thu, 4 Feb 2021 05:35:58 -0500 Received: from mail.kernel.org ([198.145.29.99]:42628 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235611AbhBDKef (ORCPT ); Thu, 4 Feb 2021 05:34:35 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 896B164E43; Thu, 4 Feb 2021 10:33:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1612434833; bh=qUSmXmDQ2dLtxjBzj2Gr0CFZ0JoPsDW59/wmRF9PWbM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Pyoh2quCGRQ1SdeW0ydtU4oO5R/2DhENYpkdimSTLbbiURuq0cvRqrHdvISaveDZg mudjhfFURkSeUchQJLaC+bUnL2aFx40D9ToZGiol4zasM2bC48dmtvwxrHJyg6SlnR 94Q1LnqQROIp3+V4lqcBTkDBD26cQpr+ndIuG6gbb8lrs0qKq73m3tT3sRpXxkArO/ fwsTIJhFNIXNIUSdbA+bgD9JMESDYpN+mAMqogkCMUg0Gz7HooJ3PsmzrHMP/9CXE5 opx4P3fOoJGoBz5ZEv5d9xgUBowCtDdVY4q+QXGC6d5lukO02H0643mmRTqp2zsdU+ sbvsKeX7G16qQ== Date: Thu, 4 Feb 2021 10:33:48 +0000 From: Will Deacon To: Ard Biesheuvel , linux-crypto@vger.kernel.org Cc: catalin.marinas@arm.com, kernel-team@android.com, mark.rutland@arm.com, Dave Martin , Eric Biggers , herbert@gondor.apana.org.au, linux-arm-kernel@lists.infradead.org Subject: Re: (subset) Re: [PATCH v2 0/9] arm64: rework NEON yielding to avoid scheduling from asm code Message-ID: <20210204103347.GA20410@willie-the-truck> References: <20210203113626.220151-1-ardb@kernel.org> <161238528350.1984862.12324465919265084208.b4-ty@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <161238528350.1984862.12324465919265084208.b4-ty@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Wed, Feb 03, 2021 at 09:31:31PM +0000, Will Deacon wrote: > On Wed, 3 Feb 2021 12:36:17 +0100, Ard Biesheuvel wrote: > > Given how kernel mode NEON code disables preemption (to ensure that the > > FP/SIMD register state is protected without having to context switch it), > > we need to take care not to let those algorithms operate on unbounded > > input data, or we may end up with excessive scheduling blackouts on > > CONFIG_PREEMPT kernels. > > > > This is currently handled by the cond_yield_neon macros, which check the > > preempt count and the TIF_NEED_RESCHED flag from assembler code, and call > > into kernel_neon_end()+kernel_neon_begin(), triggering a reschedule. > > This works as expected, but is a bit messy, given how much of the state > > preserve/restore code in the algorithm needs to be duplicated, as well as > > causing the need to manage the stack frame explicitly. All of this is better > > handled by the compiler, especially now that we have enabled features such > > as the shadow call stack and BTI, and are working to improve call stack > > validation. > > > > [...] > > Applied first patch only to arm64 (for-next/crypto), thanks! Oops, looks like I typo'd the external branch (for-next/crypo). No offense intended! I'll rename it now; SHAs will stay the same. Will