mbox series

[RFC,v2,0/2] arm64: Add infrastructure for use of AT_HWCAP3

Message ID 20241004-arm64-elf-hwcap3-v2-0-799d1daad8b0@kernel.org (mailing list archive)
Headers show
Series arm64: Add infrastructure for use of AT_HWCAP3 | expand

Message

Mark Brown Oct. 4, 2024, 8:26 p.m. UTC
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 <broonie@kernel.org>
---
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,

Comments

Catalin Marinas Oct. 17, 2024, 5:58 p.m. UTC | #1
On Fri, 04 Oct 2024 21:26:28 +0100, Mark Brown wrote:
> 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.
> 
> [...]

Applied to arm64 (for-next/hwcap3), thanks! I decided to queue this now
as we seem to burn through about 15 hwcaps at a time with features like
dpISA. It gives libcs out there a bit of time to wire it up.

[1/2] binfmt_elf: Wire up AT_HWCAP3 at AT_HWCAP4
      https://git.kernel.org/arm64/c/4e6e8c2b757f
[2/2] arm64: Support AT_HWCAP3
      https://git.kernel.org/arm64/c/ddadbcdaaed5