Re: [PATCH 1/4] x86/asm: inline constant inputs in rdpkru(), wrpkru()
From: Dave Hansen
Date: Thu Mar 06 2025 - 16:34:59 EST
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;