linux/arch
Martin Schwidefsky 53e857f308 s390/mm,tlb: race of lazy TLB flush vs. recreation of TLB entries
Git commit 050eef364a "[S390] fix tlb flushing vs. concurrent
/proc accesses" introduced the attach counter to avoid using the
mm_users value to decide between IPTE for every PTE and lazy TLB
flushing with IDTE. That fixed the problem with mm_users but it
introduced another subtle race, fortunately one that is very hard
to hit.
The background is the requirement of the architecture that a valid
PTE may not be changed while it can be used concurrently by another
cpu. The decision between IPTE and lazy TLB flushing needs to be
done while the PTE is still valid. Now if the virtual cpu is
temporarily stopped after the decision to use lazy TLB flushing but
before the invalid bit of the PTE has been set, another cpu can attach
the mm, find that flush_mm is set, do the IDTE, return to userspace,
and recreate a TLB that uses the PTE in question. When the first,
stopped cpu continues it will change the PTE while it is attached on
another cpu. The first cpu will do another IDTE shortly after the
modification of the PTE which makes the race window quite short.

To fix this race the CPU that wants to attach the address space of a
user space thread needs to wait for the end of the PTE modification.
The number of concurrent TLB flushers for an mm is tracked in the
upper 16 bits of the attach_count and finish_arch_post_lock_switch
is used to wait for the end of the flush operation if required.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2014-02-21 08:50:18 +01:00
..
alpha alpha: fix broken network checksum 2014-01-31 09:21:55 -08:00
arc Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild 2014-01-30 16:58:05 -08:00
arm Merge branch 'fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-arm 2014-02-18 15:49:58 -08:00
arm64 A small error handling problem and a compile breakage for ARM64. 2014-02-14 11:10:49 -08:00
avr32 avr32: add generic vga.h to Kbuild 2014-02-17 11:24:48 +01:00
blackfin Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media 2014-01-31 09:31:14 -08:00
c6x
cris CRIS correction for 3.14 2014-01-28 09:01:14 -08:00
frv Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild 2014-01-30 16:58:05 -08:00
hexagon
ia64 [IA64] Wire up new sched_setattr and sched_getattr syscalls 2014-01-28 09:52:53 -08:00
m32r
m68k Merge branch 'for-3.14/core' of git://git.kernel.dk/linux-block 2014-01-30 11:19:05 -08:00
metag
microblaze microblaze: Fix a typo when disabling stack protection 2014-02-10 07:44:11 +01:00
mips MIPS: fpu.h: Fix build when CONFIG_BUG is not set 2014-02-06 13:42:43 +01:00
mn10300 Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild 2014-01-30 16:58:05 -08:00
openrisc OpenRISC updates for 3.14 2014-01-30 17:08:41 -08:00
parisc execve: use 'struct filename *' for executable name passing 2014-02-05 12:54:53 -08:00
powerpc powerpc/eeh: Disable EEH on reboot 2014-02-17 11:19:39 +11:00
s390 s390/mm,tlb: race of lazy TLB flush vs. recreation of TLB entries 2014-02-21 08:50:18 +01:00
score Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media 2014-01-31 09:31:14 -08:00
sh
sparc sparc: Hook up sched_setattr and sched_getattr syscalls. 2014-01-29 00:45:06 -08:00
tile tile: remove compat_sys_lookup_dcookie declaration to fix compile error 2014-02-01 10:55:15 -08:00
um
unicore32 arch/unicore32/kernel/early_printk.c:setup_early_printk: missing initialization 2014-01-27 21:02:39 -08:00
x86 Two fixes in the tracing utility. 2014-02-15 15:03:34 -08:00
xtensa Merge branch 'for-3.14/core' of git://git.kernel.dk/linux-block 2014-01-30 11:19:05 -08:00
.gitignore
Kconfig