aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/mm/pgtable.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/s390/mm/pgtable.c')
-rw-r--r--arch/s390/mm/pgtable.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/s390/mm/pgtable.c b/arch/s390/mm/pgtable.c
index 19daa53a3da4..5404a6261db9 100644
--- a/arch/s390/mm/pgtable.c
+++ b/arch/s390/mm/pgtable.c
@@ -986,11 +986,21 @@ int set_guest_storage_key(struct mm_struct *mm, unsigned long addr,
986 pte_t *ptep; 986 pte_t *ptep;
987 987
988 down_read(&mm->mmap_sem); 988 down_read(&mm->mmap_sem);
989retry:
989 ptep = get_locked_pte(current->mm, addr, &ptl); 990 ptep = get_locked_pte(current->mm, addr, &ptl);
990 if (unlikely(!ptep)) { 991 if (unlikely(!ptep)) {
991 up_read(&mm->mmap_sem); 992 up_read(&mm->mmap_sem);
992 return -EFAULT; 993 return -EFAULT;
993 } 994 }
995 if (!(pte_val(*ptep) & _PAGE_INVALID) &&
996 (pte_val(*ptep) & _PAGE_PROTECT)) {
997 pte_unmap_unlock(*ptep, ptl);
998 if (fixup_user_fault(current, mm, addr, FAULT_FLAG_WRITE)) {
999 up_read(&mm->mmap_sem);
1000 return -EFAULT;
1001 }
1002 goto retry;
1003 }
994 1004
995 new = old = pgste_get_lock(ptep); 1005 new = old = pgste_get_lock(ptep);
996 pgste_val(new) &= ~(PGSTE_GR_BIT | PGSTE_GC_BIT | 1006 pgste_val(new) &= ~(PGSTE_GR_BIT | PGSTE_GC_BIT |