linux-stable/arch/s390/mm
David Hildenbrand 998f637cc4 s390/mm: avoid races on region/segment/page table shadowing
We have to unlock sg->guest_table_lock in order to call
gmap_protect_rmap(). If we sleep just before that call, another VCPU
might pick up that shadowed page table (while it is not protected yet)
and use it.

In order to avoid these races, we have to introduce a third state -
"origin set but still invalid" for an entry. This way, we can avoid
another thread already using the entry before the table is fully protected.
As soon as everything is set up, we can clear the invalid bit - if we
had no race with the unshadowing code.

Suggested-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
2016-06-20 09:54:27 +02:00
..
cmm.c s390: convert use of typedef ctl_table to struct ctl_table 2013-10-28 08:36:25 +01:00
dump_pagetables.c s390: remove 31 bit support 2015-03-25 11:49:33 +01:00
extmem.c s390: Use pr_warn instead of pr_warning 2016-03-07 13:12:04 +01:00
fault.c s390/mm: add shadow gmap support 2016-06-20 09:54:04 +02:00
gmap.c s390/mm: avoid races on region/segment/page table shadowing 2016-06-20 09:54:27 +02:00
gup.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux 2016-04-01 07:15:54 -05:00
hugetlbpage.c s390/mm: uninline pmdp_xxx functions from pgtable.h 2016-03-08 15:00:14 +01:00
init.c s390/mm: fix asce_bits handling with dynamic pagetable levels 2016-04-21 09:50:09 +02:00
maccess.c s390/maccess: reduce stnsm instructions 2016-02-17 09:05:04 +01:00
Makefile s390/extable: use generic search and sort routines 2016-03-22 15:36:02 -07:00
mem_detect.c s390/mem_detect: use unsigned longs 2016-01-11 12:27:11 +01:00
mmap.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux 2016-05-18 12:17:16 -07:00
page-states.c s390/cmma: remove "cmma disable" code in case of dump again 2014-05-20 08:58:42 +02:00
pageattr.c s390/pageattr: do a single TLB flush for change_page_attr 2016-02-23 08:56:17 +01:00
pgalloc.c s390/mm: add shadow gmap support 2016-06-20 09:54:04 +02:00
pgtable.c s390/mm: shadow pages with real guest requested protection 2016-06-20 09:54:19 +02:00
vmem.c s390/vmem: remove unused function parameter 2016-05-11 10:20:32 +02:00