]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
powerpc: get hugetlbpage handling more generic
authorChristophe Leroy <christophe.leroy@c-s.fr>
Wed, 7 Dec 2016 07:47:26 +0000 (08:47 +0100)
committerScott Wood <oss@buserror.net>
Sat, 10 Dec 2016 04:48:09 +0000 (22:48 -0600)
commit03bb2d65900c87a6cc860310b4d598c68fb83393
treea75dba81f5c0ce82bb941e5db7077bbdc30cde26
parent9b081e10805cd8e356f30ded1cb2008d67af26c9
powerpc: get hugetlbpage handling more generic

Today there are two implementations of hugetlbpages which are managed
by exclusive #ifdefs:
* FSL_BOOKE: several directory entries points to the same single hugepage
* BOOK3S: one upper level directory entry points to a table of hugepages

In preparation of implementation of hugepage support on the 8xx, we
need a mix of the two above solutions, because the 8xx needs both cases
depending on the size of pages:
* In 4k page size mode, each PGD entry covers a 4M bytes area. It means
that 2 PGD entries will be necessary to cover an 8M hugepage while a
single PGD entry will cover 8x 512k hugepages.
* In 16 page size mode, each PGD entry covers a 64M bytes area. It means
that 8x 8M hugepages will be covered by one PGD entry and 64x 512k
hugepages will be covers by one PGD entry.

This patch:
* removes #ifdefs in favor of if/else based on the range sizes
* merges the two huge_pte_alloc() functions as they are pretty similar
* merges the two hugetlbpage_init() functions as they are pretty similar

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> (v3)
Signed-off-by: Scott Wood <oss@buserror.net>
arch/powerpc/mm/hugetlbpage.c