lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Z9hMwC-GKoRLaHWw@google.com>
Date: Mon, 17 Mar 2025 16:24:32 +0000
From: Brendan Jackman <jackmanb@...gle.com>
To: Yosry Ahmed <yosry.ahmed@...ux.dev>
Cc: Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>,
	Borislav Petkov <bp@...en8.de>,
	Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
	Andrew Morton <akpm@...ux-foundation.org>,
	David Rientjes <rientjes@...gle.com>,
	Vlastimil Babka <vbabka@...e.cz>,
	David Hildenbrand <david@...hat.com>, linux-kernel@...r.kernel.org,
	linux-mm@...ck.org, Mike Rapoport <rppt@...nel.org>,
	Junaid Shahid <junaids@...gle.com>,
	Reiji Watanabe <reijiw@...gle.com>,
	Patrick Bellasi <derkling@...gle.com>
Subject: Re: [PATCH RFC 02/11] x86/mm: Factor out phys_pgd_init()

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.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ