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>
This commit is contained in:
parent
b9df022319
commit
4559424a0c
|
@ -101,17 +101,17 @@ unsigned long p_mapped_by_tlbcam(phys_addr_t pa)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set up a variable-size TLB entry (tlbcam). The parameters are not checked;
|
* Set up a variable-size TLB entry (tlbcam). The parameters are not checked;
|
||||||
* in particular size must be a power of 4 between 4k and 256M (or 1G, for cpus
|
* in particular size must be a power of 4 between 4k and the max supported by
|
||||||
* that support extended page sizes). Note that while some cpus support a
|
* an implementation; max may further be limited by what can be represented in
|
||||||
* page size of 4G, we don't allow its use here.
|
* an unsigned long (for example, 32-bit implementations cannot support a 4GB
|
||||||
|
* size).
|
||||||
*/
|
*/
|
||||||
static void settlbcam(int index, unsigned long virt, phys_addr_t phys,
|
static void settlbcam(int index, unsigned long virt, phys_addr_t phys,
|
||||||
unsigned long size, unsigned long flags, unsigned int pid)
|
unsigned long size, unsigned long flags, unsigned int pid)
|
||||||
{
|
{
|
||||||
unsigned int tsize, lz;
|
unsigned int tsize;
|
||||||
|
|
||||||
asm (PPC_CNTLZL "%0,%1" : "=r" (lz) : "r" (size));
|
tsize = __ilog2(size) - 10;
|
||||||
tsize = 21 - lz;
|
|
||||||
|
|
||||||
#ifdef CONFIG_SMP
|
#ifdef CONFIG_SMP
|
||||||
if ((flags & _PAGE_NO_CACHE) == 0)
|
if ((flags & _PAGE_NO_CACHE) == 0)
|
||||||
|
|
Loading…
Reference in New Issue