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] [BZ #20071] X86 ld.so uses the incorrect cache sizes


On Tue, May 10, 2016 at 12:00 PM, H.J. Lu <hongjiu.lu@intel.com> wrote:
> There are private copies of cache info in ld.so, libc.so and libc.a.
> They provide faster and consistent access to cache info for string and
> memory functions.  This patch adds cache info to _dl_x86_cpu_features
> and initializes it early together with other CPU features.  It allows
> a processor to override cache info derived from CPUID and initializes
> private copies of cache info in ld.so, libc.so and libc.a from
> _dl_x86_cpu_features.
>
> Tested on x86 and x86-64.  Any feedbacks, comments?
>
>
> H.J.
> --
>         [BZ #20071]
>         * sysdeps/x86/cacheinfo.c (__cache_sysconf): Defined only in
>         libc.
>         (__x86_data_cache_size_half): Initialize to 0.
>         (__x86_data_cache_size): Likewise.
>         (__x86_raw_data_cache_size_half): Likewise.
>         (__x86_raw_data_cache_size): Likewise.
>         (__x86_shared_cache_size_half): Likewise.
>         (__x86_shared_cache_size): Likewise.
>         (__x86_raw_shared_cache_size_half): Likewise.
>         (__x86_raw_shared_cache_size): Likewise.
>         (init_x86_cacheinfo): New function.
>         (__init_cpu_features_cacheinfo): Likewise.
>         (init_cacheinfo): Only define in libc.so.  Just call
>         init_x86_cacheinfo.
>         * sysdeps/x86/cpu-features.c (init_cpu_features): Call
>         __init_cpu_features_cacheinfo.
>         * sysdeps/x86/cpu-features.h (cache_info): New.
>         (cpu_features): Add cache.

The bug is invalid since ld.so doesn't use cache size info
in memory functions.


-- 
H.J.


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