linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* xgetbv nondeterminism
@ 2017-06-15  5:18 Andy Lutomirski
  2017-06-15 14:33 ` Dave Hansen
  0 siblings, 1 reply; 22+ messages in thread
From: Andy Lutomirski @ 2017-06-15  5:18 UTC (permalink / raw)
  To: Robert O'Callahan, linux-kernel, X86 ML, Dave Hansen

I saw your post about XGETBV
(http://robert.ocallahan.org/2017/06/another-case-of-obscure-cpu.html),
and it sounds like it could plausibly be a kernel bug.  What kernel
are you on?

I wonder if CPUs have an optimization in which, if a given register
set is in the init state but XINUSE=1, then they'll notice when
XRSTORS runs and clear XINUSE.  If so, that would be rather
unfortunate IMO.

Dave, why is XINUSE exposed at all to userspace?  IIRC it's visible
via XGETBV, XSAVEC, and maybe even XSAVE, and ISTM that making it
visible to userspace serves basically no performance purpose and just
encourages annoying corner cases.  I can see an argument that making
XSAVEC fast is nice for user threading libraries, but user threading
libraries that use XSAVEC are probably doing it wrong and should
instead rely on ABI guarantees to avoid saving and restoring extended
state at all.

To be fair, glibc uses this new XGETBV feature, but I suspect its
usage is rather dubious.  Shouldn't it just do XSAVEC directly rather
than rolling its own code?

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

end of thread, other threads:[~2017-06-17 19:48 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-15  5:18 xgetbv nondeterminism Andy Lutomirski
2017-06-15 14:33 ` Dave Hansen
2017-06-15 22:18   ` Andy Lutomirski
2017-06-15 22:40     ` H.J. Lu
2017-06-15 22:45       ` Andy Lutomirski
2017-06-15 23:11         ` H.J. Lu
2017-06-15 23:28           ` Andy Lutomirski
2017-06-16  2:17             ` H.J. Lu
2017-06-16  3:05               ` Andy Lutomirski
2017-06-16  4:34                 ` H.J. Lu
2017-06-16 16:01                   ` Andy Lutomirski
2017-06-16 16:17                     ` H.J. Lu
2017-06-16 16:38                       ` Andy Lutomirski
2017-06-16 17:44                         ` H.J. Lu
2017-06-16 17:56                           ` Andy Lutomirski
2017-06-16 18:03                             ` H.J. Lu
2017-06-17  6:21                               ` Andy Lutomirski
2017-06-17 12:51                                 ` H.J. Lu
2017-06-17 16:32                                   ` Andy Lutomirski
2017-06-17 19:48                                     ` H.J. Lu
2017-06-15 23:37     ` Dave Hansen
2017-06-16  2:28       ` H.J. Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).