]> www.infradead.org Git - users/willy/xarray.git/commit
powerpc/e500: encode hugepage size in PTE bits
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Tue, 2 Jul 2024 13:51:29 +0000 (15:51 +0200)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 12 Jul 2024 22:52:18 +0000 (15:52 -0700)
commit84319905ca5f3759c42082e20ed978c81f4dead0
tree4aabd3a9e74508114460fb26292286a24096def2
parent6b0e82791bd03b2326c7f7d8c1124c825742f2a4
powerpc/e500: encode hugepage size in PTE bits

Use PTE page size bits to encode hugepage size with the following format
corresponding to the values expected in bits 52-55 in MAS1 register.
Those bits are called TSIZE:
0001  4 Kbyte
0010  16 Kbyte
0011  64 Kbyte
0100  256 Kbyte
0101  1 Mbyte
0110  4 Mbyte
0111  16 Mbyte
1000  64 Mbyte
1001  256 Mbyte
1010  1 Gbyte
1011  4 Gbyte
1100  16 Gbyte
1101 64 Gbyte
1110 256 Gbyte
1111 1 Tbyte

It corresponds to shift value minus 10 with lowest bit removed.

It is not the value expected in the PTE in that field, but only e6500
performs HW based TLB loading and the e6500 reference manual explicitely
says that this field is ignored.

Also add pte_huge_size() which will be used later.

Link: https://lkml.kernel.org/r/6f7ce82fa8c381d55f65342d77060fc55802e612.1719928057.git.christophe.leroy@csgroup.eu
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: Jason Gunthorpe <jgg@nvidia.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Oscar Salvador <osalvador@suse.de>
Cc: Peter Xu <peterx@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
arch/powerpc/include/asm/nohash/hugetlb-e500.h
arch/powerpc/include/asm/nohash/pte-e500.h