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] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZhZynGm6YcIdXVWV@FVFF77S0Q05N>
Date: Wed, 10 Apr 2024 12:06:04 +0100
From: Mark Rutland <mark.rutland@....com>
To: Ryan Roberts <ryan.roberts@....com>
Cc: Catalin Marinas <catalin.marinas@....com>,
	Will Deacon <will@...nel.org>, Ard Biesheuvel <ardb@...nel.org>,
	David Hildenbrand <david@...hat.com>,
	Donald Dutile <ddutile@...hat.com>,
	Eric Chanudet <echanude@...hat.com>,
	linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
	Itaru Kitayama <itaru.kitayama@...itsu.com>
Subject: Re: [PATCH v2 2/4] arm64: mm: Batch dsb and isb when populating
 pgtables

On Wed, Apr 10, 2024 at 11:25:10AM +0100, Ryan Roberts wrote:
> On 10/04/2024 11:06, Mark Rutland wrote:
> > On Thu, Apr 04, 2024 at 03:33:06PM +0100, Ryan Roberts wrote:
[> >> @@ -234,6 +238,13 @@ static void alloc_init_cont_pte(pmd_t *pmdp, unsigned long addr,
> >>  	} while (addr = next, addr != end);
> >>  
> >>  	pte_clear_fixmap();
> >> +
> >> +	/*
> >> +	 * Ensure all previous pgtable writes are visible to the table walker.
> >> +	 * See init_pte().
> >> +	 */
> >> +	dsb(ishst);
> >> +	isb();
> > 
> > Hmm... currently the call to pte_clear_fixmap() alone should be sufficient,
> > since that needs to update the PTE for the fixmap slot, then do maintenance for
> > that.
> 
> Yes, true...
> 
> > 
> > So we could avoid the addition of the dsb+isb here, and have a comment:
> > 
> > 	/*
> > 	 * Note: barriers and maintenance necessary to clear the fixmap slot
> > 	 * ensure that all previous pgtable writes are visible to the table
> > 	 * walker.
> > 	 */
> > 	pte_clear_fixmap();
> > 
> > ... which'd be fine as long as we keep this fixmap clearing rather than trying
> > to do that lazily as in patch 4.
> 
> But it isn't patch 4 that breaks it, it's patch 3. Once we have abstracted
> pte_clear_fixmap() into the ops->unmap() call, for the "late" ops, unmap is a
> noop.

Ah, yep; I hadn't spotted that yet.

> I guess the best solution there would be to require that unmap() always
> issues these barriers.
> 
> I'll do as you suggest for this patch. If we want to keep patch 3, then I'll add
> the barriers for all unmap() impls.

Thanks. It's going to take me a bit longer to chew through patches 3 and 4, but
I will try to get through those soon.

For now a slightly simpler option would be to have patch 3 introduce the
DSB+ISB as above rather than in each of the unmap() impls.

Mark.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ