This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: RFC: Should x86-64 support arbitrary calling conventions?
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Florian Weimer <fw at deneb dot enyo dot de>
- Cc: Szabolcs Nagy <szabolcs dot nagy at arm dot com>, Alexander Monakov <amonakov at ispras dot ru>, nd <nd at arm dot com>, Zack Weinberg <zackw at panix dot com>, "Kreitzer, David L" <david dot l dot kreitzer at intel dot com>, "Carlos O'Donell" <carlos at redhat dot com>, GNU C Library <libc-alpha at sourceware dot org>, "Joseph S. Myers" <joseph at codesourcery dot com>, Jeff Law <law at redhat dot com>, "Maslov, Sergey V" <sergey dot v dot maslov at intel dot com>
- Date: Mon, 27 Mar 2017 09:08:52 -0700
- Subject: Re: RFC: Should x86-64 support arbitrary calling conventions?
- Authentication-results: sourceware.org; auth=none
- References: <CAMe9rOoLSU=zfhdS1DqKQVr-5Hr9jqBjoR_CMUyFHQ8JKJfwZw@mail.gmail.com> <20170316232737.GD24205@vapier> <CAMe9rOrx5Kzwniv+UqQ+xi2FpDBf8sFeogimwcS6YUHuT2pk+Q@mail.gmail.com> <100440FED7798443A51E0730E25E29E85AAC14B5@fmsmsx117.amr.corp.intel.com> <a6e085c3-884d-3156-9b43-35094dfbc042@redhat.com> <100440FED7798443A51E0730E25E29E85AAD9939@fmsmsx117.amr.corp.intel.com> <CAMe9rOrfoekW=gu8_sWTiTECedJCVs1xZ7byZFT15a_Kxk6LAw@mail.gmail.com> <87shm3f2bj.fsf@mid.deneb.enyo.de> <CAMe9rOpve0gyP6a-3zjzTJFpzxG-qVW0ycrCLzEYyC56U3LfbA@mail.gmail.com> <871stmaalw.fsf@mid.deneb.enyo.de> <CAKCAbMg2a6u_14VijWH+Jycnr4NHZkNMq0Y9EGT39ko0qjmsaQ@mail.gmail.com> <87r31m8uyk.fsf@mid.deneb.enyo.de> <CAKCAbMj1m+d+QdOD8nGewcEe=-1RFjCz=nJS0tdD_hva5995FA@mail.gmail.com> <58D8EC19.6030505@arm.com> <alpine.LNX.2.20.13.1703271409130.7566@monopod.intra.ispras.ru> <58D8F779.30509@arm.com> <CAMe9rOr+=4cys-ttahKBPNOCc6e1ktHJ5YWneCGTJLjYPYHA2A@mail.gmail.com> <87lgrqogb2.fsf@mid.deneb.enyo.de>
On Mon, Mar 27, 2017 at 9:06 AM, Florian Weimer <fw@deneb.enyo.de> wrote:
> * H. J. Lu:
>
>> Even without IFUNC nor SSE in ld.so, we still need to deal with
>>
>> RTLD_PREPARE_FOREIGN_CALL
>>
>> which may clobber vector registers.
>
> I think RTLD_PREPARE_FOREIGN_CALL is a no-op in current master. It's
> never defined.
It was removed from x96-64 by
commit f3dcae82d54e5097e18e1d6ef4ff55c2ea4e621e
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Tue Aug 25 04:33:54 2015 -0700
Save and restore vector registers in x86-64 ld.so
This patch adds SSE, AVX and AVX512 versions of _dl_runtime_resolve
and _dl_runtime_profile, which save and restore the first 8 vector
registers used for parameter passing. elf_machine_runtime_setup
selects the proper _dl_runtime_resolve or _dl_runtime_profile based
on _dl_x86_cpu_features. It avoids race condition caused by
FOREIGN_CALL macros, which are only used for x86-64.
Performance impact of saving and restoring 8 vector registers are
negligible on Nehalem, Sandy Bridge, Ivy Bridge and Haswell when
ld.so is optimized with SSE2.
--
H.J.