lkml.org 
[lkml]   [2021]   [Nov]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH 1/2] arm64/tracing: add cntvct based trace clock
On Fri, 19 Nov 2021 11:26:24 +0000,
Marcelo Tosatti <mtosatti@redhat.com> wrote:
>
> On Fri, Nov 19, 2021 at 11:21:17AM +0100, Nicolas Saenz Julienne wrote:
> > Add a new arm64-specific trace clock using the cntvct register, similar
> > to x64-tsc. This gives us:
> > - A clock that is relatively fast (1GHz on armv8.6, 1-50MHz otherwise),
> > monotonic, and resilient to low power modes.
> > - It can be used to correlate events across cpus as well as across
> > hypervisor and guests.
> >
> > By using arch_timer_read_counter() we make sure that armv8.6 cpus use
> > the less expensive CNTVCTSS_EL0, which cannot be accessed speculatively.
>
> Can this register be read by userspace ? (otherwise it won't be possible
> to correlate userspace events).

Yes. That's part of the userspace ABI. Although this particular
accessor is only available from ARMv8.6 and is advertised via a hwcap
to userspace.

For currently existing implementations, userspace will use the
CNTVCT_EL0 accessor, which requires extra synchronisation as it can be
speculated.

M.

--
Without deviation from the norm, progress is not possible.

\
 
 \ /
  Last update: 2021-11-19 13:01    [W:0.078 / U:0.932 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site