This is the mail archive of the libc-alpha@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: [PATCHv2] powerpc: ABI change - add HWCAP/HWCAP2/platform info to TCB


Hi Carlos

Thanks for your suggestions. I have a couple questions:

> On Aug 27, 2015, at 10:34 AM, Carlos O'Donell <carlos@redhat.com> wrote:
> 
> On 08/26/2015 10:49 PM, Steven Munroe wrote:
>> I really should not work after 9:00PM ... :(
>> 
>>> I think the comments and documentation should be explicit with the
>>> following assumptions.
>>> 
>>> The initialization of the static variables __tcb_hwcap, __tcb_platform
>>> and __tcb_hwcap_init must occur before main() gets control and before
>>> any other threads can exist.
>>> 
>> Before Library init/ctors and main() get control for the main thread.
> 
> That sounds like a good design goal. In which case you also have to do
> this before auditing libraries are initialized. Therefore it has to happen
> very early, earlier than TLS_INIT_TP for the main thread, so you may need
> to do it in dl_platform_init(), though you'll have to check.

I was running some tests with dl_platform_init() (calling the init_hwcapinfo() code in there to populate my global variables) and it works fine in the dynamic linking case, but it does not seem to work for the static case, even though I see a placeholder for DL_PLATFORM_INIT in elf/dl-support.c. Am I missing something? 

> 
> The code comments should make these assumptions clear e.g. early init.
> 
>>> The TCB fields hwcap and at_platform must be initialized from the
>>> corresponding static variables before: Library init/ctors get control
>>> for the main thread, and before any new thread gets control from clone.
>>> 
>> before: Library init/ctors and main() get control for the main thread,
>> and before any new thread gets control from clone.
> 
> That also sounds good. You'll likely need to do this in the nptl code
> that starts the thread e.g. createthread.c via TLS_DEFINE_INIT_TP.


Iâm not sure if I understand what you mean by this. What exactly needs to be done in TLS_DEFINE_INIT_TP?

Thanks,

-- 
Carlos Eduardo Seo
Software Engineer - Linux on Power Toolchain
cseo@linux.vnet.ibm.com

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