aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/mm
diff options
context:
space:
mode:
authorBecky Bruce <beckyb@kernel.crashing.org>2011-10-12 17:17:02 -0400
committerKumar Gala <galak@kernel.crashing.org>2011-10-13 00:39:10 -0400
commit4559424a0c34f0cb22fa31bc24015a06dc064b32 (patch)
tree093b1d3d2fafcd9e9d7b6226cf90c855f93f79bb /arch/powerpc/mm
parentb9df02231930c01eaaf3c37b192bd75ea0d1c0bb (diff)
powerpc/fsl-booke: Fix settlbcam for 64-bit
Currently, it does a cntlzd on the size and then subtracts it from 21.... this doesn't take into account the varying size of a "long". Just use __ilog instead (and subtract the 10 we have to subtract to get to the tsize encoding). Also correct the comment about page sizes supported. Signed-off-by: Becky Bruce <beckyb@kernel.crashing.org> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/mm')
-rw-r--r--arch/powerpc/mm/fsl_booke_mmu.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/arch/powerpc/mm/fsl_booke_mmu.c b/arch/powerpc/mm/fsl_booke_mmu.c
index 6f593bd27174..66a6fd38e9cd 100644
--- a/arch/powerpc/mm/fsl_booke_mmu.c
+++ b/arch/powerpc/mm/fsl_booke_mmu.c
@@ -101,17 +101,17 @@ unsigned long p_mapped_by_tlbcam(phys_addr_t pa)
101 101
102/* 102/*
103 * Set up a variable-size TLB entry (tlbcam). The parameters are not checked; 103 * Set up a variable-size TLB entry (tlbcam). The parameters are not checked;
104 * in particular size must be a power of 4 between 4k and 256M (or 1G, for cpus 104 * in particular size must be a power of 4 between 4k and the max supported by
105 * that support extended page sizes). Note that while some cpus support a 105 * an implementation; max may further be limited by what can be represented in
106 * page size of 4G, we don't allow its use here. 106 * an unsigned long (for example, 32-bit implementations cannot support a 4GB
107 * size).
107 */ 108 */
108static void settlbcam(int index, unsigned long virt, phys_addr_t phys, 109static void settlbcam(int index, unsigned long virt, phys_addr_t phys,
109 unsigned long size, unsigned long flags, unsigned int pid) 110 unsigned long size, unsigned long flags, unsigned int pid)
110{ 111{
111 unsigned int tsize, lz; 112 unsigned int tsize;
112 113
113 asm (PPC_CNTLZL "%0,%1" : "=r" (lz) : "r" (size)); 114 tsize = __ilog2(size) - 10;
114 tsize = 21 - lz;
115 115
116#ifdef CONFIG_SMP 116#ifdef CONFIG_SMP
117 if ((flags & _PAGE_NO_CACHE) == 0) 117 if ((flags & _PAGE_NO_CACHE) == 0)