aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorarnd@arndb.de <arnd@arndb.de>2006-06-19 14:33:23 -0400
committerPaul Mackerras <paulus@samba.org>2006-06-21 01:01:30 -0400
commit724bd80e8102ac137868b23fad2b06af65f8e168 (patch)
tree768d32aa894a06abec676e26088b44072ce817bf
parent0309f02d8e1b68811e513bdd06015672d0696af5 (diff)
[POWERPC] spufs: set up correct SLB entries for 64k pages
spufs currently knows only 4k pages and 16M hugetlb pages. Make it use the regular methods for deciding on the SLB bits. Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
-rw-r--r--arch/powerpc/platforms/cell/spu_base.c11
-rw-r--r--arch/powerpc/platforms/cell/spufs/switch.c14
2 files changed, 16 insertions, 9 deletions
diff --git a/arch/powerpc/platforms/cell/spu_base.c b/arch/powerpc/platforms/cell/spu_base.c
index d5877aacc3b6..fd6ea571dbd3 100644
--- a/arch/powerpc/platforms/cell/spu_base.c
+++ b/arch/powerpc/platforms/cell/spu_base.c
@@ -71,7 +71,7 @@ static int __spu_trap_data_seg(struct spu *spu, unsigned long ea)
71{ 71{
72 struct spu_priv2 __iomem *priv2 = spu->priv2; 72 struct spu_priv2 __iomem *priv2 = spu->priv2;
73 struct mm_struct *mm = spu->mm; 73 struct mm_struct *mm = spu->mm;
74 u64 esid, vsid; 74 u64 esid, vsid, llp;
75 75
76 pr_debug("%s\n", __FUNCTION__); 76 pr_debug("%s\n", __FUNCTION__);
77 77
@@ -91,9 +91,14 @@ static int __spu_trap_data_seg(struct spu *spu, unsigned long ea)
91 } 91 }
92 92
93 esid = (ea & ESID_MASK) | SLB_ESID_V; 93 esid = (ea & ESID_MASK) | SLB_ESID_V;
94 vsid = (get_vsid(mm->context.id, ea) << SLB_VSID_SHIFT) | SLB_VSID_USER; 94#ifdef CONFIG_HUGETLB_PAGE
95 if (in_hugepage_area(mm->context, ea)) 95 if (in_hugepage_area(mm->context, ea))
96 vsid |= SLB_VSID_L; 96 llp = mmu_psize_defs[mmu_huge_psize].sllp;
97 else
98#endif
99 llp = mmu_psize_defs[mmu_virtual_psize].sllp;
100 vsid = (get_vsid(mm->context.id, ea) << SLB_VSID_SHIFT) |
101 SLB_VSID_USER | llp;
97 102
98 out_be64(&priv2->slb_index_W, spu->slb_replace); 103 out_be64(&priv2->slb_index_W, spu->slb_replace);
99 out_be64(&priv2->slb_vsid_RW, vsid); 104 out_be64(&priv2->slb_vsid_RW, vsid);
diff --git a/arch/powerpc/platforms/cell/spufs/switch.c b/arch/powerpc/platforms/cell/spufs/switch.c
index 60f8b3616441..97a0e80c7df8 100644
--- a/arch/powerpc/platforms/cell/spufs/switch.c
+++ b/arch/powerpc/platforms/cell/spufs/switch.c
@@ -718,13 +718,15 @@ static inline void invalidate_slbs(struct spu_state *csa, struct spu *spu)
718 718
719static inline void get_kernel_slb(u64 ea, u64 slb[2]) 719static inline void get_kernel_slb(u64 ea, u64 slb[2])
720{ 720{
721 slb[0] = (get_kernel_vsid(ea) << SLB_VSID_SHIFT) | SLB_VSID_KERNEL; 721 u64 llp;
722
723 if (REGION_ID(ea) == KERNEL_REGION_ID)
724 llp = mmu_psize_defs[mmu_linear_psize].sllp;
725 else
726 llp = mmu_psize_defs[mmu_virtual_psize].sllp;
727 slb[0] = (get_kernel_vsid(ea) << SLB_VSID_SHIFT) |
728 SLB_VSID_KERNEL | llp;
722 slb[1] = (ea & ESID_MASK) | SLB_ESID_V; 729 slb[1] = (ea & ESID_MASK) | SLB_ESID_V;
723
724 /* Large pages are used for kernel text/data, but not vmalloc. */
725 if (cpu_has_feature(CPU_FTR_16M_PAGE)
726 && REGION_ID(ea) == KERNEL_REGION_ID)
727 slb[0] |= SLB_VSID_L;
728} 730}
729 731
730static inline void load_mfc_slb(struct spu *spu, u64 slb[2], int slbe) 732static inline void load_mfc_slb(struct spu *spu, u64 slb[2], int slbe)