linux/arch/s390
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
..
appldata s390/appldata: restore missing init_virt_timer() 2014-01-29 09:07:51 +01:00
boot s390/boot: Install bzImage as default kernel image 2013-11-15 14:08:36 +01:00
configs s390: add a couple of useful defconfigs 2013-10-24 17:17:14 +02:00
crypto crypto: s390 - fix des and des3_ede ctr concurrency issue 2014-01-30 21:45:14 +08:00
hypfs s390/hypfs: add interface for diagnose 0x304 2014-01-24 09:40:59 +01:00
include s390/mm,tlb: race of lazy TLB flush vs. recreation of TLB entries 2014-02-21 08:50:18 +01:00
kernel s390/mm,tlb: race of lazy TLB flush vs. recreation of TLB entries 2014-02-21 08:50:18 +01:00
kvm This deals with 2 guest features that need enablement in the kvm host: 2014-01-23 11:38:13 +01:00
lib s390/uaccess: introduce 'uaccesspt' kernel parameter 2014-02-21 08:50:17 +01:00
math-emu s390: fix save and restore of the floating-point-control register 2013-10-24 17:17:11 +02:00
mm s390/uaccess: consistent types 2014-02-21 08:50:15 +01:00
net s390/bpf,jit: fix 32 bit divisions, use unsigned divide instructions 2014-01-17 18:54:49 -08:00
oprofile s390/cpum_sf: Add raw data sampling to support the diagnostic-sampling function 2013-12-16 14:38:00 +01:00
pci PCI changes for the v3.14 merge window: 2014-01-22 16:39:28 -08:00
defconfig Update default configuration 2013-10-24 17:17:15 +02:00
Kbuild s390/pci: base support 2012-11-30 15:40:45 +01:00
Kconfig Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux 2014-01-28 09:02:24 -08:00
Kconfig.debug Kconfig: consolidate CONFIG_DEBUG_STRICT_USER_COPY_CHECKS 2013-04-30 17:04:09 -07:00
Makefile s390: allow to set gcc -mtune flag 2013-10-31 09:54:01 +01:00