android_kernel_xiaomi_sdm845/arch/x86
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
..
boot x86: cleanup: change _end to end_before_pgt 2008-04-19 19:19:55 +02:00
configs x86, core: remove CONFIG_FORCED_INLINING 2008-02-09 23:24:09 +01:00
crypto [CRYPTO] twofish: Merge common glue code 2008-01-14 17:07:57 +11:00
ia32 x86: sys32_execve PT_DTRACE 2008-04-17 17:41:13 +02:00
kernel x86: implement prctl PR_GET_TSC and PR_SET_TSC 2008-04-19 19:19:55 +02:00
kvm KVM: MMU: Fix memory leak on guest demand faults 2008-03-25 10:22:17 +02:00
lguest x86: replace remaining __FUNCTION__ occurances 2008-04-17 17:40:57 +02:00
lib Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86 2008-04-18 08:25:51 -07:00
mach-default spelling fixes: arch/i386/ 2007-10-20 01:13:56 +02:00
mach-es7000 i386: es7000 minor cleanups 2007-10-17 20:16:15 +02:00
mach-generic x86: coding style fixes to arch/x86/mach-generic/bigsmp.c 2008-04-17 17:40:48 +02:00
mach-rdc321x x86, rdc321x: remove watchdog file 2008-04-17 17:40:50 +02:00
mach-visws x86: remove pointless comments 2008-04-19 19:19:54 +02:00
mach-voyager x86: remove pointless comments 2008-04-19 19:19:54 +02:00
math-emu i386: arch/x86/math-emu/reg_ld_str.c: fix warning 2008-04-17 17:41:21 +02:00
mm x86: fix arch/x86/mm/ioremap.c warning 2008-04-19 19:19:54 +02:00
oprofile x86: coding style fixes to arch/x86/oprofile/nmi_timer_int.c 2008-04-17 17:40:50 +02:00
pci x86: PAT bug fix for attribute type check after reserve_memtype 2008-04-17 17:41:20 +02:00
power x86: coding style fixes to arch/x86/power/cpu_32.c 2008-04-17 17:40:50 +02:00
vdso x86: Centaur Isaiah processor to use sysenter in 64-bit compatibility mode rather than syscall 2008-04-17 17:41:31 +02:00
video x86: remove pointless comments 2008-04-19 19:19:54 +02:00
xen x86: change naming of cpu_initialized_mask for xen 2008-04-17 17:41:32 +02:00
Kconfig Merge git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-kgdb 2008-04-18 08:37:01 -07:00
Kconfig.cpu x86: MPSC should use P6 NOPs 2008-04-17 17:41:34 +02:00
Kconfig.debug x86: 4kstacks default 2008-04-17 17:41:34 +02:00
Makefile x86: add subarch support (for headers) to x86_64 2008-04-17 17:41:01 +02:00
Makefile_32.cpu x86: move i386 and x86_64 Makefiles to arch/x86 2007-10-25 22:27:34 +02:00