This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 6/6] aarch64: Add hp-timing.h
- From: Andrew Pinski <pinskia at gmail dot com>
- To: Richard Henderson <rth at twiddle dot net>
- Cc: Marcus Shawcroft <marcus dot shawcroft at gmail dot com>, Andreas Schwab <schwab at suse dot de>, "libc-alpha at sourceware dot org" <libc-alpha at sourceware dot org>, "azanella at linux dot vnet dot ibm dot com" <azanella at linux dot vnet dot ibm dot com>, "davem at davemloft dot net" <davem at davemloft dot net>, "marcus dot shawcroft at arm dot com" <marcus dot shawcroft at arm dot com>
- Date: Mon, 21 Jul 2014 13:42:36 -0700
- Subject: Re: [PATCH 6/6] aarch64: Add hp-timing.h
- Authentication-results: sourceware.org; auth=none
- References: <1403735086-21797-1-git-send-email-rth at twiddle dot net> <1403735086-21797-7-git-send-email-rth at twiddle dot net> <mvmd2czlz0k dot fsf at hawking dot suse dot de> <812AFAEE-C8E5-4583-8647-7E5ABE02F95C at gmail dot com> <mvm4myanco3 dot fsf at hawking dot suse dot de> <CAFqB+PyCXom3fqF8A=C10jV9syUeRmOg-JuTL1pxtVnLsgfj7A at mail dot gmail dot com> <53CD6492 dot 9080109 at twiddle dot net>
On Mon, Jul 21, 2014 at 12:05 PM, Richard Henderson <rth@twiddle.net> wrote:
> On 07/21/2014 08:31 AM, Marcus Shawcroft wrote:
>> On 21 July 2014 13:01, Andreas Schwab <schwab@suse.de> wrote:
>>> pinskia@gmail.com writes:
>>>
>>>>> On Jul 21, 2014, at 4:41 AM, Andreas Schwab <schwab@suse.de> wrote:
>>>>>
>>>>> Richard Henderson <rth@twiddle.net> writes:
>>>>>
>>>>>> +/* Sync the instruction stream, and read from the virtual cycle counter. */
>>>>>> +#define HP_TIMING_NOW(Var) \
>>>>>> + __asm__ __volatile__ ("isb; mrs %0, cntvct_el0" : "=r" (Var))
>>>>>
>>>>> According to https://bugs.launchpad.net/bugs/1344320 the generic timers
>>>>> are not part of the kernel-to-userspace contract.
>>>>
>>>>
>>>> I think this is bogus for the kernel folks not allow a high precision timer in user space. Timers like this are needed for micro-benchmarking compiler changes along with other libc changes.
>>>
>>> According to the qemu bug the timers are optional.
>>>
>>
>> The generic timers are indeed optional, therefore we should not assume
>> they are always present. I don't want this to ship in 2.20 as is, so
>> will back out the patch in the morning pending a better solution.
>
> Do you know of any real hardware that doesn't have the timers? I really can't
> imagine them being elided.
More than that, right now the Linux kernel requires the timings so it
is not optional for the linux kernel.
http://lists.infradead.org/pipermail/linux-arm-kernel/2012-August/114155.html
That patch makes it sound like it is part of the kernel userland
ABI/API as it allows for a fast gettimeofday() (that does not have to
be in VDSO if I read the comment correctly).
Thanks,
Andrew Pinski
>
> It should be trivial to enable this for qemu linux-user mode; we certainly
> support the i386 rdtsc instruction.
>
>
> r~
>