[PATCH 3/9] powerpc/mm/book3s-64: Use physical addresses in upper page table tree levels

Paul Mackerras paulus at ozlabs.org
Tue Feb 23 12:19:09 AEDT 2016


On Mon, Feb 22, 2016 at 12:36:03PM +0530, Aneesh Kumar K.V wrote:
> Paul Mackerras <paulus at ozlabs.org> writes:
> 
> > From: Paul Mackerras <paulus at samba.org>
> >
> > This changes the Linux page tables to store physical addresses
> > rather than kernel virtual addresses in the upper levels of the
> > tree (pgd, pud and pmd) for 64-bit Book 3S machines.
> >
> > This frees up some high order bits, and will be needed with
> > PowerISA v3.0 machines which read the page table tree in hardware
> > in radix mode.
> >
> 
> Radix mark the top two bits at upper level page table tree.
> 
> ie,
> 
> 
> static inline void pud_populate(struct mm_struct *mm, pud_t *pud, pmd_t *pmd)
> {
> 	pud_set(pud, __pgtable_ptr_val(pmd));
> }
> 
> static inline void rpud_populate(struct mm_struct *mm, pud_t *pud, pmd_t *pmd)
> {
> 	*pud = __pud(__pa(pmd) | RPUD_VAL_BITS);
> }
> 
> 
> I guess we will do the same with hash to keep them same ?

Yes, that makes sense.  I assume RPUD_VAL_BITS above is basically
_PAGE_PRESENT plus the next-level-size field at the bottom.  Setting
that next-level-size field will make it look like a hugepd pointer, so
we'll need some other way to distinguish them (maybe the _PAGE_PRESENT
bit?).

Paul.


More information about the Linuxppc-dev mailing list