Page MenuHomeFreeBSD

Add AT_HWCAP2 ELF auxiliary vector.
ClosedPublic

Authored by mmel on Oct 17 2017, 1:31 PM.
Tags
None
Referenced Files
F82155116: D12699.id34179.diff
Fri, Apr 26, 12:32 AM
F82152878: D12699.id34208.diff
Fri, Apr 26, 12:05 AM
F82152685: D12699.id.diff
Fri, Apr 26, 12:03 AM
Unknown Object (File)
Fri, Apr 12, 8:18 AM
Unknown Object (File)
Mar 18 2024, 6:06 AM
Unknown Object (File)
Jan 14 2024, 10:03 PM
Unknown Object (File)
Nov 12 2023, 1:01 PM
Unknown Object (File)
Nov 11 2023, 8:56 AM

Details

Summary
  • allocate value for new AT_HWCAP2 auxiliary vector on all platforms.
  • expand 'struct sysentvec' by new 'u_long *sv_hwcap2', in exactly same way as for AT_HWCAP.

MFC after: 1 month

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

lib/libc/gen/auxv.c
223 ↗(On Diff #34058)

I do not follow the motivation of fetching the aux values into the variables and then again parsing the AT_XXX indexes to find which variable to fetch. Why not return raw value from the aux vector with the corresponding AT_XXX name, directly ?

lib/libc/gen/auxv.c
223 ↗(On Diff #34058)

Because of data types. AT_HWCAP's are ulong's, rest are int's. I can sort this case by returned data type then use _elf_aux_info(), if you find this more appropriate.

lib/libc/gen/auxv.c
223 ↗(On Diff #34058)

What are ints ? The return type of getauxval() is u_long, and Auxinfo.a_val has the long type.

My exp-run for selected ports just ended and It found unexpected problem.
Some ports detect getauxval() presence and if is present then expect that all (linux specific) AT_ flags are defined and implemented (e.g. security/p11-kit ).

I don't want to emulated full Linux behavior here, so it's time for plan B
As alternative we can make _elf_aux_info() public (as elf_aux_info()). If is this acceptable, can you please suggest me best/suitable header for this function?
Is (new) auxv.h still OK?

This approach result to slightly bigger patches for ports (that getauxval), but it's still acceptable I think.

In D12699#263852, @meloun-miracle-cz wrote:

My exp-run for selected ports just ended and It found unexpected problem.
Some ports detect getauxval() presence and if is present then expect that all (linux specific) AT_ flags are defined and implemented (e.g. security/p11-kit ).

I don't want to emulated full Linux behavior here, so it's time for plan B
As alternative we can make _elf_aux_info() public (as elf_aux_info()). If is this acceptable, can you please suggest me best/suitable header for this function?
Is (new) auxv.h still OK?

This approach result to slightly bigger patches for ports (that getauxval), but it's still acceptable I think.

auxv.h is fine. Exporting elf_aux_info as weak symbol is also fine. Make sure that the interposable symbol is not used by libc or libthr.

mmel retitled this revision from Add AT_HWCAP2 ELF auxiliary vector. Implement new libc function getauxv(3). to Add AT_HWCAP2 ELF auxiliary vector. Implement new libc function elf_aux_info(3)..
mmel edited the summary of this revision. (Show Details)

Drop getauxval(), make _elf_aux_info() public.

Perhaps split addition of AT_HWCAP2 and libc export commits.

@jhb planned to unify AT_XXX vector numbers across all arches, FYI.

sys/sys/auxv.h
35 ↗(On Diff #34111)

?

mmel retitled this revision from Add AT_HWCAP2 ELF auxiliary vector. Implement new libc function elf_aux_info(3). to Add AT_HWCAP2 ELF auxiliary vector. .
mmel edited the summary of this revision. (Show Details)

Split out libc changes

This revision was automatically updated to reflect the committed changes.