powerpc: Don't truncate pgd_index wrongly
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Sun, 28 Apr 2013 09:37:28 +0000 (09:37 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Tue, 30 Apr 2013 05:59:49 +0000 (15:59 +1000)
commit0e5f35d0e4a8179cdfac115023f418126419e659
tree8d4af1fe977d620ed53b1e12b0f4f5ee84f97504
parentcc3665a60a4ff072f5b5b18312bdf9b6612c5814
powerpc: Don't truncate pgd_index wrongly

With PGD_INDEX_SIZE set to 12 the existing macro doesn't work. Fix it to
use PTRS_PER_PGD

The idea originally was to have one more bit in the result of
pgd_index() than PGD_INDEX_SIZE, so that if one had an address
corresponding to the last PGD entry, and then incremented that address
by PGD_SIZE, and took pgd_index() of that, you wouldn't end up with
zero.  The commit that introduced that dates back to 2002, and the
code that was sensitive to that edge case has long since been
refactored (several times), so there is no need for it these days.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Acked-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/include/asm/pgtable-ppc64.h