This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH][aarch64] Fix glibc.tune.cpu tunable handling
- From: Siddhesh Poyarekar <siddhesh at gotplt dot org>
- To: sellcey at cavium dot com, libc-alpha <libc-alpha at sourceware dot org>
- Date: Mon, 4 Sep 2017 11:07:41 +0530
- Subject: Re: [PATCH][aarch64] Fix glibc.tune.cpu tunable handling
- Authentication-results: sourceware.org; auth=none
- References: <1504294850.3182.66.camel@cavium.com>
On Saturday 02 September 2017 01:10 AM, Steve Ellcey wrote:
> While working on a gcc patch I realized that the glibc tunable
> 'glibc.tune.cpu' was not working on aarch64. I tracked it down to
> get_midr_from_mcpu and at first I thought I should remove the '== 0'
> from the if statement because tunable_is_name returns true/false, not
> -1/0/1 like strcmp. But then I realized we shouldn't be using
> tunable_is_name at all because we are comparing two null terminated
> strings and tunable_is_name is trying to compare a null terminated
> string with a '=' terminated string which is not what we have.
>
> I tested this by running a program that calls memcpy and checking what
> memcpy gets run after setting glibc.tune.cpu to generic, thunderx,
> and falkor.
Right, tunable_is_name is the wrong function to call but using strcmp
there may not be safe. Please verify that it does not go through a PLT,
i.e. it calls the ld.so version at all times.
Siddhesh