memcpy regression

Michael Ellerman mpe at ellerman.id.au
Tue Sep 8 13:54:22 AEST 2015


On Mon, 2015-09-07 at 10:59 +0000, David Laight wrote:
> From: Michal Sojka
> > >> I think GCC uses memcpy() in well known situations like initialising
> > >> structures or copying structures.
> > >> Shouldn't we just avoid this kind of actions in the very few early init
> > >> functions ?
> > > Which are the "very few" early init functions? Can you make a list, for 32-bit
> > > and 64-bit? And can we keep it updated over time and not introduce regressions?
> > >
> > If the code that runs without caches is concentrated in few files, we
> > may either modify the buildsystem to check whether there is a call to
> > memcpy from these files (e.g. by using nm) or these files can be
> > "prelinked" with special version of memcpy that doesn't require caches.
> > Would any of these be acceptable?
> 
> What about run-time patching memcpy() after the caches are initialised?

Yeah, that's the solution we use on 64-bit.

It also means you can have cpu specific optimisations, which can be patched in
or out using the cpu feature patching.

cheers




More information about the Linuxppc-dev mailing list