aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/mm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/s390/mm')
-rw-r--r--arch/s390/mm/pgtable.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/arch/s390/mm/pgtable.c b/arch/s390/mm/pgtable.c
index be80f55a1b78..02a8607bbeb5 100644
--- a/arch/s390/mm/pgtable.c
+++ b/arch/s390/mm/pgtable.c
@@ -1378,6 +1378,29 @@ int s390_enable_sie(void)
1378} 1378}
1379EXPORT_SYMBOL_GPL(s390_enable_sie); 1379EXPORT_SYMBOL_GPL(s390_enable_sie);
1380 1380
1381/*
1382 * Enable storage key handling from now on and initialize the storage
1383 * keys with the default key.
1384 */
1385void s390_enable_skey(void)
1386{
1387 /*
1388 * To avoid races between multiple vcpus, ending in calling
1389 * page_table_reset twice or more,
1390 * the page_table_lock is taken for serialization.
1391 */
1392 spin_lock(&current->mm->page_table_lock);
1393 if (mm_use_skey(current->mm)) {
1394 spin_unlock(&current->mm->page_table_lock);
1395 return;
1396 }
1397
1398 current->mm->context.use_skey = 1;
1399 spin_unlock(&current->mm->page_table_lock);
1400 page_table_reset_pgste(current->mm, 0, TASK_SIZE, true);
1401}
1402EXPORT_SYMBOL_GPL(s390_enable_skey);
1403
1381#ifdef CONFIG_TRANSPARENT_HUGEPAGE 1404#ifdef CONFIG_TRANSPARENT_HUGEPAGE
1382int pmdp_clear_flush_young(struct vm_area_struct *vma, unsigned long address, 1405int pmdp_clear_flush_young(struct vm_area_struct *vma, unsigned long address,
1383 pmd_t *pmdp) 1406 pmd_t *pmdp)