android_kernel_xiaomi_sdm845/arch
Erik Bosman 529e25f646 x86: implement prctl PR_GET_TSC and PR_SET_TSC
This patch implements the PR_GET_TSC and PR_SET_TSC prctl()
commands on the x86 platform (both 32 and 64 bit.) These
commands control the ability to read the timestamp counter
from userspace (the RDTSC instruction.)

While the RDTSC instuction is a useful profiling tool,
it is also the source of some non-determinism in ring-3.
For deterministic replay applications it is useful to be
able to trap and emulate (and record the outcome of) this
instruction.

This patch uses code earlier used to disable the timestamp
counter for the SECCOMP framework. A side-effect of this
patch is that the SECCOMP environment will now also disable
the timestamp counter on x86_64 due to the addition of the
TIF_NOTSC define on this platform.

The code which enables/disables the RDTSC instruction during
context switches is in the __switch_to_xtra function, which
already handles other unusual conditions, so normal
performance should not have to suffer from this change.

Signed-off-by: Erik Bosman <ejbosman@cs.vu.nl>
Acked-by: Arjan van de Ven  <arjan@linux.intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2008-04-19 19:19:55 +02:00
..
alpha Generic semaphore implementation 2008-04-17 10:42:34 -04:00
arm Generic semaphore implementation 2008-04-17 10:42:34 -04:00
avr32 Generic semaphore implementation 2008-04-17 10:42:34 -04:00
blackfin Generic semaphore implementation 2008-04-17 10:42:34 -04:00
cris Generic semaphore implementation 2008-04-17 10:42:34 -04:00
frv Generic semaphore implementation 2008-04-17 10:42:34 -04:00
h8300 Generic semaphore implementation 2008-04-17 10:42:34 -04:00
ia64 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.26 2008-04-18 18:02:35 -07:00
m32r Generic semaphore implementation 2008-04-17 10:42:34 -04:00
m68k Generic semaphore implementation 2008-04-17 10:42:34 -04:00
m68knommu Generic semaphore implementation 2008-04-17 10:42:34 -04:00
mips Generic semaphore implementation 2008-04-17 10:42:34 -04:00
mn10300 Generic semaphore implementation 2008-04-17 10:42:34 -04:00
parisc Generic semaphore implementation 2008-04-17 10:42:34 -04:00
powerpc Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.26 2008-04-18 18:02:35 -07:00
ppc Merge git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6 2008-04-18 08:39:24 -07:00
s390 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.26 2008-04-18 18:02:35 -07:00
sh Generic semaphore implementation 2008-04-17 10:42:34 -04:00
sparc Generic semaphore implementation 2008-04-17 10:42:34 -04:00
sparc64 Generic semaphore implementation 2008-04-17 10:42:34 -04:00
um Generic semaphore implementation 2008-04-17 10:42:34 -04:00
v850 Generic semaphore implementation 2008-04-17 10:42:34 -04:00
x86 x86: implement prctl PR_GET_TSC and PR_SET_TSC 2008-04-19 19:19:55 +02:00
xtensa Generic semaphore implementation 2008-04-17 10:42:34 -04:00
.gitignore
Kconfig Kprobes: indicate kretprobe support in Kconfig 2008-03-04 16:35:11 -08:00