Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4224715rdb; Mon, 11 Dec 2023 12:27:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IG1YZqz7cv3J/96cdTyEzcwQ7nD/KwCdjjAIvdrEfX2lp6BovmK9CLMS4l8g9r0Tk4Uz5rv X-Received: by 2002:a05:6a20:8b03:b0:18f:97c:5ba0 with SMTP id l3-20020a056a208b0300b0018f097c5ba0mr1856021pzh.110.1702326465900; Mon, 11 Dec 2023 12:27:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702326465; cv=none; d=google.com; s=arc-20160816; b=PLSCCskbF4OSeHthTjWAwcrRyx/6hmK5beUQkHlyLGebazbvrPZiDs6bvbV8aDwY2x Y6ykxzoyCIRoO/aslqQinwOUxKoV8F4VLflmuXd8cpNRAfUE0XJpkn7i+OvqrubochpT 28pGK1C28Y/EEcuhl8vRRo4fVAYmJYnwQDsCgja52vXnUY8cV2ZI1kCvJ5hxKlKd7Zel iHmwHUI1+pVDvAep3Ui84KydxwNvXqL222zh3W1c0IjZEbEcHPF56chCLFJdGix/siWV QsxjEtxLiqyBXNx3ZrR8S6b3MmOkGgyf70AJ8uJMxd5s2rq0eIXIbcpbv1kA32yATD3z qtJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=8XuyZ/AS3DAbUjfgEZbz0FEg84CoeONBgg2Iusj7MCA=; fh=vRaawHc2CNQX4lSF0C9R4IGRGFnBN/6M/dew4lEo8No=; b=VzvBUsm4AMINRmiGw/rBrO3SC4pk/uDkuDCWTg5NgEFno0gkyWQ9guGu/LRpcZhqNp zDDyA2uXq04KFXM8zDd/s6oOzbldmulT1sAIHhK70lnhmzN8bKJeS4CNWxaey4kgeCRz Rte62hY0KaUA/E7hLyn89h4G5R6uUBtzPMcIdXwRy/g7op92s4K0mzU5K1KQ8me6vSLA 9XlvyxcC6Jq/9Mjo2voxhe82qYRu1A9RABxNH1Ij8tjphBqvez+I2nBjxI+xt263aWj5 EIrTntwJbW44BAlz5vW96Z5VpdBnp9qrbyhmwpPuYr76S14HtQMuod6m8ACOKuIqvtMO vhFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=W45Ulq5N; spf=pass (google.com: domain of linux-crypto+bounces-716-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-crypto+bounces-716-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id a9-20020a17090a740900b00286acacd596si6761406pjg.136.2023.12.11.12.27.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 12:27:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto+bounces-716-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=W45Ulq5N; spf=pass (google.com: domain of linux-crypto+bounces-716-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-crypto+bounces-716-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 222FF281CD3 for ; Mon, 11 Dec 2023 20:27:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 104FE53E0E; Mon, 11 Dec 2023 20:27:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="W45Ulq5N" X-Original-To: linux-crypto@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BD22B537FE for ; Mon, 11 Dec 2023 20:27:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DFBF4C433CB; Mon, 11 Dec 2023 20:27:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702326461; bh=xKFe2YCP0owG+PMR65Uk7wgCp72Kqzn6CiBGLIKZk2A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=W45Ulq5NnHf+eu4swJyOhJ2YY8hvS0/xKjkTQnNJ6QQx4ybXRJJStNqiPpNAphEQ/ aLYQTWgBRdSjqo5+JJZ0gZFCo7Arb820zAJBJAvvcJds6pFKqivVJXHVnjoS8Ud+J/ o/CDTOZhkmzAggO5qZxig5ZUV/dMF15lyc2Ab2CvUpdFsNGV/+lOcpikbZwsd9dk64 2CJG6tPCR2QtfMhenv+kmsvmdes97LQj8j9OPTFqFhQceHerOw/PEB8xRaDo4e2mu8 h8De1RUZNlu5hriP/A59RdBszqGsM1IrgbySf232YUb6Cm2jltISfB55hxcldnoXBO 0b+IpNXPNd9pg== From: Will Deacon To: Ard Biesheuvel , linux-arm-kernel@lists.infradead.org Cc: catalin.marinas@arm.com, kernel-team@android.com, Will Deacon , Ard Biesheuvel , Mark Rutland , Sebastian Andrzej Siewior , Eric Biggers , Kees Cook , Marc Zyngier , Mark Brown , linux-crypto@vger.kernel.org Subject: Re: [PATCH v4 0/4] arm64: Run kernel mode NEON with preemption enabled Date: Mon, 11 Dec 2023 20:27:27 +0000 Message-Id: <170231871028.1857077.10318072500676133330.b4-ty@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20231208113218.3001940-6-ardb@google.com> References: <20231208113218.3001940-6-ardb@google.com> Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Hey Ard, On Fri, 8 Dec 2023 12:32:19 +0100, Ard Biesheuvel wrote: > From: Ard Biesheuvel > > Currently, kernel mode NEON (SIMD) support is implemented in a way that > requires preemption to be disabled while the SIMD registers are live. > The reason for this is that those registers are not in the set that is > preserved/restored on exception entry/exit and context switch, as this > would impact performance generally, even for workloads where kernel mode > SIMD is not the bottleneck. > > [...] I applied the first three patches to for-next/fpsimd: [1/4] arm64: fpsimd: Drop unneeded 'busy' flag https://git.kernel.org/arm64/c/e109130b0e5e [2/4] arm64: fpsimd: Preserve/restore kernel mode NEON at context switch https://git.kernel.org/arm64/c/1e3a3de1ff6c [3/4] arm64: fpsimd: Implement lazy restore for kernel mode FPSIMD https://git.kernel.org/arm64/c/035262623959 It would be nice to have an Ack from Herbert on the last one so that he's aware of the possible conflicts. The other thing I tangentially wondered about is what happens now if code calls uaccess routines (e.g. get_user()) within a kernel_neon_{begin,end} section? I think previously the fact that preemption had to be disabled would've caused the might_fault() to explode, but now I suppose the BUG_ON() in kernel_neon_begin() will save us. Is that right? Cheers, -- Will https://fixes.arm64.dev https://next.arm64.dev https://will.arm64.dev