Messages in this thread | | | Date | Sun, 13 Apr 2008 11:44:46 +0200 (CEST) | From | Erik Bosman <> | Subject | Re: [PATCH 1/3] Add prctl commands PR_GET_TSC and PR_SET_TSC |
| |
On Sun, 13 Apr 2008, Andi Kleen wrote:
> Erik Bosman <ebn310@few.vu.nl> writes: > > > This patch adds prctl commands that make it possible > > to deny the execution of timestamp counters in userspace. > > If this is not implemented on a specific architecture, > > prctl will return -EINVAL. > > You forgot to state why you need that? > > -Andi >
I'm using it for deterministic replay. With this trap it is possible to emulate the instruction using ptrace and knowing the outcome. Deterministic replay can be useful, amongst other things, for debugging and security (instructing your debugger to undo instructions for example, to see what happened before a fault.)
Not having this trap means emulation should be used to catch the instruction, leading to bad performance.
Without the timestamp counter, the only instruction leading to non-determinism (that I'm aware of) is the CPUID instruction that returns on which core it runs, but that doesn't seem to be used that much.
Erik Bosman
| |