Re: [patch 0/8] x86/fpu: Mop up XSAVES and related damage

From: Yu, Yu-cheng
Date: Fri Jun 04 2021 - 12:29:05 EST


On 6/4/2021 7:05 AM, Thomas Gleixner wrote:
On Wed, Jun 02 2021 at 14:28, Yu-cheng Yu wrote:
On 6/2/2021 2:55 AM, Thomas Gleixner wrote:

With the series applied, glibc pkey test fails sometimes. I will try to
find out the cause.

That fails not sometimes. It fails always due to patch 7/8. The reason
is that before that patch fpu__clear_all() reinitialized the hardware
which includes writing the initial PKRU value.

But fpu__initialize() does not store the initial PKRU value in the
task's xstate which breaks PKRU. As that patch is not urgent we can
postpone it for not.

But looking at the above, it's not clear to me why that PKRU stuff works
at all (upstream), but I'll figure it out eventually. I'm quite sure
that it does work by pure chance not by design.


Thanks for the update. I will continue looking at it.

Yu-cheng