2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-30 08:04:13 +08:00
linux-next/arch/x86/vdso
John Stultz a939e817aa time: x86: Fix race switching from vsyscall to non-vsyscall clock
When switching from a vsyscall capable to a non-vsyscall capable
clocksource, there was a small race, where the last vsyscall
gettimeofday before the switch might return a invalid time value
using the new non-vsyscall enabled clocksource values after the
switch is complete.

This is due to the vsyscall code checking the vclock_mode once
outside of the seqcount protected section. After it reads the
vclock mode, it doesn't re-check that the sampled clock data
that is obtained in the seqcount critical section still matches.

The fix is to sample vclock_mode inside the protected section,
and as long as it isn't VCLOCK_NONE, return the calculated
value. If it has changed and is now VCLOCK_NONE, fall back
to the syscall gettime calculation.

v2:
  * Cleanup checks as suggested by tglx
  * Also fix same issue present in gettimeofday path

CC: Andy Lutomirski <luto@amacapital.net>
CC: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: John Stultz <john.stultz@linaro.org>
2012-03-15 18:17:53 -07:00
..
vdso32 x86-32, vdso: On system call restart after SYSENTER, use int $0x80 2011-08-23 16:20:10 -07:00
.gitignore x86: add vdso32-int80-syms.lds to .gitignore 2008-01-30 13:33:24 +01:00
checkundef.sh x86, vdso: Don't quote $nm in the script for checking vdso references 2010-07-27 23:52:29 -07:00
Makefile x86-64: Add --no-undefined to vDSO build 2011-07-13 11:23:09 -07:00
vclock_gettime.c time: x86: Fix race switching from vsyscall to non-vsyscall clock 2012-03-15 18:17:53 -07:00
vdso32-setup.c mm: arch: rename in_gate_area_no_task to in_gate_area_no_mm 2011-03-23 16:36:55 -04:00
vdso32.S x86_64: further cleanup of 32-bit compat syscall mechanisms 2008-07-16 11:08:27 +02:00
vdso-layout.lds.S x86 vDSO: new layout 2008-01-30 13:30:41 +01:00
vdso-note.S x86_64: move vdso 2007-10-11 11:17:10 +02:00
vdso.lds.S x86-64: Add time to vDSO 2011-05-24 14:51:29 +02:00
vdso.S x86-64: Pad vDSO to a page boundary 2011-08-04 16:13:34 -07:00
vgetcpu.c x86-64: Clean up vdso/kernel shared variables 2011-05-24 14:51:28 +02:00
vma.c Merge branch 'x86-cpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2011-10-28 05:03:12 -07:00