]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit34fa0f1cd37217e242e60b4d014be59168eadc72
tree8d4af1fe977d620ed53b1e12b0f4f5ee84f97504
parent5694a2990041c06f8455b81ef4f62b06bb9eb085
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