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: <4b0e7c3b91c5d59f8081c56485cfec79b2ea5a92.camel@surriel.com>
Date: Sun, 22 Dec 2024 16:24:20 -0500
From: Rik van Riel <riel@...riel.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: x86@...nel.org, linux-kernel@...r.kernel.org, kernel-team@...a.com, 
	dave.hansen@...ux.intel.com, luto@...nel.org, tglx@...utronix.de,
 mingo@...hat.com, 	bp@...en8.de, hpa@...or.com, akpm@...ux-foundation.org
Subject: Re: [PATCH 03/10] x86,mm: add INVLPGB support code

On Sun, 2024-12-22 at 12:05 +0100, Peter Zijlstra wrote:
> On Sat, Dec 21, 2024 at 11:06:35PM -0500, Rik van Riel wrote:
> 
> > +static inline void __invlpgb(unsigned long asid, unsigned long
> > pcid, unsigned long addr,
> > +			    int extra_count, bool pmd_stride,
> > unsigned long flags)
> > +{
> > +	u64 rax = addr | flags;
> > +	u32 ecx = (pmd_stride << 31) | extra_count;
> > +	u32 edx = (pcid << 16) | asid;
> > +
> > +	/*
> > +	 * The memory clobber is because the whole point is to
> > invalidate
> > +	 * stale TLB entries and, especially if we're flushing
> > global
> > +	 * mappings, we don't want the compiler to reorder any
> > subsequent
> > +	 * memory accesses before the TLB flush.
> > +	 */
> > +	asm volatile("invlpgb" : : "a" (rax), "c" (ecx), "d"
> > (edx));
> 
> What memory clobber? Is "memory" gone missing?

I'm not even sure where that comment came from any more.

We do not need any barriers here, because one of the
big points of INVLPGB is that the flush is kicked off
asynchronously, and flushes may end up being done out
of order, many can be pending simultaneously, etc.

The sync point is the TLBSYNC instruction.

I removed that comment.

-- 
All Rights Reversed.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ