From patchwork Wed Mar 6 23:14:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 13584754 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CC9CDC54E41 for ; Wed, 6 Mar 2024 23:15:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:MIME-Version:Message-Id:Date: Subject:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=AYvrp3OWi/svZtWwpnDYzTnlM557zDqC1RhsRaVUHsg=; b=aKVHBz8QBw/8fY irXkUNwzNRA3h/G3D6U617D61L308PEXx2vlBpXnnOtgEcLuOEkUL88dyQg0+bPAeE+Q7wZ3PMaEc TW5FCYcbQLtVo+LgneAbXcix+dXdEiLvBPD00dSs8aiOH+WSR+IrBpBLS7K8ql7IugcYPwNUh8pf5 oOsTFTUvyQGrnaRC7e8Kw7tU6TrFwhaTtfDFuZZnmoNKy8D0SI9/2/q9vtvREuMF1qNxr0AFX1Y5c N9vU0domoloq7Y6qajLsEz1c+Zc/wdRCehI8vdpEkB8tSlK1TEilAv0C2dUFqc6SdKO1FhOtBzrkz +O+zNNvI549xma5I4UBg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1ri0Ty-00000002Brn-1nej; Wed, 06 Mar 2024 23:15:30 +0000 Received: from sin.source.kernel.org ([2604:1380:40e1:4800::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1ri0Tu-00000002BpD-1Nzg for linux-arm-kernel@lists.infradead.org; Wed, 06 Mar 2024 23:15:28 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 7D715CE2392; Wed, 6 Mar 2024 23:15:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 08E64C43390; Wed, 6 Mar 2024 23:15:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709766923; bh=hVYfvyWt2Y75bJeV4nbC5bLWMRIModbsxKyhoExAj58=; h=From:Subject:Date:To:Cc:From; b=umFp+x8mmmwKh5Ibc8r/84NYhN0tSs/nsPNty84UvAJBWEtJTRIFaejJb3lc/NiD3 QfUJcTGPFKBGVeO+kYDZoszlqlGykYo0vjNc6kb5ri0NrAKMqfHYP19I72IZVkdgX3 GTO2oquiM9bXn+u0QlXHnm4pI0DXuwRg+KnWTxH4GbCNYCekx2BzXWn820h9H6JNf1 wfoZ7Mq11GH5R2OtpoNZkfHkAEhCzgVdooRR2cucuHRCkLxjcYVQYETp915gtRBzkt LHHeXrLR2J4okSCorIuIBHxsj9btnBzrsNAaP/PZf6/wwMZ5mVD6WITnCvEw3L+nEa Y0nNrtKtyQ6Dg== From: Mark Brown Subject: [PATCH v5 0/9] arm64: Support for 2023 DPISA extensions Date: Wed, 06 Mar 2024 23:14:45 +0000 Message-Id: <20240306-arm64-2023-dpisa-v5-0-c568edc8ed7f@kernel.org> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAOX46GUC/23N0QrCIBTG8VcZXmfo8UxdV71HdOGma1JtQ0OK2 LvnoojYLv8fnN95kuiCd5HsiicJLvnohz5HuSlI05n+5Ki3uQkwEJwxQU24SqRzUjv6aCi0wkK pUKJCks/G4Fp/f5OHY+7Ox9sQHu8Pic/rBwO5xBKnjGpUzNpKV3UN+7MLvbtsh3Ais5bgJ3COK wJkARWUXFfYSqMXgvgJwMoVQWTB1k3dWC2VUe1CwK+AjAOsCJgFpaRjFWrJ7b8wTdMLoXy8Snc BAAA= To: Catalin Marinas , Will Deacon , Marc Zyngier , Oliver Upton , James Morse , Suzuki K Poulose , Jonathan Corbet , Shuah Khan Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Dave Martin , kvmarm@lists.linux.dev, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org, Mark Brown X-Mailer: b4 0.13-dev-a684c X-Developer-Signature: v=1; a=openpgp-sha256; l=3927; i=broonie@kernel.org; h=from:subject:message-id; bh=hVYfvyWt2Y75bJeV4nbC5bLWMRIModbsxKyhoExAj58=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBl6PkAd6j3trVRH3TryRsMJsSJpFXc/h6DInBNgN/X TYlUskaJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCZej5AAAKCRAk1otyXVSH0MLpB/ 9aYoLdvnNvFjJfLHpXdTOuk1B2GKeK5b+uPqY6LiTUy/oyqNPC91J9LRXOsbtJWz5I2oQ7+QKfp4+N bmZC2JrSKSEFEV5towSsOQYLcFz78Rxnt4BBIVuAvFNcW/SR6Cn3vi5uU0nMsTNDwK/K+oPInuV4ch s+gzWSwvmU+VNFIm087gKRMxfmkUMsc1YXD80UcPztVmP9+uXEzy3nzMMpootzpxiLeAiijMEsiI/u hNeISZ66rUZ6ZcmlHjlwcS+UQg4vzGm2AQfpeJGC7UJa6r+rrKok/ZJLPwSXqymZTOvbGVIfb/V3vR jPCEslf9X909MXtzw8dxKCI3OEb8J2 X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240306_151526_800930_1DECB8F0 X-CRM114-Status: GOOD ( 14.42 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This series enables support for the data processing extensions in the newly released 2023 architecture, this is mainly support for 8 bit floating point formats. Most of the extensions only introduce new instructions and therefore only require hwcaps but there is a new EL0 visible control register FPMR used to control the 8 bit floating point formats, we need to manage traps for this and context switch it. Due to the very recently merged KVM changes for configuring guest features via ID register writes only being available in -next the support for guest state has been dropped for this version, the relevant KVM interfaces should all be there after the merge window so the code will be refreshed for the new interfaces then. I've not added test coverage for ptrace, my plan is to add support to fp-ptrace (which is now merged so I'll update after the merge window). Signed-off-by: Mark Brown --- Changes in v5: - Rebase onto v6.8-rc3. - Use u64 rather than unsigned long for storing FPMR. - Temporarily drop KVM guest support due to issues with KVM being a moving target. - Link to v4: https://lore.kernel.org/r/20240122-arm64-2023-dpisa-v4-0-776e094861df@kernel.org Changes in v4: - Rebase onto v6.8-rc1. - Move KVM support to the end of the series. - Link to v3: https://lore.kernel.org/r/20231205-arm64-2023-dpisa-v3-0-dbcbcd867a7f@kernel.org Changes in v3: - Rebase onto v6.7-rc3. - Hook up traps for FPMR in emulate-nested.c. - Link to v2: https://lore.kernel.org/r/20231114-arm64-2023-dpisa-v2-0-47251894f6a8@kernel.org Changes in v2: - Rebase onto v6.7-rc1. - Link to v1: https://lore.kernel.org/r/20231026-arm64-2023-dpisa-v1-0-8470dd989bb2@kernel.org --- Mark Brown (9): arm64/cpufeature: Hook new identification registers up to cpufeature arm64/fpsimd: Enable host kernel access to FPMR arm64/fpsimd: Support FEAT_FPMR arm64/signal: Add FPMR signal handling arm64/ptrace: Expose FPMR via ptrace arm64/hwcap: Define hwcaps for 2023 DPISA features kselftest/arm64: Handle FPMR context in generic signal frame parser kselftest/arm64: Add basic FPMR test kselftest/arm64: Add 2023 DPISA hwcap test coverage Documentation/arch/arm64/elf_hwcaps.rst | 49 +++++ arch/arm64/include/asm/cpu.h | 3 + arch/arm64/include/asm/cpufeature.h | 5 + arch/arm64/include/asm/fpsimd.h | 2 + arch/arm64/include/asm/hwcap.h | 15 ++ arch/arm64/include/asm/kvm_arm.h | 2 +- arch/arm64/include/asm/kvm_host.h | 1 + arch/arm64/include/asm/processor.h | 4 + arch/arm64/include/uapi/asm/hwcap.h | 15 ++ arch/arm64/include/uapi/asm/sigcontext.h | 8 + arch/arm64/kernel/cpufeature.c | 72 +++++++ arch/arm64/kernel/cpuinfo.c | 18 ++ arch/arm64/kernel/fpsimd.c | 13 ++ arch/arm64/kernel/ptrace.c | 42 ++++ arch/arm64/kernel/signal.c | 59 ++++++ arch/arm64/kvm/fpsimd.c | 1 + arch/arm64/tools/cpucaps | 1 + include/uapi/linux/elf.h | 1 + tools/testing/selftests/arm64/abi/hwcap.c | 217 +++++++++++++++++++++ tools/testing/selftests/arm64/signal/.gitignore | 1 + .../arm64/signal/testcases/fpmr_siginfo.c | 82 ++++++++ .../selftests/arm64/signal/testcases/testcases.c | 8 + .../selftests/arm64/signal/testcases/testcases.h | 1 + 23 files changed, 619 insertions(+), 1 deletion(-) --- base-commit: 54be6c6c5ae8e0d93a6c4641cb7528eb0b6ba478 change-id: 20231003-arm64-2023-dpisa-2f3d25746474 Best regards,