All of lore.kernel.org
 help / color / mirror / Atom feed
* XSAVE / RDPKRU on Intel 11th Gen Core CPUs
@ 2021-11-08 17:37 Brian Geffon
  2021-11-08 19:37 ` Dave Hansen
  0 siblings, 1 reply; 12+ messages in thread
From: Brian Geffon @ 2021-11-08 17:37 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: Guenter Roeck, Borislav Petkov, Andy Lutomirski, stable

Hi Thomas,

We (ChromeOS) have run into an issue which we believe is related to
the following errata on 11th Gen Intel Core CPUs:

"TGL034 A SYSENTER FOLLOWING AN XSAVE OR A VZEROALL MAY LEAD TO
UNEXPECTED SYSTEM BEHAVIOR" [1]

Essentially we notice that the value returned by a RDPKRU instruction
will flip after some amount of time when running on kernels earlier
than 5.14. I have a simple repro that can be used [2].

After a little digging it appears a lot of work was done to refactor
that code and I bisected to the following commit which fixes the
issue:

  commit 954436989cc550dd91aab98363240c9c0a4b7e23
  Author: Thomas Gleixner <tglx@linutronix.de>
  Date:   Wed Jun 23 14:02:21 2021 +0200

    x86/fpu: Remove PKRU handling from switch_fpu_finish()

I backported this patch to 5.4 and it does appear to fix the issue
because it avoids XSAVE. However, I have no idea if it's actually
fixing anything or if the behavior is working as intended. So we're
curious, does it make sense to pull back that patch, would that patch
be enough? Any guidance here would be appreciated because this does
seem broken (because of how it was previously implemented) for those
CPUs prior to 5.14, which is why I'm CCing stable@.

Thanks in advance,
Brian

1. https://cdrdv2.intel.com/v1/dl/getContent/631123?explicitVersion=true
2. https://gist.github.com/bgaff/9f8cbfc8dd22e60f9492e4f0aff8f04f

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2021-11-09 19:29 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-08 17:37 XSAVE / RDPKRU on Intel 11th Gen Core CPUs Brian Geffon
2021-11-08 19:37 ` Dave Hansen
2021-11-08 22:00   ` Dave Hansen
2021-11-08 23:20     ` Brian Geffon
2021-11-09  1:47     ` Brian Geffon
2021-11-09  6:49       ` Dave Hansen
2021-11-09 13:43         ` Brian Geffon
2021-11-09 14:14           ` Brian Geffon
2021-11-09 14:57           ` Andy Lutomirski
2021-11-09 18:58             ` Brian Geffon
2021-11-09 19:25               ` Brian Geffon
2021-11-09 19:29               ` Dave Hansen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.