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] PowerPC - A2 memcpy cache line size initialization


On Tue, Jan 24, 2012 at 10:59 AM, Adhemerval Zanella
<azanella@linux.vnet.ibm.com> wrote:
> The PPC A2 memcpy implementation relies on a correct __cache_line_size value
> which is currently initialized on '__libc_start_main'
> (sysdeps/unix/sysv/linux/powerpc/libc-start.c).
>
> In some conditions (a dso constructor for instance) the cache line
> size is not yet initialized and calling memset may result in a
> SEGFAULT. This patch checks if the cache line size is initialized
> and if not, uses simple memcpy algorithm without any prefetch (dcbz)
> instructions.
>
> ---
>
> 2012-01-19 ÂAdhemerval Zanella Â<azanella@linux.vnet.ibm.com>
>
> Â Â Â Â* sysdeps/powerpc/powerpc32/a2/memcpy.S: Fix for when cache line size is
> Â Â Â Ânot set.
> Â Â Â Â* sysdeps/powerpc/powerpc64/a2/memcpy.S: Likewise.

Ack.

We discussed this patch and it covers the case where the loader, in
encountering a zeroed cacheline_size can't make assumptions about what
that cacheline size might be because it could conflict with what's
been set by firmware.  In such a case using data-cache-block-zeroing
instructions could overwrite.  So this patch, by necessity can't use
dcbz.

Ryan S. Arnold


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