This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] powerpc: New feature - HWCAP/HWCAP2 bits in the TCB
- From: Steven Munroe <munroesj at linux dot vnet dot ibm dot com>
- To: Szabolcs Nagy <szabolcs dot nagy at arm dot com>
- Cc: Carlos Eduardo Seo <cseo at linux dot vnet dot ibm dot com>, GLIBC Devel <libc-alpha at sourceware dot org>, Steve Munroe <sjmunroe at us dot ibm dot com>
- Date: Tue, 09 Jun 2015 11:04:05 -0500
- Subject: Re: [PATCH] powerpc: New feature - HWCAP/HWCAP2 bits in the TCB
- Authentication-results: sourceware.org; auth=none
- References: <55760314 dot 6070601 at linux dot vnet dot ibm dot com> <5576FC80 dot 1090806 at arm dot com> <1433862393 dot 21101 dot 9 dot camel at sjmunroe-ThinkPad-W500> <55770ABA dot 1010205 at arm dot com>
- Reply-to: munroesj at linux dot vnet dot ibm dot com
On Tue, 2015-06-09 at 16:48 +0100, Szabolcs Nagy wrote:
>
> On 09/06/15 16:06, Steven Munroe wrote:
> > On Tue, 2015-06-09 at 15:47 +0100, Szabolcs Nagy wrote:
> >> i assume this is for multi-versioning.
> >
> > The intent is for the compiler to implement the equivalent of
> > __builtin_cpu_supports("feature"). X86 has the cpuid instruction, POWER
> > is RISC so we use the HWCAP. The trick to access the HWCAP[2]
> > efficiently as getauxv and scanning the auxv is too slow for inline
> > optimizations.
>
> i think getauxv is not usable by the compiler anyway,
> it's not a standard api.
>
> >> i dont see how the compiler can generate code to access the
> >> hwcap bits currently (without making assumptions about libc
> >> interfaces).
> >>
> > These offset will become a durable part the PowerPC 64-bit ELF V2 ABI.
> >
> > The TCB offsets are already fixed and can not change from release to
> > release.
>
> hard coded arch specific tcb offsets make sure that
> targets need different tcb layout which means more
> target specific maintainance instead of common c code.
>
> >> if hwcap is useful abi between compiler and libc
> >> then why is this done in a powerpc specific way?
> >
> > Other platform are free use this technique.
>
> i think this is not a sustainable approach for
> compiler abi extensions.
>
> (it means juggling with magic offsets on the order
> of compilers * libcs * targets).
>
> unfortunately accessing the ssp canary is already
> broken this way, i'm not sure what's a better abi,
> but it's probably worth thinking about one before
> the tcb code gets too messy.
>
I have thought about it.
Based on my detailed knowledge of the PowerISA and PowerPC ABIs this the
simplest and fastest solution.