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: framebuffer corruption due to overlapping stp instructions on arm64


On Fri, Aug 3, 2018 at 8:53 AM, Florian Weimer <fweimer@redhat.com> wrote:
> On 08/03/2018 09:11 AM, Andrew Pinski wrote:
>>
>> Yes fix Links not to use memcpy on the framebuffer.
>> It is undefined behavior to use device memory with memcpy.
>
>
> Some (de facto) ABIs require that it is supported, though.  For example, the
> POWER string functions avoid unaligned loads and stores for this reason
> because the platform has the same issue with device memory.  And yes, GCC
> will expand memcpy on POWER to something that is incompatible with device
> memory. 8-(

GCC for AArch64 - use -mstrict-align
GCC for AArch32 - use -mno-unaligned-access.

If you see unaligned accesses coming out of the compiler for well
defined programs then that's a bug. Frequently we see undefined
programs that get the compiler to produce traps - atleast one or 2
bugs a year  in  GCC .


>
> If we don't want people to use memcpy, we probably need to provide a
> credible alternative.

I believe a number of packages have rolled their own to take these
constraints into account
for AArch32, perhaps it needs to be expanded for AArch64 as well.

regards
Ramana

>
> Thanks,
> Florian


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