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: <cc6101619afe5f148b1575fb42807cb1b4766b6e.camel@surriel.com>
Date: Wed, 22 Jan 2025 11:58:26 -0500
From: Rik van Riel <riel@...riel.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: x86@...nel.org, linux-kernel@...r.kernel.org, bp@...en8.de, 
	dave.hansen@...ux.intel.com, zhengqi.arch@...edance.com,
 nadav.amit@...il.com, 	thomas.lendacky@....com, kernel-team@...a.com,
 linux-mm@...ck.org, 	akpm@...ux-foundation.org, jannh@...gle.com,
 mhklinux@...look.com, 	andrew.cooper3@...rix.com
Subject: Re: [PATCH v6 05/12] x86/mm: add INVLPGB support code

On Tue, 2025-01-21 at 10:45 +0100, Peter Zijlstra wrote:
> On Sun, Jan 19, 2025 at 09:40:13PM -0500, Rik van Riel wrote:
> 
> > 
> > +static inline void __invlpgb(unsigned long asid, unsigned long
> > pcid,
> > +			     unsigned long addr, u16 extra_count,
> > +			     bool pmd_stride, unsigned long flags)
> > +{
> > +	u32 edx = (pcid << 16) | asid;
> > +	u32 ecx = (pmd_stride << 31) | extra_count;
> > +	u64 rax = addr | flags;
> > +
> > +	/* INVLPGB; supported in binutils >= 2.36. */
> > +	asm volatile(".byte 0x0f, 0x01, 0xfe" : : "a" (rax), "c"
> > (ecx), "d" (edx));
> > +}
> 
> So asid is always 0 (for now), but I'd feel better if that was a u16
> argument, less chance funnies when someone starts using it.
> 
> We should probably mask or WARN on addr having low bits set, and
> flags
> should then be a u8 or something.

Done and done. Thank you for the suggestions.

-- 
All Rights Reversed.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ