public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/13007] New: have_avx in sysdeps/x68_64/dl-trampoline.S does not check hard enough
@ 2011-07-20 13:54 luto at mit dot edu
  2011-07-20 16:21 ` [Bug libc/13007] " drepper.fsp at gmail dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: luto at mit dot edu @ 2011-07-20 13:54 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=13007

           Summary: have_avx in sysdeps/x68_64/dl-trampoline.S does not
                    check hard enough
           Product: glibc
           Version: 2.14
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
        AssignedTo: drepper.fsp@gmail.com
        ReportedBy: luto@mit.edu


have_avx returns 1 if CPUID.01H:ECX.AVX is set.  This is wrong: the AVX bit
indicates that the CPU understands AVX instructions, but it can be set even if
the kernel hasn't enabled YMM state.

The correct check is to also read CPUID.01H:ECX.OSXSAVE to check that xgetbv is
enabled and then to use xgetbv to check XCR0.SSE and XCR0.AVX.

This comes from an Intel blog post here:
http://software.intel.com/en-us/blogs/2011/04/14/is-avx-enabled/

and is borne out by the Exceptions Type 6 section of the SDM, which indicates
that VEX-coded instructions will #UD if XCR0 does not have those two bits set.

This bug presumably caused this crash:
http://comments.gmane.org/gmane.linux.kernel/1166783

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug libc/13007] have_avx in sysdeps/x68_64/dl-trampoline.S does not check hard enough
  2011-07-20 13:54 [Bug libc/13007] New: have_avx in sysdeps/x68_64/dl-trampoline.S does not check hard enough luto at mit dot edu
@ 2011-07-20 16:21 ` drepper.fsp at gmail dot com
  2011-07-20 16:27 ` luto at mit dot edu
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: drepper.fsp at gmail dot com @ 2011-07-20 16:21 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=13007

Ulrich Drepper <drepper.fsp at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |WAITING

--- Comment #1 from Ulrich Drepper <drepper.fsp at gmail dot com> 2011-07-20 16:18:26 UTC ---
That's the generic model but why should anyone care on Linux?

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug libc/13007] have_avx in sysdeps/x68_64/dl-trampoline.S does not check hard enough
  2011-07-20 13:54 [Bug libc/13007] New: have_avx in sysdeps/x68_64/dl-trampoline.S does not check hard enough luto at mit dot edu
  2011-07-20 16:21 ` [Bug libc/13007] " drepper.fsp at gmail dot com
@ 2011-07-20 16:27 ` luto at mit dot edu
  2011-07-21  1:47 ` drepper.fsp at gmail dot com
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: luto at mit dot edu @ 2011-07-20 16:27 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=13007

--- Comment #2 from Andy Lutomirski <luto at mit dot edu> 2011-07-20 16:26:07 UTC ---
See the gmane link.  There is apparently at least one person running a legacy
kernel on Sandy Bridge hardware, and glibc gets SIGILL on that box.

I'm not affected myself.  I suspect that only servers will ever see this,
because desktop machines will probably have other problems (like no graphics).

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug libc/13007] have_avx in sysdeps/x68_64/dl-trampoline.S does not check hard enough
  2011-07-20 13:54 [Bug libc/13007] New: have_avx in sysdeps/x68_64/dl-trampoline.S does not check hard enough luto at mit dot edu
  2011-07-20 16:21 ` [Bug libc/13007] " drepper.fsp at gmail dot com
  2011-07-20 16:27 ` luto at mit dot edu
@ 2011-07-21  1:47 ` drepper.fsp at gmail dot com
  2011-07-21 12:49 ` schwab@linux-m68k.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: drepper.fsp at gmail dot com @ 2011-07-21  1:47 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=13007

Ulrich Drepper <drepper.fsp at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|                            |FIXED

--- Comment #3 from Ulrich Drepper <drepper.fsp at gmail dot com> 2011-07-21 01:47:06 UTC ---
I checked in a patch.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug libc/13007] have_avx in sysdeps/x68_64/dl-trampoline.S does not check hard enough
  2011-07-20 13:54 [Bug libc/13007] New: have_avx in sysdeps/x68_64/dl-trampoline.S does not check hard enough luto at mit dot edu
                   ` (2 preceding siblings ...)
  2011-07-21  1:47 ` drepper.fsp at gmail dot com
@ 2011-07-21 12:49 ` schwab@linux-m68k.org
  2011-07-23  2:11 ` drepper.fsp at gmail dot com
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: schwab@linux-m68k.org @ 2011-07-21 12:49 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=13007

Andreas Schwab <schwab@linux-m68k.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |

--- Comment #4 from Andreas Schwab <schwab@linux-m68k.org> 2011-07-21 12:48:31 UTC ---
Which is of course wrong.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug libc/13007] have_avx in sysdeps/x68_64/dl-trampoline.S does not check hard enough
  2011-07-20 13:54 [Bug libc/13007] New: have_avx in sysdeps/x68_64/dl-trampoline.S does not check hard enough luto at mit dot edu
                   ` (3 preceding siblings ...)
  2011-07-21 12:49 ` schwab@linux-m68k.org
@ 2011-07-23  2:11 ` drepper.fsp at gmail dot com
  2011-07-23  2:19 ` luto at mit dot edu
  2014-06-27 12:54 ` fweimer at redhat dot com
  6 siblings, 0 replies; 8+ messages in thread
From: drepper.fsp at gmail dot com @ 2011-07-23  2:11 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=13007

Ulrich Drepper <drepper.fsp at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |FIXED

--- Comment #5 from Ulrich Drepper <drepper.fsp at gmail dot com> 2011-07-23 02:10:57 UTC ---
Don't reopen bugs like this.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug libc/13007] have_avx in sysdeps/x68_64/dl-trampoline.S does not check hard enough
  2011-07-20 13:54 [Bug libc/13007] New: have_avx in sysdeps/x68_64/dl-trampoline.S does not check hard enough luto at mit dot edu
                   ` (4 preceding siblings ...)
  2011-07-23  2:11 ` drepper.fsp at gmail dot com
@ 2011-07-23  2:19 ` luto at mit dot edu
  2014-06-27 12:54 ` fweimer at redhat dot com
  6 siblings, 0 replies; 8+ messages in thread
From: luto at mit dot edu @ 2011-07-23  2:19 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=13007

--- Comment #6 from Andy Lutomirski <luto at mit dot edu> 2011-07-23 02:19:18 UTC ---
Should it be a new bug, then?  From my admittedly imperfect recollection of x86
assembly, this:

+       testl   $((1 << 28) | (1 << 27)), %ecx
+       je      2f

is checking whether one of the bits is set, not whether both are set.  I think
you'll get SIGILL when you do xgetbv if OSXSAVE isn't set.  (And you'll get a
different failure if YMM is enabled but AVX isn't present, in the unlikely
event that such a CPU exists.)

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug libc/13007] have_avx in sysdeps/x68_64/dl-trampoline.S does not check hard enough
  2011-07-20 13:54 [Bug libc/13007] New: have_avx in sysdeps/x68_64/dl-trampoline.S does not check hard enough luto at mit dot edu
                   ` (5 preceding siblings ...)
  2011-07-23  2:19 ` luto at mit dot edu
@ 2014-06-27 12:54 ` fweimer at redhat dot com
  6 siblings, 0 replies; 8+ messages in thread
From: fweimer at redhat dot com @ 2014-06-27 12:54 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=13007

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
              Flags|                            |security-

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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

end of thread, other threads:[~2014-06-27 12:54 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-20 13:54 [Bug libc/13007] New: have_avx in sysdeps/x68_64/dl-trampoline.S does not check hard enough luto at mit dot edu
2011-07-20 16:21 ` [Bug libc/13007] " drepper.fsp at gmail dot com
2011-07-20 16:27 ` luto at mit dot edu
2011-07-21  1:47 ` drepper.fsp at gmail dot com
2011-07-21 12:49 ` schwab@linux-m68k.org
2011-07-23  2:11 ` drepper.fsp at gmail dot com
2011-07-23  2:19 ` luto at mit dot edu
2014-06-27 12:54 ` fweimer at redhat dot com

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 read-only IMAP folder(s) and NNTP newsgroup(s).