All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Marcelo Tosatti <mtosatti@redhat.com>,
	Nicolas Saenz Julienne <nsaenzju@redhat.com>
Cc: will@kernel.org, catalin.marinas@arm.com,
	linux-kernel@vger.kernel.org, rostedt@goodmis.org,
	mingo@redhat.com, nilal@redhat.com, kvmarm@lists.cs.columbia.edu,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [RFC PATCH 1/2] arm64/tracing: add cntvct based trace clock
Date: Fri, 19 Nov 2021 12:00:23 +0000	[thread overview]
Message-ID: <87h7c873u0.wl-maz@kernel.org> (raw)
In-Reply-To: <20211119112624.GA51423@fuller.cnet>

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.
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

WARNING: multiple messages have this Message-ID (diff)
From: Marc Zyngier <maz@kernel.org>
To: Marcelo Tosatti <mtosatti@redhat.com>,
	Nicolas Saenz Julienne <nsaenzju@redhat.com>
Cc: linux-arm-kernel@lists.infradead.org, rostedt@goodmis.org,
	james.morse@arm.com, alexandru.elisei@arm.com,
	suzuki.poulose@arm.com, catalin.marinas@arm.com, will@kernel.org,
	linux-kernel@vger.kernel.org, kvmarm@lists.cs.columbia.edu,
	mingo@redhat.com, nilal@redhat.com
Subject: Re: [RFC PATCH 1/2] arm64/tracing: add cntvct based trace clock
Date: Fri, 19 Nov 2021 12:00:23 +0000	[thread overview]
Message-ID: <87h7c873u0.wl-maz@kernel.org> (raw)
In-Reply-To: <20211119112624.GA51423@fuller.cnet>

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.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

WARNING: multiple messages have this Message-ID (diff)
From: Marc Zyngier <maz@kernel.org>
To: Marcelo Tosatti <mtosatti@redhat.com>,
	Nicolas Saenz Julienne <nsaenzju@redhat.com>
Cc: linux-arm-kernel@lists.infradead.org, rostedt@goodmis.org,
	james.morse@arm.com, alexandru.elisei@arm.com,
	suzuki.poulose@arm.com, catalin.marinas@arm.com, will@kernel.org,
	linux-kernel@vger.kernel.org, kvmarm@lists.cs.columbia.edu,
	mingo@redhat.com, nilal@redhat.com
Subject: Re: [RFC PATCH 1/2] arm64/tracing: add cntvct based trace clock
Date: Fri, 19 Nov 2021 12:00:23 +0000	[thread overview]
Message-ID: <87h7c873u0.wl-maz@kernel.org> (raw)
In-Reply-To: <20211119112624.GA51423@fuller.cnet>

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.

  reply	other threads:[~2021-11-19 12:00 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-19 10:21 [RFC PATCH 0/2] KVM: arm64: Host/Guest trace syncronization Nicolas Saenz Julienne
2021-11-19 10:21 ` Nicolas Saenz Julienne
2021-11-19 10:21 ` Nicolas Saenz Julienne
2021-11-19 10:21 ` [RFC PATCH 1/2] arm64/tracing: add cntvct based trace clock Nicolas Saenz Julienne
2021-11-19 10:21   ` Nicolas Saenz Julienne
2021-11-19 10:21   ` Nicolas Saenz Julienne
2021-11-19 11:26   ` Marcelo Tosatti
2021-11-19 11:26     ` Marcelo Tosatti
2021-11-19 11:26     ` Marcelo Tosatti
2021-11-19 12:00     ` Marc Zyngier [this message]
2021-11-19 12:00       ` Marc Zyngier
2021-11-19 12:00       ` Marc Zyngier
2021-11-19 13:26       ` Nicolas Saenz Julienne
2021-11-19 13:26         ` Nicolas Saenz Julienne
2021-11-19 13:26         ` Nicolas Saenz Julienne
2021-11-22 14:57   ` Steven Rostedt
2021-11-22 14:57     ` Steven Rostedt
2021-11-22 14:57     ` Steven Rostedt
2021-11-24  9:45     ` Nicolas Saenz Julienne
2021-11-24  9:45       ` Nicolas Saenz Julienne
2021-11-24  9:45       ` Nicolas Saenz Julienne
2021-11-19 10:21 ` [RFC PATCH 2/2] KVM: arm64: export cntvoff in debugfs Nicolas Saenz Julienne
2021-11-19 10:21   ` Nicolas Saenz Julienne
2021-11-19 10:21   ` Nicolas Saenz Julienne
2021-11-19 11:11   ` Marcelo Tosatti
2021-11-19 11:11     ` Marcelo Tosatti
2021-11-19 11:11     ` Marcelo Tosatti
2021-11-19 12:17   ` Marc Zyngier
2021-11-19 12:17     ` Marc Zyngier
2021-11-19 12:17     ` Marc Zyngier
2021-11-19 12:59     ` Marcelo Tosatti
2021-11-19 12:59       ` Marcelo Tosatti
2021-11-19 12:59       ` Marcelo Tosatti
2021-11-19 13:31       ` Marc Zyngier
2021-11-19 13:31         ` Marc Zyngier
2021-11-19 13:31         ` Marc Zyngier
2021-11-22 20:40     ` Nicolas Saenz Julienne
2021-11-22 20:40       ` Nicolas Saenz Julienne
2021-11-22 20:40       ` Nicolas Saenz Julienne
2021-11-23 11:09       ` Marc Zyngier
2021-11-23 11:09         ` Marc Zyngier
2021-11-23 11:09         ` Marc Zyngier
2021-11-29 12:47       ` Marcelo Tosatti
2021-11-29 12:47         ` Marcelo Tosatti
2021-11-29 12:47         ` Marcelo Tosatti

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h7c873u0.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=mtosatti@redhat.com \
    --cc=nilal@redhat.com \
    --cc=nsaenzju@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.