aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2007-02-12 19:46:06 -0500
committerPaul Mackerras <paulus@samba.org>2007-02-12 23:35:53 -0500
commit78bde53e351bc89cff85d1c2c7e6d7c2ffdf120d (patch)
treec81720f08fc6410c41c50fde57588af66b00b6dc /arch/powerpc
parent9724b86f0706ca9b552d82e013cb0c208b4f5529 (diff)
[POWERPC] spufs: remove need for struct page for SPEs
This patch removes the need for struct page for SPE local store and registers from spufs. It also makes the locking much more obvious and no longer relying on the truncate logic black magic for protecting against races between unmap_mapping_range() and new pages faulted in. It does so by switching to a nopfn() handler and using the new vm_insert_pfn() to setup the PTEs itself while holding a lock on the SPE. The nice thing is that this patch actually removes a lot more code than it adds :-) Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/Kconfig2
-rw-r--r--arch/powerpc/platforms/cell/spu_manage.c102
-rw-r--r--arch/powerpc/platforms/cell/spufs/file.c121
3 files changed, 80 insertions, 145 deletions
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 0088c5ebca78..340d9beab6d1 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -876,7 +876,7 @@ config ARCH_SPARSEMEM_ENABLE
876 876
877config ARCH_SPARSEMEM_DEFAULT 877config ARCH_SPARSEMEM_DEFAULT
878 def_bool y 878 def_bool y
879 depends on (SMP && PPC_PSERIES) || PPC_CELL 879 depends on (SMP && PPC_PSERIES) || PPC_PS3
880 880
881config ARCH_POPULATES_NODE_MAP 881config ARCH_POPULATES_NODE_MAP
882 def_bool y 882 def_bool y
diff --git a/arch/powerpc/platforms/cell/spu_manage.c b/arch/powerpc/platforms/cell/spu_manage.c
index d8b39fe39cdd..e34599f53d28 100644
--- a/arch/powerpc/platforms/cell/spu_manage.c
+++ b/arch/powerpc/platforms/cell/spu_manage.c
@@ -59,63 +59,6 @@ static u64 __init find_spu_unit_number(struct device_node *spe)
59 return 0; 59 return 0;
60} 60}
61 61
62static int __init cell_spuprop_present(struct spu *spu, struct device_node *spe,
63 const char *prop)
64{
65 const struct address_prop {
66 unsigned long address;
67 unsigned int len;
68 } __attribute__((packed)) *p;
69 int proplen;
70
71 unsigned long start_pfn, nr_pages;
72 struct pglist_data *pgdata;
73 struct zone *zone;
74 int ret;
75
76 p = get_property(spe, prop, &proplen);
77 WARN_ON(proplen != sizeof (*p));
78
79 start_pfn = p->address >> PAGE_SHIFT;
80 nr_pages = ((unsigned long)p->len + PAGE_SIZE - 1) >> PAGE_SHIFT;
81
82 pgdata = NODE_DATA(spu->node);
83 zone = pgdata->node_zones;
84
85 ret = __add_pages(zone, start_pfn, nr_pages);
86
87 return ret;
88}
89
90static void __iomem * __init map_spe_prop(struct spu *spu,
91 struct device_node *n, const char *name)
92{
93 const struct address_prop {
94 unsigned long address;
95 unsigned int len;
96 } __attribute__((packed)) *prop;
97
98 const void *p;
99 int proplen;
100 void __iomem *ret = NULL;
101 int err = 0;
102
103 p = get_property(n, name, &proplen);
104 if (proplen != sizeof (struct address_prop))
105 return NULL;
106
107 prop = p;
108
109 err = cell_spuprop_present(spu, n, name);
110 if (err && (err != -EEXIST))
111 goto out;
112
113 ret = ioremap(prop->address, prop->len);
114
115 out:
116 return ret;
117}
118
119static void spu_unmap(struct spu *spu) 62static void spu_unmap(struct spu *spu)
120{ 63{
121 if (!firmware_has_feature(FW_FEATURE_LPAR)) 64 if (!firmware_has_feature(FW_FEATURE_LPAR))
@@ -157,6 +100,23 @@ static int __init spu_map_interrupts_old(struct spu *spu,
157 return spu->irqs[2] == NO_IRQ ? -EINVAL : 0; 100 return spu->irqs[2] == NO_IRQ ? -EINVAL : 0;
158} 101}
159 102
103static void __iomem * __init spu_map_prop_old(struct spu *spu,
104 struct device_node *n,
105 const char *name)
106{
107 const struct address_prop {
108 unsigned long address;
109 unsigned int len;
110 } __attribute__((packed)) *prop;
111 int proplen;
112
113 prop = get_property(n, name, &proplen);
114 if (prop == NULL || proplen != sizeof (struct address_prop))
115 return NULL;
116
117 return ioremap(prop->address, prop->len);
118}
119
160static int __init spu_map_device_old(struct spu *spu) 120static int __init spu_map_device_old(struct spu *spu)
161{ 121{
162 struct device_node *node = spu->devnode; 122 struct device_node *node = spu->devnode;
@@ -175,7 +135,7 @@ static int __init spu_map_device_old(struct spu *spu)
175 135
176 /* we use local store as ram, not io memory */ 136 /* we use local store as ram, not io memory */
177 spu->local_store = (void __force *) 137 spu->local_store = (void __force *)
178 map_spe_prop(spu, node, "local-store"); 138 spu_map_prop_old(spu, node, "local-store");
179 if (!spu->local_store) 139 if (!spu->local_store)
180 goto out; 140 goto out;
181 141
@@ -184,16 +144,16 @@ static int __init spu_map_device_old(struct spu *spu)
184 goto out_unmap; 144 goto out_unmap;
185 spu->problem_phys = *(unsigned long *)prop; 145 spu->problem_phys = *(unsigned long *)prop;
186 146
187 spu->problem = map_spe_prop(spu, node, "problem"); 147 spu->problem = spu_map_prop_old(spu, node, "problem");
188 if (!spu->problem) 148 if (!spu->problem)
189 goto out_unmap; 149 goto out_unmap;
190 150
191 spu->priv2 = map_spe_prop(spu, node, "priv2"); 151 spu->priv2 = spu_map_prop_old(spu, node, "priv2");
192 if (!spu->priv2) 152 if (!spu->priv2)
193 goto out_unmap; 153 goto out_unmap;
194 154
195 if (!firmware_has_feature(FW_FEATURE_LPAR)) { 155 if (!firmware_has_feature(FW_FEATURE_LPAR)) {
196 spu->priv1 = map_spe_prop(spu, node, "priv1"); 156 spu->priv1 = spu_map_prop_old(spu, node, "priv1");
197 if (!spu->priv1) 157 if (!spu->priv1)
198 goto out_unmap; 158 goto out_unmap;
199 } 159 }
@@ -245,34 +205,20 @@ static int spu_map_resource(struct spu *spu, int nr,
245 void __iomem** virt, unsigned long *phys) 205 void __iomem** virt, unsigned long *phys)
246{ 206{
247 struct device_node *np = spu->devnode; 207 struct device_node *np = spu->devnode;
248 unsigned long start_pfn, nr_pages;
249 struct pglist_data *pgdata;
250 struct zone *zone;
251 struct resource resource = { }; 208 struct resource resource = { };
252 unsigned long len; 209 unsigned long len;
253 int ret; 210 int ret;
254 211
255 ret = of_address_to_resource(np, nr, &resource); 212 ret = of_address_to_resource(np, nr, &resource);
256 if (ret) 213 if (ret)
257 goto out; 214 return ret;
258
259 if (phys) 215 if (phys)
260 *phys = resource.start; 216 *phys = resource.start;
261 len = resource.end - resource.start + 1; 217 len = resource.end - resource.start + 1;
262 *virt = ioremap(resource.start, len); 218 *virt = ioremap(resource.start, len);
263 if (!*virt) 219 if (!*virt)
264 ret = -EINVAL; 220 return -EINVAL;
265 221 return 0;
266 start_pfn = resource.start >> PAGE_SHIFT;
267 nr_pages = (len + PAGE_SIZE - 1) >> PAGE_SHIFT;
268
269 pgdata = NODE_DATA(spu->node);
270 zone = pgdata->node_zones;
271
272 ret = __add_pages(zone, start_pfn, nr_pages);
273
274out:
275 return ret;
276} 222}
277 223
278static int __init spu_map_device(struct spu *spu) 224static int __init spu_map_device(struct spu *spu)
diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c
index af9e9455a706..7fb9a6dc4f18 100644
--- a/arch/powerpc/platforms/cell/spufs/file.c
+++ b/arch/powerpc/platforms/cell/spufs/file.c
@@ -95,14 +95,12 @@ spufs_mem_write(struct file *file, const char __user *buffer,
95 return ret; 95 return ret;
96} 96}
97 97
98static struct page * 98static unsigned long spufs_mem_mmap_nopfn(struct vm_area_struct *vma,
99spufs_mem_mmap_nopage(struct vm_area_struct *vma, 99 unsigned long address)
100 unsigned long address, int *type)
101{ 100{
102 struct page *page = NOPAGE_SIGBUS;
103
104 struct spu_context *ctx = vma->vm_file->private_data; 101 struct spu_context *ctx = vma->vm_file->private_data;
105 unsigned long offset = address - vma->vm_start; 102 unsigned long pfn, offset = address - vma->vm_start;
103
106 offset += vma->vm_pgoff << PAGE_SHIFT; 104 offset += vma->vm_pgoff << PAGE_SHIFT;
107 105
108 spu_acquire(ctx); 106 spu_acquire(ctx);
@@ -110,24 +108,22 @@ spufs_mem_mmap_nopage(struct vm_area_struct *vma,
110 if (ctx->state == SPU_STATE_SAVED) { 108 if (ctx->state == SPU_STATE_SAVED) {
111 vma->vm_page_prot = __pgprot(pgprot_val(vma->vm_page_prot) 109 vma->vm_page_prot = __pgprot(pgprot_val(vma->vm_page_prot)
112 & ~_PAGE_NO_CACHE); 110 & ~_PAGE_NO_CACHE);
113 page = vmalloc_to_page(ctx->csa.lscsa->ls + offset); 111 pfn = vmalloc_to_pfn(ctx->csa.lscsa->ls + offset);
114 } else { 112 } else {
115 vma->vm_page_prot = __pgprot(pgprot_val(vma->vm_page_prot) 113 vma->vm_page_prot = __pgprot(pgprot_val(vma->vm_page_prot)
116 | _PAGE_NO_CACHE); 114 | _PAGE_NO_CACHE);
117 page = pfn_to_page((ctx->spu->local_store_phys + offset) 115 pfn = (ctx->spu->local_store_phys + offset) >> PAGE_SHIFT;
118 >> PAGE_SHIFT);
119 } 116 }
120 spu_release(ctx); 117 vm_insert_pfn(vma, address, pfn);
121 118
122 if (type) 119 spu_release(ctx);
123 *type = VM_FAULT_MINOR;
124 120
125 page_cache_get(page); 121 return NOPFN_REFAULT;
126 return page;
127} 122}
128 123
124
129static struct vm_operations_struct spufs_mem_mmap_vmops = { 125static struct vm_operations_struct spufs_mem_mmap_vmops = {
130 .nopage = spufs_mem_mmap_nopage, 126 .nopfn = spufs_mem_mmap_nopfn,
131}; 127};
132 128
133static int 129static int
@@ -136,7 +132,7 @@ spufs_mem_mmap(struct file *file, struct vm_area_struct *vma)
136 if (!(vma->vm_flags & VM_SHARED)) 132 if (!(vma->vm_flags & VM_SHARED))
137 return -EINVAL; 133 return -EINVAL;
138 134
139 vma->vm_flags |= VM_IO; 135 vma->vm_flags |= VM_IO | VM_PFNMAP;
140 vma->vm_page_prot = __pgprot(pgprot_val(vma->vm_page_prot) 136 vma->vm_page_prot = __pgprot(pgprot_val(vma->vm_page_prot)
141 | _PAGE_NO_CACHE); 137 | _PAGE_NO_CACHE);
142 138
@@ -152,49 +148,42 @@ static const struct file_operations spufs_mem_fops = {
152 .mmap = spufs_mem_mmap, 148 .mmap = spufs_mem_mmap,
153}; 149};
154 150
155static struct page *spufs_ps_nopage(struct vm_area_struct *vma, 151static unsigned long spufs_ps_nopfn(struct vm_area_struct *vma,
156 unsigned long address, 152 unsigned long address,
157 int *type, unsigned long ps_offs, 153 unsigned long ps_offs,
158 unsigned long ps_size) 154 unsigned long ps_size)
159{ 155{
160 struct page *page = NOPAGE_SIGBUS;
161 int fault_type = VM_FAULT_SIGBUS;
162 struct spu_context *ctx = vma->vm_file->private_data; 156 struct spu_context *ctx = vma->vm_file->private_data;
163 unsigned long offset = address - vma->vm_start; 157 unsigned long area, offset = address - vma->vm_start;
164 unsigned long area;
165 int ret; 158 int ret;
166 159
167 offset += vma->vm_pgoff << PAGE_SHIFT; 160 offset += vma->vm_pgoff << PAGE_SHIFT;
168 if (offset >= ps_size) 161 if (offset >= ps_size)
169 goto out; 162 return NOPFN_SIGBUS;
170 163
164 /* error here usually means a signal.. we might want to test
165 * the error code more precisely though
166 */
171 ret = spu_acquire_runnable(ctx); 167 ret = spu_acquire_runnable(ctx);
172 if (ret) 168 if (ret)
173 goto out; 169 return NOPFN_REFAULT;
174 170
175 area = ctx->spu->problem_phys + ps_offs; 171 area = ctx->spu->problem_phys + ps_offs;
176 page = pfn_to_page((area + offset) >> PAGE_SHIFT); 172 vm_insert_pfn(vma, address, (area + offset) >> PAGE_SHIFT);
177 fault_type = VM_FAULT_MINOR;
178 page_cache_get(page);
179
180 spu_release(ctx); 173 spu_release(ctx);
181 174
182 out: 175 return NOPFN_REFAULT;
183 if (type)
184 *type = fault_type;
185
186 return page;
187} 176}
188 177
189#if SPUFS_MMAP_4K 178#if SPUFS_MMAP_4K
190static struct page *spufs_cntl_mmap_nopage(struct vm_area_struct *vma, 179static unsigned long spufs_cntl_mmap_nopfn(struct vm_area_struct *vma,
191 unsigned long address, int *type) 180 unsigned long address)
192{ 181{
193 return spufs_ps_nopage(vma, address, type, 0x4000, 0x1000); 182 return spufs_ps_nopfn(vma, address, 0x4000, 0x1000);
194} 183}
195 184
196static struct vm_operations_struct spufs_cntl_mmap_vmops = { 185static struct vm_operations_struct spufs_cntl_mmap_vmops = {
197 .nopage = spufs_cntl_mmap_nopage, 186 .nopfn = spufs_cntl_mmap_nopfn,
198}; 187};
199 188
200/* 189/*
@@ -205,7 +194,7 @@ static int spufs_cntl_mmap(struct file *file, struct vm_area_struct *vma)
205 if (!(vma->vm_flags & VM_SHARED)) 194 if (!(vma->vm_flags & VM_SHARED))
206 return -EINVAL; 195 return -EINVAL;
207 196
208 vma->vm_flags |= VM_IO; 197 vma->vm_flags |= VM_IO | VM_PFNMAP;
209 vma->vm_page_prot = __pgprot(pgprot_val(vma->vm_page_prot) 198 vma->vm_page_prot = __pgprot(pgprot_val(vma->vm_page_prot)
210 | _PAGE_NO_CACHE | _PAGE_GUARDED); 199 | _PAGE_NO_CACHE | _PAGE_GUARDED);
211 200
@@ -791,23 +780,23 @@ static ssize_t spufs_signal1_write(struct file *file, const char __user *buf,
791 return 4; 780 return 4;
792} 781}
793 782
794static struct page *spufs_signal1_mmap_nopage(struct vm_area_struct *vma, 783static unsigned long spufs_signal1_mmap_nopfn(struct vm_area_struct *vma,
795 unsigned long address, int *type) 784 unsigned long address)
796{ 785{
797#if PAGE_SIZE == 0x1000 786#if PAGE_SIZE == 0x1000
798 return spufs_ps_nopage(vma, address, type, 0x14000, 0x1000); 787 return spufs_ps_nopfn(vma, address, 0x14000, 0x1000);
799#elif PAGE_SIZE == 0x10000 788#elif PAGE_SIZE == 0x10000
800 /* For 64k pages, both signal1 and signal2 can be used to mmap the whole 789 /* For 64k pages, both signal1 and signal2 can be used to mmap the whole
801 * signal 1 and 2 area 790 * signal 1 and 2 area
802 */ 791 */
803 return spufs_ps_nopage(vma, address, type, 0x10000, 0x10000); 792 return spufs_ps_nopfn(vma, address, 0x10000, 0x10000);
804#else 793#else
805#error unsupported page size 794#error unsupported page size
806#endif 795#endif
807} 796}
808 797
809static struct vm_operations_struct spufs_signal1_mmap_vmops = { 798static struct vm_operations_struct spufs_signal1_mmap_vmops = {
810 .nopage = spufs_signal1_mmap_nopage, 799 .nopfn = spufs_signal1_mmap_nopfn,
811}; 800};
812 801
813static int spufs_signal1_mmap(struct file *file, struct vm_area_struct *vma) 802static int spufs_signal1_mmap(struct file *file, struct vm_area_struct *vma)
@@ -815,7 +804,7 @@ static int spufs_signal1_mmap(struct file *file, struct vm_area_struct *vma)
815 if (!(vma->vm_flags & VM_SHARED)) 804 if (!(vma->vm_flags & VM_SHARED))
816 return -EINVAL; 805 return -EINVAL;
817 806
818 vma->vm_flags |= VM_IO; 807 vma->vm_flags |= VM_IO | VM_PFNMAP;
819 vma->vm_page_prot = __pgprot(pgprot_val(vma->vm_page_prot) 808 vma->vm_page_prot = __pgprot(pgprot_val(vma->vm_page_prot)
820 | _PAGE_NO_CACHE | _PAGE_GUARDED); 809 | _PAGE_NO_CACHE | _PAGE_GUARDED);
821 810
@@ -899,23 +888,23 @@ static ssize_t spufs_signal2_write(struct file *file, const char __user *buf,
899} 888}
900 889
901#if SPUFS_MMAP_4K 890#if SPUFS_MMAP_4K
902static struct page *spufs_signal2_mmap_nopage(struct vm_area_struct *vma, 891static unsigned long spufs_signal2_mmap_nopfn(struct vm_area_struct *vma,
903 unsigned long address, int *type) 892 unsigned long address)
904{ 893{
905#if PAGE_SIZE == 0x1000 894#if PAGE_SIZE == 0x1000
906 return spufs_ps_nopage(vma, address, type, 0x1c000, 0x1000); 895 return spufs_ps_nopfn(vma, address, 0x1c000, 0x1000);
907#elif PAGE_SIZE == 0x10000 896#elif PAGE_SIZE == 0x10000
908 /* For 64k pages, both signal1 and signal2 can be used to mmap the whole 897 /* For 64k pages, both signal1 and signal2 can be used to mmap the whole
909 * signal 1 and 2 area 898 * signal 1 and 2 area
910 */ 899 */
911 return spufs_ps_nopage(vma, address, type, 0x10000, 0x10000); 900 return spufs_ps_nopfn(vma, address, 0x10000, 0x10000);
912#else 901#else
913#error unsupported page size 902#error unsupported page size
914#endif 903#endif
915} 904}
916 905
917static struct vm_operations_struct spufs_signal2_mmap_vmops = { 906static struct vm_operations_struct spufs_signal2_mmap_vmops = {
918 .nopage = spufs_signal2_mmap_nopage, 907 .nopfn = spufs_signal2_mmap_nopfn,
919}; 908};
920 909
921static int spufs_signal2_mmap(struct file *file, struct vm_area_struct *vma) 910static int spufs_signal2_mmap(struct file *file, struct vm_area_struct *vma)
@@ -923,7 +912,7 @@ static int spufs_signal2_mmap(struct file *file, struct vm_area_struct *vma)
923 if (!(vma->vm_flags & VM_SHARED)) 912 if (!(vma->vm_flags & VM_SHARED))
924 return -EINVAL; 913 return -EINVAL;
925 914
926 vma->vm_flags |= VM_IO; 915 vma->vm_flags |= VM_IO | VM_PFNMAP;
927 vma->vm_page_prot = __pgprot(pgprot_val(vma->vm_page_prot) 916 vma->vm_page_prot = __pgprot(pgprot_val(vma->vm_page_prot)
928 | _PAGE_NO_CACHE | _PAGE_GUARDED); 917 | _PAGE_NO_CACHE | _PAGE_GUARDED);
929 918
@@ -1000,14 +989,14 @@ DEFINE_SIMPLE_ATTRIBUTE(spufs_signal2_type, spufs_signal2_type_get,
1000 spufs_signal2_type_set, "%llu"); 989 spufs_signal2_type_set, "%llu");
1001 990
1002#if SPUFS_MMAP_4K 991#if SPUFS_MMAP_4K
1003static struct page *spufs_mss_mmap_nopage(struct vm_area_struct *vma, 992static unsigned long spufs_mss_mmap_nopfn(struct vm_area_struct *vma,
1004 unsigned long address, int *type) 993 unsigned long address)
1005{ 994{
1006 return spufs_ps_nopage(vma, address, type, 0x0000, 0x1000); 995 return spufs_ps_nopfn(vma, address, 0x0000, 0x1000);
1007} 996}
1008 997
1009static struct vm_operations_struct spufs_mss_mmap_vmops = { 998static struct vm_operations_struct spufs_mss_mmap_vmops = {
1010 .nopage = spufs_mss_mmap_nopage, 999 .nopfn = spufs_mss_mmap_nopfn,
1011}; 1000};
1012 1001
1013/* 1002/*
@@ -1018,7 +1007,7 @@ static int spufs_mss_mmap(struct file *file, struct vm_area_struct *vma)
1018 if (!(vma->vm_flags & VM_SHARED)) 1007 if (!(vma->vm_flags & VM_SHARED))
1019 return -EINVAL; 1008 return -EINVAL;
1020 1009
1021 vma->vm_flags |= VM_IO; 1010 vma->vm_flags |= VM_IO | VM_PFNMAP;
1022 vma->vm_page_prot = __pgprot(pgprot_val(vma->vm_page_prot) 1011 vma->vm_page_prot = __pgprot(pgprot_val(vma->vm_page_prot)
1023 | _PAGE_NO_CACHE | _PAGE_GUARDED); 1012 | _PAGE_NO_CACHE | _PAGE_GUARDED);
1024 1013
@@ -1042,14 +1031,14 @@ static const struct file_operations spufs_mss_fops = {
1042 .mmap = spufs_mss_mmap, 1031 .mmap = spufs_mss_mmap,
1043}; 1032};
1044 1033
1045static struct page *spufs_psmap_mmap_nopage(struct vm_area_struct *vma, 1034static unsigned long spufs_psmap_mmap_nopfn(struct vm_area_struct *vma,
1046 unsigned long address, int *type) 1035 unsigned long address)
1047{ 1036{
1048 return spufs_ps_nopage(vma, address, type, 0x0000, 0x20000); 1037 return spufs_ps_nopfn(vma, address, 0x0000, 0x20000);
1049} 1038}
1050 1039
1051static struct vm_operations_struct spufs_psmap_mmap_vmops = { 1040static struct vm_operations_struct spufs_psmap_mmap_vmops = {
1052 .nopage = spufs_psmap_mmap_nopage, 1041 .nopfn = spufs_psmap_mmap_nopfn,
1053}; 1042};
1054 1043
1055/* 1044/*
@@ -1060,7 +1049,7 @@ static int spufs_psmap_mmap(struct file *file, struct vm_area_struct *vma)
1060 if (!(vma->vm_flags & VM_SHARED)) 1049 if (!(vma->vm_flags & VM_SHARED))
1061 return -EINVAL; 1050 return -EINVAL;
1062 1051
1063 vma->vm_flags |= VM_IO; 1052 vma->vm_flags |= VM_IO | VM_PFNMAP;
1064 vma->vm_page_prot = __pgprot(pgprot_val(vma->vm_page_prot) 1053 vma->vm_page_prot = __pgprot(pgprot_val(vma->vm_page_prot)
1065 | _PAGE_NO_CACHE | _PAGE_GUARDED); 1054 | _PAGE_NO_CACHE | _PAGE_GUARDED);
1066 1055
@@ -1083,14 +1072,14 @@ static const struct file_operations spufs_psmap_fops = {
1083 1072
1084 1073
1085#if SPUFS_MMAP_4K 1074#if SPUFS_MMAP_4K
1086static struct page *spufs_mfc_mmap_nopage(struct vm_area_struct *vma, 1075static unsigned long spufs_mfc_mmap_nopfn(struct vm_area_struct *vma,
1087 unsigned long address, int *type) 1076 unsigned long address)
1088{ 1077{
1089 return spufs_ps_nopage(vma, address, type, 0x3000, 0x1000); 1078 return spufs_ps_nopfn(vma, address, 0x3000, 0x1000);
1090} 1079}
1091 1080
1092static struct vm_operations_struct spufs_mfc_mmap_vmops = { 1081static struct vm_operations_struct spufs_mfc_mmap_vmops = {
1093 .nopage = spufs_mfc_mmap_nopage, 1082 .nopfn = spufs_mfc_mmap_nopfn,
1094}; 1083};
1095 1084
1096/* 1085/*
@@ -1101,7 +1090,7 @@ static int spufs_mfc_mmap(struct file *file, struct vm_area_struct *vma)
1101 if (!(vma->vm_flags & VM_SHARED)) 1090 if (!(vma->vm_flags & VM_SHARED))
1102 return -EINVAL; 1091 return -EINVAL;
1103 1092
1104 vma->vm_flags |= VM_IO; 1093 vma->vm_flags |= VM_IO | VM_PFNMAP;
1105 vma->vm_page_prot = __pgprot(pgprot_val(vma->vm_page_prot) 1094 vma->vm_page_prot = __pgprot(pgprot_val(vma->vm_page_prot)
1106 | _PAGE_NO_CACHE | _PAGE_GUARDED); 1095 | _PAGE_NO_CACHE | _PAGE_GUARDED);
1107 1096