Thread (8 messages) 8 messages, 3 authors, 2023-10-18

Re: [PATCH] uapi/auxvec: Define AT_HWCAP3 and AT_HWCAP4 aux vector, entries

From: Adhemerval Zanella Netto <hidden>
Date: 2023-09-27 16:04:04
Also in: linux-arch, linuxppc-dev


On 26/09/23 19:02, Peter Bergner wrote:
The powerpc toolchain keeps a copy of the HWCAP bit masks in our TCB for fast
access by our __builtin_cpu_supports built-in function.  The TCB space for
the HWCAP entries - which are created in pairs - is an ABI extension, so
waiting to create the space for HWCAP3 and HWCAP4 until we need them is
problematical, given distro unwillingness to apply ABI modifying patches
to distro point releases.  Define AT_HWCAP3 and AT_HWCAP4 in the generic
uapi header so they can be used in GLIBC to reserve space in the powerpc
TCB for their future use.
This is different than previously exported auxv, where each AT_* constant
would have a auxv entry. On glibc it would require changing _dl_parse_auxv
to iterate over the auxv_values to find AT_HWCAP3/AT_HWCAP4 (not ideal, 
but doable).

Wouldn't be better to always export it on fs/binfmt_elf.c, along with all 
the machinery to setup it (ELF_HWCAP3, etc), along with proper documentation?
quoted hunk ↗ jump to hunk
I scanned both the Linux and GLIBC source codes looking for unused AT_*
values and 29 and 30 did not seem to be used, so they are what I went
with.  If anyone sees a problem with using those specific values, I'm
amenable to using other values, just let me know what would be better.

Peter


Signed-off-by: Peter Bergner <redacted>
---
 include/uapi/linux/auxvec.h | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/include/uapi/linux/auxvec.h b/include/uapi/linux/auxvec.h
index 6991c4b8ab18..cc61cb9b3e9a 100644
--- a/include/uapi/linux/auxvec.h
+++ b/include/uapi/linux/auxvec.h
@@ -32,6 +32,8 @@
 #define AT_HWCAP2 26	/* extension of AT_HWCAP */
 #define AT_RSEQ_FEATURE_SIZE	27	/* rseq supported feature size */
 #define AT_RSEQ_ALIGN		28	/* rseq allocation alignment */
+#define AT_HWCAP3 29	/* extension of AT_HWCAP */
+#define AT_HWCAP4 30	/* extension of AT_HWCAP */
 
 #define AT_EXECFN  31	/* filename of program */
 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help