stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* arm64 memcpy+memove 5.10 patch
@ 2022-03-08 22:38 Nick Desaulniers
  2022-03-08 23:11 ` Robin Murphy
  0 siblings, 1 reply; 3+ messages in thread
From: Nick Desaulniers @ 2022-03-08 22:38 UTC (permalink / raw)
  To: Greg KH, Sasha Levin
  Cc: # 3.4.x, Manoj Gupta, Denis Nikitin, Will Deacon, Robin Murphy,
	llvm, Linux ARM

Dear stable kernel maintainers,
Please consider cherry-picking

commit 6c23d54f4cb8 ("arm64: Import latest memcpy()/memmove() implementation")

to v5.10.y.  It first landed in v5.14-rc1.

It fixes a linkage failure observed when building kernels for ChromeOS
under AutoFDO:

ld.lld: error: arch/arm64/lib/lib.a(memmove.o):(function __memmove:
.text+0x8): relocation R_AARCH64_CONDBR19 out of range: -6331272 is
not in [-1048576, 1048575]; references __memcpy
>>> defined in arch/arm64/lib/lib.a(memcpy.o)

(The prior version of memmove used assembler conditional branches to
memcpy; under AutoFDO the linker will decide where best to place
memmove; it may be > 1MB away from memcpy. After this patch, memcpy
and memmove are the same function).
-- 
Thanks,
~Nick Desaulniers

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: arm64 memcpy+memove 5.10 patch
  2022-03-08 22:38 arm64 memcpy+memove 5.10 patch Nick Desaulniers
@ 2022-03-08 23:11 ` Robin Murphy
  2022-03-09  9:46   ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Robin Murphy @ 2022-03-08 23:11 UTC (permalink / raw)
  To: Nick Desaulniers, Greg KH, Sasha Levin
  Cc: # 3.4.x, Manoj Gupta, Denis Nikitin, Will Deacon, llvm, Linux ARM

On 2022-03-08 22:38, Nick Desaulniers wrote:
> Dear stable kernel maintainers,
> Please consider cherry-picking
> 
> commit 6c23d54f4cb8 ("arm64: Import latest memcpy()/memmove() implementation")
> 
> to v5.10.y.  It first landed in v5.14-rc1.
> 
> It fixes a linkage failure observed when building kernels for ChromeOS
> under AutoFDO:
> 
> ld.lld: error: arch/arm64/lib/lib.a(memmove.o):(function __memmove:
> .text+0x8): relocation R_AARCH64_CONDBR19 out of range: -6331272 is
> not in [-1048576, 1048575]; references __memcpy
>>>> defined in arch/arm64/lib/lib.a(memcpy.o)
> 
> (The prior version of memmove used assembler conditional branches to
> memcpy; under AutoFDO the linker will decide where best to place
> memmove; it may be > 1MB away from memcpy. After this patch, memcpy
> and memmove are the same function).

Just beware that the new implementation turned out to be really good at 
finding places where __iomem pointers are erroneously being passed to 
memcpy(), by more readily triggering alignment faults, so there is a 
non-zero possibility of functional regressions if any of those places 
are still present in 5.10.y (particularly any which had "naturally" 
disappeared before 5.14). At least one of them still isn't fixed in 
mainline, but that one's so obscure I wouldn't consider it a major 
concern by itself.

Thanks,
Robin.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: arm64 memcpy+memove 5.10 patch
  2022-03-08 23:11 ` Robin Murphy
@ 2022-03-09  9:46   ` Greg KH
  0 siblings, 0 replies; 3+ messages in thread
From: Greg KH @ 2022-03-09  9:46 UTC (permalink / raw)
  To: Robin Murphy
  Cc: Nick Desaulniers, Sasha Levin, # 3.4.x, Manoj Gupta,
	Denis Nikitin, Will Deacon, llvm, Linux ARM

On Tue, Mar 08, 2022 at 11:11:38PM +0000, Robin Murphy wrote:
> On 2022-03-08 22:38, Nick Desaulniers wrote:
> > Dear stable kernel maintainers,
> > Please consider cherry-picking
> > 
> > commit 6c23d54f4cb8 ("arm64: Import latest memcpy()/memmove() implementation")
> > 
> > to v5.10.y.  It first landed in v5.14-rc1.
> > 
> > It fixes a linkage failure observed when building kernels for ChromeOS
> > under AutoFDO:
> > 
> > ld.lld: error: arch/arm64/lib/lib.a(memmove.o):(function __memmove:
> > .text+0x8): relocation R_AARCH64_CONDBR19 out of range: -6331272 is
> > not in [-1048576, 1048575]; references __memcpy
> > > > > defined in arch/arm64/lib/lib.a(memcpy.o)
> > 
> > (The prior version of memmove used assembler conditional branches to
> > memcpy; under AutoFDO the linker will decide where best to place
> > memmove; it may be > 1MB away from memcpy. After this patch, memcpy
> > and memmove are the same function).
> 
> Just beware that the new implementation turned out to be really good at
> finding places where __iomem pointers are erroneously being passed to
> memcpy(), by more readily triggering alignment faults, so there is a
> non-zero possibility of functional regressions if any of those places are
> still present in 5.10.y (particularly any which had "naturally" disappeared
> before 5.14). At least one of them still isn't fixed in mainline, but that
> one's so obscure I wouldn't consider it a major concern by itself.

Yeah, because of this, I'm a bit nervous to add this change to the
stable tree.  ChromeOS can keep it in their tree as they "know" they
have properly audited all of their drivers to get this right and they
can own the fallout if they didn't :)

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-03-09  9:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-08 22:38 arm64 memcpy+memove 5.10 patch Nick Desaulniers
2022-03-08 23:11 ` Robin Murphy
2022-03-09  9:46   ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).