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: Peter Maydell <peter dot maydell at linaro dot org>
- To: Marcus Shawcroft <marcus dot shawcroft at gmail dot com>
- Cc: "libc-alpha at sourceware dot org" <libc-alpha at sourceware dot org>, Catalin Marinas <catalin dot marinas at arm dot com>, "Carlos O'Donell" <carlos at redhat dot com>, Andreas Schwab <schwab at suse dot de>, Richard Henderson <rth at twiddle dot net>, "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>, Andrew Pinski <pinskia at gmail dot com>, Szabolcs dot Nagy at arm dot com
- Date: Thu, 3 Sep 2015 14:49:12 +0100
- 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> <55861F56 dot 1030506 at redhat dot com> <89431F96-326C-4054-B2D6-17863543CC9B at gmail dot com> <CA+=Sn1kZL8xmCPtzpULRMNQ7ommN6FxRmAQJVy2LV+wOF+WSkQ at mail dot gmail dot com> <CAFqB+PzWoxrDfM8FYRBQq2+JZruoveB_xiTEH+edOBLaOxW7qw at mail dot gmail dot com>
On 3 September 2015 at 14:17, Marcus Shawcroft
<marcus.shawcroft@gmail.com> wrote:
> There are two ways forward:
>
> 1) Kernel folk agree to expose cntvct_el0 for the benefit of general user space.
>
> 2) We add a HWCAP bit to indicate if cntvct_el0 is exposed.
>
> Taking the proposed patch as it stands in the absence of a commitment
> from the kernel doesn't look sensible to me. Since the loader uses hp
> timers in normal operation we will end up with a dynamic loader that
> faults if a future kernel disables visibility of cntvct_el0.
You need to have the dynamic loader check whether the counter
is available somehow anyway, otherwise it won't work on:
* older kernels that don't export the counter to userspace
* QEMU usermode emulation
* valgrind
* possibly other similar JIT tools
Obviously valgrind/QEMU/etc can be improved to add the counter
support, but there are still going to be old versions out in the
wild.
thanks
-- PMM