All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Collingbourne <pcc@google.com>
To: Marc Zyngier <maz@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	 linux-arm-kernel@lists.infradead.org,
	Yichao Yu <yyc1992@gmail.com>,
	 "Robert O'Callahan" <robert@ocallahan.org>,
	Keno Fischer <keno@juliacomputing.com>
Subject: Re: [PATCH] arm64: Implement prctl(PR_{G,S}ET_TSC)
Date: Sun, 28 Apr 2024 11:47:56 -0700	[thread overview]
Message-ID: <CAMn1gO5hkZnBV1F=S0_RSZ1Y0f4C-APtw75caJ=7U07MX11WgQ@mail.gmail.com> (raw)
In-Reply-To: <87h6flu61d.wl-maz@kernel.org>

On Sun, Apr 28, 2024 at 3:37 AM Marc Zyngier <maz@kernel.org> wrote:
>
> On Sat, 27 Apr 2024 06:27:51 +0100,
> Peter Collingbourne <pcc@google.com> wrote:
> >
> > On arm64, this prctl controls access to CNTVCT_EL0, CNTVCTSS_EL0 and
> > CNTFRQ_EL0 via CNTKCTL_EL1.EL0VCTEN. Since this bit is also used to
> > implement various erratum workarounds, check whether the CPU needs
> > a workaround whenever we potentially need to change it.
>
> Why would we ever consider preventing access to CNTVTL_EL0?  This
> register is part of the arm64 ABI, together with CNTFRQ_EL0.
> Disabling it also prevents the VDSO from working correctly, making
> something as simple as getttimeofday() unexpectedly fail.
>
> I'm sure you have some rationale behind it, but it is nowhere to be
> found above, and I cannot see why we'd want to mimic whatever x86
> does.

Hi Marc,

This is needed for a correct implementation of non-instrumenting
record-replay debugging on arm64 (i.e. rr; https://rr-project.org/).
rr must trap and record any sources of non-determinism from the
userspace program's perspective so it can be replayed later. This
includes the results of syscalls as well as the results of access to
architected timers exposed directly to the program. rr traps RDTSC on
x86 for the same reason.

I'd be happy to add that to the commit message for v2.

Peter

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

  reply	other threads:[~2024-04-28 18:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-27  5:27 [PATCH] arm64: Implement prctl(PR_{G,S}ET_TSC) Peter Collingbourne
2024-04-28 10:37 ` Marc Zyngier
2024-04-28 18:47   ` Peter Collingbourne [this message]
2024-04-29  7:34     ` Marc Zyngier
2024-04-29  8:35       ` Keno Fischer
2024-04-29 18:46         ` Peter Collingbourne

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='CAMn1gO5hkZnBV1F=S0_RSZ1Y0f4C-APtw75caJ=7U07MX11WgQ@mail.gmail.com' \
    --to=pcc@google.com \
    --cc=catalin.marinas@arm.com \
    --cc=keno@juliacomputing.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=maz@kernel.org \
    --cc=robert@ocallahan.org \
    --cc=will@kernel.org \
    --cc=yyc1992@gmail.com \
    /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.