Re: [PATCH RFC 02/11] x86/mm: Factor out phys_pgd_init()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Mar 13, 2025 at 10:14:33PM +0000, Yosry Ahmed wrote:
> > @@ -771,15 +770,29 @@ __kernel_physical_mapping_init(unsigned long paddr_start,
> >  					  (pud_t *) p4d, init);
> >  
> >  		spin_unlock(&init_mm.page_table_lock);
> > -		pgd_changed = true;
> > +		*pgd_changed = true;
> >  	}
> >  
> > -	if (pgd_changed)
> > -		sync_global_pgds(vaddr_start, vaddr_end - 1);
> > -
> >  	return paddr_last;
> >  }
> >  
> > +static unsigned long __meminit
> > +__kernel_physical_mapping_init(unsigned long paddr_start,
> > +			       unsigned long paddr_end,
> > +			       unsigned long page_size_mask,
> > +			       pgprot_t prot, bool init)
> > +{
> > +	bool pgd_changed;
> > +	unsigned long paddr_last;
> > +
> > +	paddr_last = phys_pgd_init(init_mm.pgd, paddr_start, paddr_end, page_size_mask,
> > +				   prot, init, &pgd_changed);
> > +	if (pgd_changed)
> > +		sync_global_pgds((unsigned long)__va(paddr_start),
> > +				 (unsigned long)__va(paddr_end) - 1);
> 
> This patch keeps the sync_global_pgds() in
> __kernel_physical_mapping_init(), then a following patch adds it back in
> phys_pgd_init() (but still leaves it here).
> 
> Should we just leave sync_global_pgds() in phys_pgd_init() and eliminate
> the pgd_changed argument?

Oops, thanks. IIUC we only need the sync_global_pgds() call in
__kernel_physical_mapping_init(). We don't want to call it a second
time just because we mirrored changes into the ASI PGD.




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux