This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: glibc clears AT_HWCAP and set only HW_CAP_X86_64 (0x2)


On 10/17/19 11:29 AM, Baojun Wang wrote:
> Hi libc,
> 
> when calling getauxval(AT_HWCAP), it returns 0x2, because of below snippet:
> 
> https://code.woboq.org/userspace/glibc/sysdeps/x86/cpu-features.c.html#510
> 
> Is there any reason why glibc don't use the values passed from kernel auxv?

I don't know of any good reason.

The semantics of getauxval() is to provide the auxiliary vector data.

In this case glibc *does* read AT_HWCAP, but then for x86 it overrides it
with a computed value based on cpuid.

HJ, Is there any reason we do this?

Baojun, Do you see a difference between getauxval() return and real AT_HWCAP?

-- 
Cheers,
Carlos.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]