summaryrefslogtreecommitdiffstats
path: root/arch/s390/mm/pgtable.c
diff options
context:
space:
mode:
authorMike Turquette <mturquette@linaro.org>2014-09-26 16:09:39 -0700
committerMike Turquette <mturquette@linaro.org>2014-09-26 16:09:39 -0700
commitb6b2fe5b6e956c8217a7584472a3ac5c068b61d4 (patch)
tree899d38684e674a05fc3e4ae2885529b916583323 /arch/s390/mm/pgtable.c
parentb52f4914f3be3ff50e7308e3ce03a2ce71195ecc (diff)
parentb9e742c3164344fece3615aca42ec51b41753908 (diff)
downloadlinux-b6b2fe5b6e956c8217a7584472a3ac5c068b61d4.tar.bz2
Merge tag 'tegra-clk-3.18' of git://nv-tegra.nvidia.com/user/pdeschrijver/linux into clk-next
Tegra clk updates for 3.18
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,
pte_t *ptep;
down_read(&mm->mmap_sem);
+retry:
ptep = get_locked_pte(current->mm, addr, &ptl);
if (unlikely(!ptep)) {
up_read(&mm->mmap_sem);
return -EFAULT;
}
+ if (!(pte_val(*ptep) & _PAGE_INVALID) &&
+ (pte_val(*ptep) & _PAGE_PROTECT)) {
+ pte_unmap_unlock(*ptep, ptl);
+ if (fixup_user_fault(current, mm, addr, FAULT_FLAG_WRITE)) {
+ up_read(&mm->mmap_sem);
+ return -EFAULT;
+ }
+ goto retry;
+ }
new = old = pgste_get_lock(ptep);
pgste_val(new) &= ~(PGSTE_GR_BIT | PGSTE_GC_BIT |