1 From: Gerald Schaefer <geraldsc@de.ibm.com>
2 Subject: kernel: don't check for pfn_valid() in uaccess_pt.c
3 References: bnc#484767,LTC#52175
5 Symptom: Access to xip mappings fails (-EFAULT).
6 Problem: pfn_valid() actually checks for a valid struct page and
7 not for a valid pfn. Using xip mappings w/o struct pages,
8 this will result in -EFAULT returned by the (page table
9 walk) user copy functions, even though there is valid memory.
10 Solution: Those user copy functions don't need a struct page, so this
11 patch just removes the pfn_valid() check.
13 Acked-by: John Jolly <jjolly@suse.de>
15 arch/s390/lib/uaccess_pt.c | 18 ------------------
16 1 file changed, 18 deletions(-)
18 Index: linux-sles11/arch/s390/lib/uaccess_pt.c
19 ===================================================================
20 --- linux-sles11.orig/arch/s390/lib/uaccess_pt.c
21 +++ linux-sles11/arch/s390/lib/uaccess_pt.c
22 @@ -119,8 +119,6 @@ retry:
26 - if (!pfn_valid(pfn))
29 offset = uaddr & (PAGE_SIZE - 1);
30 size = min(n - done, PAGE_SIZE - offset);
31 @@ -135,7 +133,6 @@ retry:
36 spin_unlock(&mm->page_table_lock);
39 @@ -163,9 +160,6 @@ retry:
43 - if (!pfn_valid(pfn))
46 ret = (pfn << PAGE_SHIFT) + (uaddr & (PAGE_SIZE - 1));
49 @@ -244,11 +238,6 @@ retry:
53 - if (!pfn_valid(pfn)) {
58 offset = uaddr & (PAGE_SIZE-1);
59 addr = (char *)(pfn << PAGE_SHIFT) + offset;
60 len = min(count - done, PAGE_SIZE - offset);
61 @@ -256,7 +245,6 @@ retry:
64 } while ((len_str == len) && (done < count));
66 spin_unlock(&mm->page_table_lock);
69 @@ -325,12 +313,7 @@ retry:
72 pfn_from = pte_pfn(*pte_from);
73 - if (!pfn_valid(pfn_from))
75 pfn_to = pte_pfn(*pte_to);
76 - if (!pfn_valid(pfn_to))
79 offset_from = uaddr_from & (PAGE_SIZE-1);
80 offset_to = uaddr_from & (PAGE_SIZE-1);
81 offset_max = max(offset_from, offset_to);
82 @@ -342,7 +325,6 @@ retry:
87 spin_unlock(&mm->page_table_lock);