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: <3e354397-1666-4d63-b863-ef9f9d31fa37@intel.com>
Date: Thu, 6 Mar 2025 13:35:01 -0800
From: Dave Hansen <dave.hansen@...el.com>
To: Alexey Dobriyan <adobriyan@...il.com>, tglx@...utronix.de,
 mingo@...hat.com, bp@...en8.de, dave.hansen@...ux.intel.com
Cc: x86@...nel.org, hpa@...or.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/4] x86/asm: inline constant inputs in rdpkru(), wrpkru()

On 3/6/25 13:07, Alexey Dobriyan wrote:
>  static inline void wrpkru(u32 pkru)
>  {
> -	u32 ecx = 0, edx = 0;
> -
>  	/*
>  	 * "wrpkru" instruction.  Loads contents in EAX to PKRU,
>  	 * requires that ecx = edx = 0.
>  	 */
>  	asm volatile(".byte 0x0f,0x01,0xef\n\t"
> -		     : : "a" (pkru), "c"(ecx), "d"(edx));
> +		     : : "a" (pkru), "c" (0), "d" (0));
>  }

Hey Alexey,

I appreciate the patch. But I do like how it's written currently. I
honestly kinda wish it went even further and did:

	u32 eax = pkru;


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ