]> git.baikalelectronics.ru Git - kernel.git/commit
s390/mm,tlb: safeguard against speculative TLB creation
authorMartin Schwidefsky <schwidefsky@de.ibm.com>
Thu, 3 Apr 2014 11:54:59 +0000 (13:54 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Thu, 3 Apr 2014 12:30:55 +0000 (14:30 +0200)
commit960c844d5b05dfc41d600919aea8f3aec5700ef4
tree2bf430c528af833f0544f575512f7e49faf81f57
parentb39d903966b6e213f7221372b4b293b639ddbd3e
s390/mm,tlb: safeguard against speculative TLB creation

The principles of operations states that the CPU is allowed to create
TLB entries for an address space anytime while an ASCE is loaded to
the control register. This is true even if the CPU is running in the
kernel and the user address space is not (actively) accessed.

In theory this can affect two aspects of the TLB flush logic.
For full-mm flushes the ASCE of the dying process is still attached.
The approach to flush first with IDTE and then just free all page
tables can in theory lead to stale TLB entries. Use the batched
free of page tables for the full-mm flushes as well.

For operations that can have a stale ASCE in the control register,
e.g. a delayed update_user_asce in switch_mm, load the kernel ASCE
to prevent invalid TLBs from being created.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/include/asm/mmu_context.h
arch/s390/include/asm/tlb.h
arch/s390/mm/pgtable.c