alistair23-linux/arch/s390/kernel
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
..
vdso32 s390/time,vdso: fix clock_gettime for CLOCK_MONOTONIC 2013-12-02 18:15:25 +01:00
vdso64 s390/time,vdso: fix clock_gettime for CLOCK_MONOTONIC 2013-12-02 18:15:25 +01:00
.gitignore
asm-offsets.c s390/vdso: ectg gettime support for CLOCK_THREAD_CPUTIME_ID 2013-12-02 15:31:10 +01:00
audit.c
audit.h
base.S s390/comments: unify copyright messages and remove file names 2012-07-20 11:15:04 +02:00
cache.c s390/cache: get rid of compile warning 2013-10-24 17:17:06 +02:00
compat_audit.c
compat_exec_domain.c s390/comments: unify copyright messages and remove file names 2012-07-20 11:15:04 +02:00
compat_linux.c s390/compat: change parameter types from unsigned long to compat_ulong_t 2014-01-29 16:22:40 -08:00
compat_linux.h s390: fix save and restore of the floating-point-control register 2013-10-24 17:17:11 +02:00
compat_ptrace.h
compat_signal.c s390/compat: correct check for EFAULT in rt-signal frame creation 2013-12-16 14:37:47 +01:00
compat_wrapper.S s390: wire up sys_sched_setattr/sys_sched_getattr 2014-01-22 14:02:19 +01:00
cpcmd.c s390/comments: unify copyright messages and remove file names 2012-07-20 11:15:04 +02:00
crash_dump.c s390/sclp: Determine HSA size dynamically for zfcpdump 2013-11-15 14:08:40 +01:00
debug.c s390: convert use of typedef ctl_table to struct ctl_table 2013-10-28 08:36:25 +01:00
diag.c
dis.c s390/kprobes: allow kprobes only on known instructions 2013-10-24 17:16:50 +02:00
dumpstack.c s390/dis: move disassembler function prototypes to proper header file 2013-10-24 17:16:48 +02:00
early.c s390/setup: get rid of MACHINE_HAS_MVCOS machine flag 2014-02-21 08:50:15 +01:00
ebcdic.c s390/comments: unify copyright messages and remove file names 2012-07-20 11:15:04 +02:00
entry.h s390/mm,tlb: correct tlb flush on page table upgrade 2013-11-04 13:51:47 +01:00
entry.S s390/mm,tlb: race of lazy TLB flush vs. recreation of TLB entries 2014-02-21 08:50:18 +01:00
entry64.S s390/mm,tlb: race of lazy TLB flush vs. recreation of TLB entries 2014-02-21 08:50:18 +01:00
ftrace.c s390/ftrace: prepare_ftrace_return() function call order 2013-10-24 17:17:03 +02:00
head.S s390/bitops: optimize set_bit() for constant values 2013-10-24 17:16:53 +02:00
head31.S s390/mm: let kernel text section always begin at 1MB 2012-10-09 14:16:59 +02:00
head64.S s390: fix kernel crash due to linkage stack instructions 2014-02-05 11:00:50 +01:00
head_kdump.S s390/kdump: Use 64 bit mode for 0x10000 entry point 2012-10-18 17:50:09 +02:00
ipl.c s390/uaccess: always run the kernel in home space 2013-10-24 17:16:57 +02:00
irq.c irq: Consolidate do_softirq() arch overriden implementations 2013-10-01 12:53:25 +02:00
jump_label.c
kprobes.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2013-11-15 16:47:22 -08:00
lgr.c s390/sysinfo,stsi: change return code handling 2012-09-26 15:45:12 +02:00
machine_kexec.c s390: make various functions static, add declarations to header files 2013-09-07 11:58:03 +02:00
Makefile s390/perf: add support for the CPU-Measurement Sampling Facility 2013-12-16 14:37:51 +01:00
mcount.S s390/ftrace: fix mcount adjustment 2013-05-15 13:09:09 +02:00
mcount64.S s390/ftrace: fix mcount adjustment 2013-05-15 13:09:09 +02:00
module.c mm/arch: use NUMA_NO_NODE 2013-11-13 12:09:05 +09:00
nmi.c s390/time: clock comparator revalidation 2013-08-22 12:20:08 +02:00
os_info.c Include missing linux/slab.h inclusions 2013-04-29 15:42:01 -04:00
perf_cpum_cf.c s390/cpum_cf: Export event names in sysfs 2013-12-16 14:37:50 +01:00
perf_cpum_cf_events.c s390/cpum_cf: Export event names in sysfs 2013-12-16 14:37:50 +01:00
perf_cpum_sf.c s390: delete new instances of __cpuinit usage 2014-01-13 16:50:25 +01:00
perf_event.c s390/cpum_sf: fix printk format warnings 2014-01-16 16:40:16 +01:00
pgm_check.S s390/mm: handle asce-type exceptions as normal page fault 2013-11-25 09:15:42 +01:00
process.c s390/mm: optimize randomize_et_dyn for !PF_RANDOMIZE 2013-12-18 17:36:38 +01:00
processor.c s390: delete __cpuinit usage from all s390 files 2013-07-14 19:36:53 -04:00
ptrace.c s390: optimize control register update 2013-12-16 14:37:45 +01:00
reipl.S s390/comments: unify copyright messages and remove file names 2012-07-20 11:15:04 +02:00
reipl64.S s390/comments: unify copyright messages and remove file names 2012-07-20 11:15:04 +02:00
relocate_kernel.S s390/comments: unify copyright messages and remove file names 2012-07-20 11:15:04 +02:00
relocate_kernel64.S s390/comments: unify copyright messages and remove file names 2012-07-20 11:15:04 +02:00
runtime_instr.c s390/uaccess: always run the kernel in home space 2013-10-24 17:16:57 +02:00
s390_ksyms.c s390: use IS_ENABLED to check if a CONFIG is set to y or m 2013-12-16 14:38:04 +01:00
sclp.S s390/sclp: fix new line detection 2013-06-05 17:36:21 +02:00
setup.c s390/uaccess: remove dead kernel parameter 'user_mode=' 2014-02-21 08:50:16 +01:00
signal.c s390/signal: always restore saved runtime instrumentation psw bit 2013-11-20 09:04:53 +01:00
smp.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux 2014-01-20 09:23:31 -08:00
stacktrace.c s390/comments: unify copyright messages and remove file names 2012-07-20 11:15:04 +02:00
suspend.c s390: make various functions static, add declarations to header files 2013-09-07 11:58:03 +02:00
swsusp_asm64.S s390/hibernate: add early resume function 2013-08-30 08:57:15 +02:00
sys_s390.c teach SYSCALL_DEFINE<n> how to deal with long long/unsigned long long 2013-03-03 22:46:22 -05:00
syscalls.S s390: wire up sys_sched_setattr/sys_sched_getattr 2014-01-22 14:02:19 +01:00
sysinfo.c s390: delete __cpuinit usage from all s390 files 2013-07-14 19:36:53 -04:00
time.c s390,time: revert direct ktime path for s390 clockevent device 2013-11-25 09:15:41 +01:00
topology.c s390/topology: export cpu_topology 2013-01-08 10:57:10 +01:00
traps.c s390/dumpstack: fix call chain walking 2013-04-17 14:07:28 +02:00
vdso.c s390/vdso: fix access-list entry initialization 2013-12-02 15:31:09 +01:00
vmlinux.lds.S s390/linker skript: discard exit.data at runtime 2013-02-14 15:55:21 +01:00
vtime.c s390/vtime: correct idle time calculation 2013-10-31 09:52:52 +01:00