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: PATCH: Add AVX support to x86-64 _dl_runtime_profile


On Thu, Jul 16, 2009 at 11:29 AM, H.J. Lu<hjl.tools@gmail.com> wrote:
> On Wed, Jul 15, 2009 at 6:15 PM, Ulrich Drepper<drepper@redhat.com> wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> I think I got your patches applied.
>>
>> But then I changed the whole approach quite a bit. ?The problem is that
>> your patches create a writable code pointer. ?That's bad security-wise.
>> ?Instead I opted for the slightly slower test of a flag and just one
>> code path. ?This is a tad slower but safer.
>>
>> I also fixed a few problems:
>>
>> - - the decision whether to use xmm or ymm content is not all or nothing.
>> ?it's per register
>
> What happens when both xmm1 and ymm1 are modified?
>
>> - - you didn't restore the FP stack correctly after pltexit
>>
>>
>> There are two more things to do:
>>
>> - - the test for AVX availability should be done only once. ?It should
>> ?move into the code which selected which trampoline code to use
>
> Can't we extend IFUNC support to ld.so?

Here is the patch to use IFUNC in ld.so for AVX support. Tested on AVX
emulator. The Linux binutils 2.19.51.0.12 is needed for this.

>> - - the XMM restoration when YMM is available is not enough. ?If there
>> ?are stacked audit modules we have to check whether the XMM part is
>> ?modified, propagate the new content if necessary into the YMM
>> ?element, and update the "old value" field
>>
>
> Do you have a testcase?

I am not sure how it should work. If you have a testcase, I
will look into it.

Thanks.

-- 
H.J.
--
2009-07-16  H.J. Lu  <hongjiu.lu@intel.com>

	* sysdeps/x86_64/dl-machine.h (elf_machine_rela): Handle
	R_X86_64_IRELATIVE in ld.so.

	* sysdeps/x86_64/dl-trampoline.S (_dl_runtime_profile): Move
	saving and restoring SSE/AVX registers to ...
	* sysdeps/x86_64/dl-trampoline.h: This.  New.

	* sysdeps/x86_64/dl-trampoline.S (_dl_runtime_profile): Jump
	save_and_restore_vector if AVX and MULTIARCH are used.
	(save_and_restore_vector_sse): New.
	(save_and_restore_vector_avx): Likewise.
	(save_and_restore_vector): Likewise.

Attachment: libc-avx-6.patch
Description: Text document


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