This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [glibc/google/grte/v5-2.27/master] Fix sense of a test in the static-linking version of ppc get_clockfreq
- From: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- To: Carlos O'Donell <carlos at redhat dot com>, Stan Shebs <stanshebs at google dot com>, GNU C Library <libc-alpha at sourceware dot org>
- Date: Wed, 29 May 2019 12:09:48 -0300
- Subject: Re: [glibc/google/grte/v5-2.27/master] Fix sense of a test in the static-linking version of ppc get_clockfreq
- References: <20190517192546.22134.qmail@sourceware.org> <0346f018-0ed7-451a-31b7-dedec56be152@redhat.com> <46c3916d-c803-d2e7-4d3c-ce01c1a9faf0@linaro.org>
On 29/05/2019 10:33, Adhemerval Zanella wrote:
>
>
> On 18/05/2019 01:35, Carlos O'Donell wrote:
>> On 5/17/19 2:25 PM, Stan Shebs wrote:
>>> https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=4791e4f773d060c1a37b27aac5b03cdfa9327afc
>>>
>>> commit 4791e4f773d060c1a37b27aac5b03cdfa9327afc
>>> Author: Stan Shebs <stanshebs@google.com>
>>> Date: Fri May 17 12:25:19 2019 -0700
>>>
>>> Fix sense of a test in the static-linking version of ppc get_clockfreq
>>>
>>
>> Stan,
>>
>> This looks like a fix that should go on master?
>>
>> Cheers,
>> Carlos.
>>
>
> This in fact not required due 38cc11daa43b1, 77b6f553477, and 6e8ba7fd574.
> The __get_clock freq in fact is not really used in any recent kernel we
> support now, so its had been dead code for some time.
>
Tulio has raised to my attention that get_timebase_freq.c has a similar issue.
Taking in consideration that BZ#19767 is at least fixed for powerpc, I think
best action would be to just remove INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK,
check vdso pointer availability (assuming a kernel might be build without
vDSO support) and fallback to read /proc/cpuinfo in the case.
Something like:
uint64_t
__get_timebase_freq (void)
{
hp_timing_t result = 0L;
{
/* The vDSO does not fail (it clear cr0.so on returning). */
__typeof (__vdso_get_tbfreq) vdsop = __vdso_get_tbfreq;
PTR_DEMANGLE (vdsop)
if (vdsop != NULL)
return vdsop ();
/* Fallback. */
}
I also think mostly of INTERNAL_VSYSCALL_CALL_TYPE from powerpc sysdep could
just be removed since currently all vDSO symbol do not fail (so there is no
need to actually check cr0.so value).