Re: [PATCH v3 14/34] microblaze: Implement the new page table range API

From: Matthew Wilcox
Date: Fri Mar 03 2023 - 09:39:02 EST


On Fri, Mar 03, 2023 at 12:53:36PM +0200, Mike Rapoport wrote:
> On Tue, Feb 28, 2023 at 09:37:17PM +0000, Matthew Wilcox (Oracle) wrote:
> > +static inline void set_ptes(struct mm_struct *mm, unsigned long addr,
> > + pte_t *ptep, pte_t pte, unsigned int nr)
> > {
> > - *ptep = pte;
> > + for (;;) {
> > + set_pte(ptep, pte);
> > + if (--nr == 0)
> > + break;
> > + ptep++;
> > + pte_val(pte) += 1 << PFN_SHIFT_OFFSET;
>
> This is the same as
>
> pte_val(pte) += PAGE_SIZE;
>
> isn't it?

Looks like it. Based on this:

$ git grep PFN_SHIFT_OFFSET arch/microblaze/
arch/microblaze/include/asm/pgtable.h:#define PFN_SHIFT_OFFSET (PAGE_SHIFT)
arch/microblaze/include/asm/pgtable.h:#define pte_pfn(x) (pte_val(x) >> PFN_SHIFT_OFFSET)

I only looked at the definition of pte_pfn(); I didn't look to see how
PFN_SHIFT_OFFSET was defined. I don't see the need to change it from
what I have though?