[PATCH v3] arm64: Implement prctl(PR_{G,S}ET_TSC)

Will Deacon will at kernel.org
Tue Aug 27 08:56:22 PDT 2024


On Fri, 23 Aug 2024 18:54:13 -0700, Peter Collingbourne 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.
> 
> 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. This prctl
> was originally added for x86 by commit 8fb402bccf20 ("generic, x86:
> add prctl commands PR_GET_TSC and PR_SET_TSC"), and rr uses it to
> trap RDTSC on x86 for the same reason.
> 
> [...]

Applied to arm64 (for-next/timers), thanks!

[1/1] arm64: Implement prctl(PR_{G,S}ET_TSC)
      https://git.kernel.org/arm64/c/3e9e67e12943

Cheers,
-- 
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev



More information about the linux-arm-kernel mailing list