Subject: Re: [PATCH 6/6] powerpc/8xx: implementation of huge pages

From: "Aneesh Kumar K.V" <[email-masked]>
Date: Mon, 15 Aug 2016 16:00:14 +0530

christophe leroy <[email-masked]> writes:

> Le 14/08/2016 à 16:25, Aneesh Kumar K.V a écrit :
>> Christophe Leroy <[email-masked]> writes:
>>
>>> The 8xx has 512k and 8M pages. This patch implements hugepages using
>>> those sizes.
>>>
>>> On the 8xx, the size of pages is in the PGD entry,
>>> using PS field (bits 28-29):
>>> 00 : Small pages (4k or 16k)
>>> 01 : 512k pages
>>> 10 : reserved
>>> 11 : 8M pages
>>>
>>> The implementation uses a mix of what is used on BOOKS and BOOKE,
>>> as 512k pages are in HUGEPTE tables while for 8M pages we have
>>> several PGD entries pointing on a leaf HUGEPTE entry
>>>
>>> For the time being, we do not support CPU15 ERRATA if HUGETLB is
>>> selected
>>
>> Can you also document here the format for linux page table with different
>> huge page size. ?
>
> Euh ... isn't it what I do when explaining the use of the PS field in 
> the PGD entry ? That's the thing, that's how the 8xx knows how it is a 
> huge page, and that's how Linux will know it is one. On the 8xx, the 
> Linux PGD entry (almost) match the L1 MMU entry and the Linux PTE almost 
> match the L2 MMU entry (some bits are copied from the PTE to the L1 
> entry and then removed from the value writen to the L2 MMU entry)
>

Sorry if that answer was obvious in the commit message. I haven't looked
at 8xx pagetable format closely to understand the details. Now with your
reply to the earlier email, I looked at the changes again and wonder
whether we can document details like.

8xx uses a two level page table with two different linux page size
support (4k and 16k). 8xx also support two different hugepage sizes
512k and 8M. Inorder to support then on linux we define two different
page table layout.

For 512K hugepage size a pgd entry have the below format
[<hugepte address >0100] . The hugepte table allocated will contain <x>
entries pointing to 512K huge pte.

For 8M multiple pgd entries point to the same hugepte address. and pgd
entry will have the below format
[<hugepte address>1100]. The hugepte table allocated will only have one
entry.

I agree that this is the same details you explained in the commit
messages. But calling out all details will help anybody reading the code
later.

-aneesh