diff options
author | Gerald Schaefer <gerald.schaefer@de.ibm.com> | 2009-03-18 08:27:35 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2009-03-18 08:28:13 -0400 |
commit | 2887fc5aa60803b9d6d38c79248805f08d8b0e28 (patch) | |
tree | 1aa69da137c2be0a93e9e639750afe065dbdf98a | |
parent | cf087343805ebfea2b1234b06fd5f12273e865b1 (diff) |
[S390] Dont check for pfn_valid() in uaccess_pt.c
pfn_valid() actually checks for a valid struct page and not for a
valid pfn. Using xip mappings w/o struct pages, this will result in
-EFAULT returned by the (page table walk) user copy functions,
even though there is valid memory. Those user copy functions don't
need a struct page, so this patch just removes the pfn_valid() check.
Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
-rw-r--r-- | arch/s390/lib/uaccess_pt.c | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/arch/s390/lib/uaccess_pt.c b/arch/s390/lib/uaccess_pt.c index d66215b0fde9..b0b84c35b0ad 100644 --- a/arch/s390/lib/uaccess_pt.c +++ b/arch/s390/lib/uaccess_pt.c | |||
@@ -119,8 +119,6 @@ retry: | |||
119 | goto fault; | 119 | goto fault; |
120 | 120 | ||
121 | pfn = pte_pfn(*pte); | 121 | pfn = pte_pfn(*pte); |
122 | if (!pfn_valid(pfn)) | ||
123 | goto out; | ||
124 | 122 | ||
125 | offset = uaddr & (PAGE_SIZE - 1); | 123 | offset = uaddr & (PAGE_SIZE - 1); |
126 | size = min(n - done, PAGE_SIZE - offset); | 124 | size = min(n - done, PAGE_SIZE - offset); |
@@ -135,7 +133,6 @@ retry: | |||
135 | done += size; | 133 | done += size; |
136 | uaddr += size; | 134 | uaddr += size; |
137 | } while (done < n); | 135 | } while (done < n); |
138 | out: | ||
139 | spin_unlock(&mm->page_table_lock); | 136 | spin_unlock(&mm->page_table_lock); |
140 | return n - done; | 137 | return n - done; |
141 | fault: | 138 | fault: |
@@ -163,9 +160,6 @@ retry: | |||
163 | goto fault; | 160 | goto fault; |
164 | 161 | ||
165 | pfn = pte_pfn(*pte); | 162 | pfn = pte_pfn(*pte); |
166 | if (!pfn_valid(pfn)) | ||
167 | goto out; | ||
168 | |||
169 | ret = (pfn << PAGE_SHIFT) + (uaddr & (PAGE_SIZE - 1)); | 163 | ret = (pfn << PAGE_SHIFT) + (uaddr & (PAGE_SIZE - 1)); |
170 | out: | 164 | out: |
171 | return ret; | 165 | return ret; |
@@ -244,11 +238,6 @@ retry: | |||
244 | goto fault; | 238 | goto fault; |
245 | 239 | ||
246 | pfn = pte_pfn(*pte); | 240 | pfn = pte_pfn(*pte); |
247 | if (!pfn_valid(pfn)) { | ||
248 | done = -1; | ||
249 | goto out; | ||
250 | } | ||
251 | |||
252 | offset = uaddr & (PAGE_SIZE-1); | 241 | offset = uaddr & (PAGE_SIZE-1); |
253 | addr = (char *)(pfn << PAGE_SHIFT) + offset; | 242 | addr = (char *)(pfn << PAGE_SHIFT) + offset; |
254 | len = min(count - done, PAGE_SIZE - offset); | 243 | len = min(count - done, PAGE_SIZE - offset); |
@@ -256,7 +245,6 @@ retry: | |||
256 | done += len_str; | 245 | done += len_str; |
257 | uaddr += len_str; | 246 | uaddr += len_str; |
258 | } while ((len_str == len) && (done < count)); | 247 | } while ((len_str == len) && (done < count)); |
259 | out: | ||
260 | spin_unlock(&mm->page_table_lock); | 248 | spin_unlock(&mm->page_table_lock); |
261 | return done + 1; | 249 | return done + 1; |
262 | fault: | 250 | fault: |
@@ -325,12 +313,7 @@ retry: | |||
325 | } | 313 | } |
326 | 314 | ||
327 | pfn_from = pte_pfn(*pte_from); | 315 | pfn_from = pte_pfn(*pte_from); |
328 | if (!pfn_valid(pfn_from)) | ||
329 | goto out; | ||
330 | pfn_to = pte_pfn(*pte_to); | 316 | pfn_to = pte_pfn(*pte_to); |
331 | if (!pfn_valid(pfn_to)) | ||
332 | goto out; | ||
333 | |||
334 | offset_from = uaddr_from & (PAGE_SIZE-1); | 317 | offset_from = uaddr_from & (PAGE_SIZE-1); |
335 | offset_to = uaddr_from & (PAGE_SIZE-1); | 318 | offset_to = uaddr_from & (PAGE_SIZE-1); |
336 | offset_max = max(offset_from, offset_to); | 319 | offset_max = max(offset_from, offset_to); |
@@ -342,7 +325,6 @@ retry: | |||
342 | uaddr_from += size; | 325 | uaddr_from += size; |
343 | uaddr_to += size; | 326 | uaddr_to += size; |
344 | } while (done < n); | 327 | } while (done < n); |
345 | out: | ||
346 | spin_unlock(&mm->page_table_lock); | 328 | spin_unlock(&mm->page_table_lock); |
347 | return n - done; | 329 | return n - done; |
348 | fault: | 330 | fault: |