This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/13007] New: have_avx in sysdeps/x68_64/dl-trampoline.S does not check hard enough


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]