This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] PowerPC - A2 memcpy cache line size initialization
- From: "Ryan S. Arnold" <ryan dot arnold at gmail dot com>
- To: Adhemerval Zanella <azanella at linux dot vnet dot ibm dot com>
- Cc: "GNU C. Library" <libc-alpha at sourceware dot org>
- Date: Wed, 25 Jan 2012 11:11:49 -0600
- Subject: Re: [PATCH] PowerPC - A2 memcpy cache line size initialization
- References: <4F1EE37F.2020101@linux.vnet.ibm.com>
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