aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/cell/spufs/file.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2006-10-04 17:26:16 +0200
committerPaul Mackerras <paulus@samba.org>2006-10-05 09:21:01 +1000
commitac91cb8dae061ced64e475d0d70fac4a95298819 (patch)
tree70d82bc7abea0353157a1ba9d1aa58c41a555eff /arch/powerpc/platforms/cell/spufs/file.c
parent[POWERPC] spufs: Add infrastructure needed for gang scheduling (diff)
downloadlinux-dev-ac91cb8dae061ced64e475d0d70fac4a95298819.tar.xz
linux-dev-ac91cb8dae061ced64e475d0d70fac4a95298819.zip
[POWERPC] spufs: use correct pg_prot for mapping SPU local store
This hopefully fixes a long-standing bug in the spu file system. An spu context comes with local memory that can be either saved in kernel pages or point directly to a physical SPE. When mapping the physical SPE, that mapping needs to be cache-inhibited. For simplicity, we used to map the kernel backing memory that way too, but unfortunately that was not only inefficient, but also incorrect because the same page could then be accessed simultaneously through a cacheable and a cache-inhibited mapping, which is not allowed by the powerpc specification and in our case caused data inconsistency for which we did a really ugly workaround in user space. Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to '')
-rw-r--r--arch/powerpc/platforms/cell/spufs/file.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c
index 64f8b0a9b9e1..514a1d508035 100644
--- a/arch/powerpc/platforms/cell/spufs/file.c
+++ b/arch/powerpc/platforms/cell/spufs/file.c
@@ -102,12 +102,16 @@ spufs_mem_mmap_nopage(struct vm_area_struct *vma,
spu_acquire(ctx);
- if (ctx->state == SPU_STATE_SAVED)
+ if (ctx->state == SPU_STATE_SAVED) {
+ vma->vm_page_prot = __pgprot(pgprot_val(vma->vm_page_prot)
+ & ~(_PAGE_NO_CACHE | _PAGE_GUARDED));
page = vmalloc_to_page(ctx->csa.lscsa->ls + offset);
- else
+ } else {
+ vma->vm_page_prot = __pgprot(pgprot_val(vma->vm_page_prot)
+ | _PAGE_NO_CACHE | _PAGE_GUARDED);
page = pfn_to_page((ctx->spu->local_store_phys + offset)
>> PAGE_SHIFT);
-
+ }
spu_release(ctx);
if (type)