From patchwork Fri Oct 4 20:26:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 13823037 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 D9258CF885B for ; Fri, 4 Oct 2024 21:47:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To: Content-Transfer-Encoding:Content-Type: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=s3aYyXsKB0+xzODj/FoX6oW5lI67PBEatcNQS9wJNEw=; b=t/f6F2b+udTzpc g7QEoQrZTHI1Dd9T3WSj3X9XMDgPDIhB7ye+wH96uYPaGsc9HF2TU7847zNfkGBGU5eolBgKNA3ow lHkQuqzAtsvFYDjCKg/lPtTTAA93E/r+idhEPLKlYv4zGsVq3msGqRVF+zMDJWd0tIUkGxSDfTq6B AVuhmKiXq0ZvG8B934WpnPlRwJmqtk3kn6h6poONuB4Sj6u0uSP7lv4kA+GCp8LYrE/jhjbbDQuE0 CPSfw4FYKXvMFGVdyCjq8B5YT/r5van3B9hnkhGCh6Ljgbz1yiEeUdhMv+fNsTfb4q2n664dwEXSK yLwqya1TzlebSUWIhGUw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1swq8g-0000000EI43-2d5E; Fri, 04 Oct 2024 21:47:06 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1swovU-0000000E9Ih-3WI7 for linux-arm-kernel@lists.infradead.org; Fri, 04 Oct 2024 20:30:10 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 0CAAC5C58DE; Fri, 4 Oct 2024 20:29:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DBD1CC4CEC6; Fri, 4 Oct 2024 20:29:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1728073763; bh=XHZLQD1ErzRyqIdudTG5gz6C2Niq7KA9cBpxBxsq1PM=; h=From:Subject:Date:To:Cc:From; b=DQjqsV9ZyLP+OLobIy07JccH8vO2TK7+oKw1U5fWy4wesiHf7Cz3oyTHXkMgdyFrK gZ10jSl56ehxhOVGaMA4VLHZtY+gT21RzncgbNTejypeNz3Y0Xzo03Mqfiv9KDdxKc 5GtozZwzwU4cnf58v8P775bAHqj5DhMFwrSRBX37DAY667GNf+wY9Gg7XVskUIc3Z0 j1X6HO8sINK4YDw8ODqVI3ViVvm5rmMwRuveHYSJAtICdq+qFDOJ8JCtv9haQs/ycM r/lWe+caGEg2i1x2QG0rZA0HeUBs93FKrY3wiUJL9b2f7JerxYGsn9MVL5HXmaFHxR 59TZT9/QlFMdQ== From: Mark Brown Subject: [PATCH RFC v2 0/2] arm64: Add infrastructure for use of AT_HWCAP3 Date: Fri, 04 Oct 2024 21:26:28 +0100 Message-Id: <20241004-arm64-elf-hwcap3-v2-0-799d1daad8b0@kernel.org> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAHRPAGcC/2WNzQqDMBCEX0X23C3RGH96KhT6AL0WD0FXDVUjm 5K2SN69QXrr8ZthvtnAERtycEo2YPLGGbtEyA4JtKNeBkLTRYZMZLmohULNc5EjTT2Or1avEst S1K1StexkDnG2MvXmvSvvcLteoInhaNzT8me/8ele/YzFv9GnKLDq+lQrKqQS1flBvNB0tDxAE 0L4AvB+mga2AAAA X-Change-ID: 20240905-arm64-elf-hwcap3-7709c5593d34 To: Alexander Viro , Christian Brauner , Jan Kara , Eric Biederman , Kees Cook , Catalin Marinas , Will Deacon , Jonathan Corbet Cc: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Yury Khrustalev , Wilco Dijkstra , linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, Mark Brown X-Mailer: b4 0.15-dev-9b746 X-Developer-Signature: v=1; a=openpgp-sha256; l=2178; i=broonie@kernel.org; h=from:subject:message-id; bh=XHZLQD1ErzRyqIdudTG5gz6C2Niq7KA9cBpxBxsq1PM=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBnAFAe7saB3zi5hDCkIVqUtEaorraDTp3QVFiYEQoL if1JERqJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCZwBQHgAKCRAk1otyXVSH0FHHB/ 9+tUh1y+t4MdvijrHJlvp3/g3m9azLRNbbXAVxebaU4mpT/rTRb5MktPyAJf7u8R6k9h2PRkWhTGfR TYQOfK/iUJxoMO19RYWweJ7n6J0/GIrdDcYhLTKaAGwBmZ8FKJJt79Wa+D6KmITPFeW2sdDjaAjAWa E7eLXoSG7TQW0c3IJu2xm+Uza2+WBRsZpV2wgIkkOenzkdj3mPE8UtxWYGEdzT5vE52QLRoipF2o9B bEAoKhzLoq5bhFR+BDDX+BnE04GtT+mUzds9Aq9NDvw66htgkkgKlEonir8/EotyE/WWCB5Fs9Rw+K vQs1YdMhSTFQeWGm6wDjNv2V/4q7a1 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-20241004_132925_002024_436C4BC4 X-CRM114-Status: GOOD ( 12.70 ) 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 Since arm64 has now used all of AT_HWCAP2 it needs to either start using AT_HWCAP3 (which was recently added for PowerPC) or start allocating bits 32..61 of AT_HWCAP first. Those are documented in elf_hwcaps.rst as unused and in uapi/asm/hwcap.h as unallocated for potential use by libc, glibc does currently use bits 62 and 63. This series has the code for enabling AT_HWCAP3 as a reference. While we've decided to go with using the high bits of AT_HWCAP for now we will exhaust those at some point so it seems helpful to have this code available in order to make life easier when we do need to start using AT_HWCAP3. This seems like it might come up relatively quickly, for the past few years the dpISA has used ~15 hwcaps due to the fine grained feature definitions and the fact that SVE and SME need independent definitions of everything. When we do start using HWCAP3 we'll potentially have multiple serieses that need to share the addition so it seems like it might be helpful to have the scaffolding in place at least the release before it's actuallly required in order to make things more managable. That's not an issue *now* but could come up surprisingly quickly. Signed-off-by: Mark Brown --- Changes in v2: - Rebase onto v6.12-rc1. - Fix cut'n'paste 3/4 issues. - Link to v1: https://lore.kernel.org/r/20240906-arm64-elf-hwcap3-v1-0-8df1a5e63508@kernel.org --- Mark Brown (2): binfmt_elf: Wire up AT_HWCAP3 at AT_HWCAP4 arm64: Support AT_HWCAP3 Documentation/arch/arm64/elf_hwcaps.rst | 6 +++--- arch/arm64/include/asm/cpufeature.h | 3 ++- arch/arm64/include/asm/hwcap.h | 6 +++++- arch/arm64/include/uapi/asm/hwcap.h | 4 ++++ arch/arm64/kernel/cpufeature.c | 6 ++++++ fs/binfmt_elf.c | 6 ++++++ fs/binfmt_elf_fdpic.c | 6 ++++++ fs/compat_binfmt_elf.c | 10 ++++++++++ 8 files changed, 42 insertions(+), 5 deletions(-) --- base-commit: 9852d85ec9d492ebef56dc5f229416c925758edc change-id: 20240905-arm64-elf-hwcap3-7709c5593d34 Best regards,