Re: [RFC] Restore PKRU to user-defined value after signal handling
From: Dave Hansen
Date: Thu Nov 07 2024 - 19:26:38 EST
On 11/7/24 15:56, Aruna Ramakrishna wrote:
> If it is calcuated by the kernel, is there a chance that we could inadvertently
> set XINUSE[i] to 1 for more components other than just PKRU? Since it is
> possible that some other component was set to its init state by XSAVE,
XINUSE is exposed in the ISA via XGETBV(1). If it were _totally_ racy
and the CPU could change it willy nilly at any time, it couldn't be
sanely exposed.
I think it's safe to assume that if you use XGETBV(1) that the state is
sticky at least until there's an explicit change to a state component.
If you're really worried about this, we could go ask the hardware folks.