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] Save fp registers on x64 function resolution.


On Fri, Jul 26, 2013 at 05:37:06PM +0200, Andreas Jaeger wrote:
> On 07/26/2013 11:15 AM, OndÅej BÃlka wrote:
> > Hi, as having to manually save xmm registers causes many issues recently
> > (memset issues, bug 15786...) this patch save xmm registers. If you
> > accept it to 2.19 further cleanups will follow. 
> 
> 
> The question here is whether we state that the resolver and any
> functions it calls - including IFUNC resolvers - are allowed to touch
> xmm registers or not. In the past, we were fine with not touching xmm
> registers - but now with IFUNC, it's for sure safer to save xmm as well.
> But it comes with a cost.
> 
> At minimum, we should document what IFUNCs are allowed to do and what not.
> 
> 
> > We could also add register saving for other architectures.
> > 
> > As performance is concerned not saving registers looks like saving at
> > wrong place. It causes dl_fixup code not to use sse functions variants
> > that could have bigger slowdown than what was saved by not saving
> > registers.
> > 
> > I do not have measurements yet, it would need to add rdtsc to _dl_fixup
> > as it is and _dl_fixup with rtld-*.S, -mno-sse and other hacks removed.
> > 
> > Comments?
> 
> Regarding the code itself:
> We already do a "subq $56,%rsp" to reserve stack-space, so let's combine
> those with the subq128 you have. This also deserves a comment why this
> is needed.
> 
OK, also
> >  	movq %rax, %r11		# Save return value
seems retundant as you do not pass arguments via %rax. 
> >  	movq 48(%rsp), %r9	# Get register content back.
> >  	movq 40(%rsp), %r8
> > 
> 
> 
> -- 
>  Andreas Jaeger aj@{suse.com,opensuse.org} Twitter/Identica: jaegerandi
>   SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 NÃrnberg, Germany
>    GF: Jeff Hawn,Jennifer Guild,Felix ImendÃrffer,HRB16746 (AG NÃrnberg)
>     GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126

-- 

manager in the cable duct


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