public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/13753] New: [2.15 backport] Really fix AVX tests
@ 2012-02-25  1:33 allan at archlinux dot org
  2012-05-02  2:28 ` [Bug libc/13753] " carlos_odonell at mentor dot com
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: allan at archlinux dot org @ 2012-02-25  1:33 UTC (permalink / raw)
  To: glibc-bugs

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

             Bug #: 13753
           Summary: [2.15 backport] Really fix AVX tests
           Product: glibc
           Version: 2.15
            Status: NEW
          Keywords: glibc_2.15
          Severity: normal
          Priority: P2
         Component: libc
        AssignedTo: carlos@systemhalted.org
        ReportedBy: allan@archlinux.org
                CC: drepper.fsp@gmail.com
    Classification: Unclassified


The following commit(s) should be backported to glibc 2.15:

commit 08cf777f9e7f6d826658a99c7d77a359f73a45bf
Author: Ulrich Drepper <drepper@gmail.com>
Date:   Thu Jan 26 09:45:54 2012 -0500

    Really fix AVX tests

which also reverts the previous commit:

commit afc5ed09cbce5d6fd48b3a8c5ec427b31f996880
Author: Ulrich Drepper <drepper@gmail.com>
Date:   Thu Jan 26 07:45:14 2012 -0500

    Reset bit_AVX in __cpu_features is OS support is missing

-- 
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] 15+ messages in thread

* [Bug libc/13753] [2.15 backport] Really fix AVX tests
  2012-02-25  1:33 [Bug libc/13753] New: [2.15 backport] Really fix AVX tests allan at archlinux dot org
@ 2012-05-02  2:28 ` carlos_odonell at mentor dot com
  2012-05-08 13:45 ` aj at suse dot de
                   ` (12 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: carlos_odonell at mentor dot com @ 2012-05-02  2:28 UTC (permalink / raw)
  To: glibc-bugs

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

Carlos O'Donell <carlos_odonell at mentor dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |carlos_odonell at mentor
                   |                            |dot com

--- Comment #1 from Carlos O'Donell <carlos_odonell at mentor dot com> 2012-05-02 02:27:59 UTC ---
In the process of backporting.

-- 
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] 15+ messages in thread

* [Bug libc/13753] [2.15 backport] Really fix AVX tests
  2012-02-25  1:33 [Bug libc/13753] New: [2.15 backport] Really fix AVX tests allan at archlinux dot org
  2012-05-02  2:28 ` [Bug libc/13753] " carlos_odonell at mentor dot com
@ 2012-05-08 13:45 ` aj at suse dot de
  2012-05-10 19:07 ` law at redhat dot com
                   ` (11 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: aj at suse dot de @ 2012-05-08 13:45 UTC (permalink / raw)
  To: glibc-bugs

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

Andreas Jaeger <aj at suse dot de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |aj at suse dot de

--- Comment #2 from Andreas Jaeger <aj at suse dot de> 2012-05-08 13:45:11 UTC ---
See bug #14059, you should add the following part from my patch as well (full
patch for review at http://sourceware.org/ml/libc-alpha/2012-05/msg00321.html):

2012-05-08  Jim Westfall  <jwestfall@surrealistic.net>

        [BZ #14059]
        * sysdeps/x86_64/multiarch/init-arch.c (__init_cpu_features):
        Disable FMA4 if AVX is disabled.

+  /* FMA4 depends on AVX support.  */
+  if (__cpu_features.cpuid[COMMON_CPUID_INDEX_80000001].ecx & bit_FMA4
+      && (__cpu_features.cpuid[COMMON_CPUID_INDEX_1].ecx & bit_AVX) == 0)
+    __cpu_features.cpuid[COMMON_CPUID_INDEX_80000001].ecx &= ~bit_FMA4;

-- 
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] 15+ messages in thread

* [Bug libc/13753] [2.15 backport] Really fix AVX tests
  2012-02-25  1:33 [Bug libc/13753] New: [2.15 backport] Really fix AVX tests allan at archlinux dot org
  2012-05-02  2:28 ` [Bug libc/13753] " carlos_odonell at mentor dot com
  2012-05-08 13:45 ` aj at suse dot de
@ 2012-05-10 19:07 ` law at redhat dot com
  2012-05-10 20:26 ` carlos_odonell at mentor dot com
                   ` (10 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: law at redhat dot com @ 2012-05-10 19:07 UTC (permalink / raw)
  To: glibc-bugs

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

law at redhat dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |law at redhat dot com

--- Comment #3 from law at redhat dot com 2012-05-10 19:06:41 UTC ---
I've also got reports that Uli's patch is wrong because it can leave AVX
enabled even though OSXSAVE is off. 

My understanding is:

1. OSXSAVE must be enabled
2. AVX must be enabled
3. XGETBV must have XMM & XMM state enabled

Otherwise AVX can not be used.

This (for example) causes Xen to fail miserably.

-- 
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] 15+ messages in thread

* [Bug libc/13753] [2.15 backport] Really fix AVX tests
  2012-02-25  1:33 [Bug libc/13753] New: [2.15 backport] Really fix AVX tests allan at archlinux dot org
                   ` (2 preceding siblings ...)
  2012-05-10 19:07 ` law at redhat dot com
@ 2012-05-10 20:26 ` carlos_odonell at mentor dot com
  2012-05-10 20:50 ` law at redhat dot com
                   ` (9 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: carlos_odonell at mentor dot com @ 2012-05-10 20:26 UTC (permalink / raw)
  To: glibc-bugs

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

Carlos O'Donell <carlos_odonell at mentor dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED

--- Comment #4 from Carlos O'Donell <carlos_odonell at mentor dot com> 2012-05-10 20:25:46 UTC ---
Jeff,

Do the commits and patch in question in this issue fix AVX usage for you? In
other words will we be backporting the right stuff for 2.15.1?

-- 
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] 15+ messages in thread

* [Bug libc/13753] [2.15 backport] Really fix AVX tests
  2012-02-25  1:33 [Bug libc/13753] New: [2.15 backport] Really fix AVX tests allan at archlinux dot org
                   ` (3 preceding siblings ...)
  2012-05-10 20:26 ` carlos_odonell at mentor dot com
@ 2012-05-10 20:50 ` law at redhat dot com
  2012-05-10 22:03 ` allan at archlinux dot org
                   ` (8 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: law at redhat dot com @ 2012-05-10 20:50 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #5 from law at redhat dot com 2012-05-10 20:49:18 UTC ---
No, the code on the trunk plus the patch in this BZ are not sufficient to fix
the problem AFAIK. Unfortunately I don't have the right hardware to do testing,
so I'm relying on other folks.

I've got a change which I hope fixes this problem, but I'm going to have to
wait for feedback.  Based on my understanding we really need to avoid using any
AVX if the OS doesn't support XSAVE, even for things which don't use the YMM
regs.

-- 
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] 15+ messages in thread

* [Bug libc/13753] [2.15 backport] Really fix AVX tests
  2012-02-25  1:33 [Bug libc/13753] New: [2.15 backport] Really fix AVX tests allan at archlinux dot org
                   ` (4 preceding siblings ...)
  2012-05-10 20:50 ` law at redhat dot com
@ 2012-05-10 22:03 ` allan at archlinux dot org
  2012-05-10 22:22 ` carlos_odonell at mentor dot com
                   ` (7 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: allan at archlinux dot org @ 2012-05-10 22:03 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #6 from Allan McRae <allan at archlinux dot org> 2012-05-10 22:02:58 UTC ---
@Jeff: I have access to a Xen system to test these issues, so if you post a
link to the patch I can test.

Note that with the two original patches I still get issues in strcasecmp() with
illegal instructions with AVX:

#0  0x00007ffff76cd0ff in __strcasecmp_l_avx () from ./lib/libc.so.6

   0x00007ffff76cd0f7 <+23>:    and    $0x3f,%rcx
   0x00007ffff76cd0fb <+27>:    and    $0x3f,%rax
=> 0x00007ffff76cd0ff <+31>:    vmovdqa 0x46979(%rip),%xmm4        #
0x7ffff7713a80
   0x00007ffff76cd107 <+39>:    vmovdqa 0x469a1(%rip),%xmm5        #
0x7ffff7713ab0
   0x00007ffff76cd10f <+47>:    vmovdqa 0x46989(%rip),%xmm6        #
0x7ffff7713aa0

I will test with the additional patches linked in this bug report.


BTW, just to confirm how this should be done, the intel manual [1] states:
1) Detect CPUID.1:ECX.OSXSAVE[bit 27] = 1 (XGETBV enabled for application use1)
2) Issue XGETBV and verify that XCR0[2:1] = ‘11b’ (XMM state and YMM state are
enabled by OS).
3) detect CPUID.1:ECX.AVX[bit 28] = 1 (AVX instructions supported).
(Step 3 can be done in any order relative to 1 and 2)

http://www.intel.com/content/www/us/en/architecture-and-technology/64-ia-32-architectures-software-developer-manual-325462-rmver.html
- section 13.5

-- 
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] 15+ messages in thread

* [Bug libc/13753] [2.15 backport] Really fix AVX tests
  2012-02-25  1:33 [Bug libc/13753] New: [2.15 backport] Really fix AVX tests allan at archlinux dot org
                   ` (5 preceding siblings ...)
  2012-05-10 22:03 ` allan at archlinux dot org
@ 2012-05-10 22:22 ` carlos_odonell at mentor dot com
  2012-05-11  3:18 ` law at redhat dot com
                   ` (6 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: carlos_odonell at mentor dot com @ 2012-05-10 22:22 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #7 from Carlos O'Donell <carlos_odonell at mentor dot com> 2012-05-10 22:20:58 UTC ---
(In reply to comment #6)
> @Jeff: I have access to a Xen system to test these issues, so if you post a
> link to the patch I can test.
> 
> Note that with the two original patches I still get issues in strcasecmp() with
> illegal instructions with AVX:
> 
> #0  0x00007ffff76cd0ff in __strcasecmp_l_avx () from ./lib/libc.so.6
> 
>    0x00007ffff76cd0f7 <+23>:    and    $0x3f,%rcx
>    0x00007ffff76cd0fb <+27>:    and    $0x3f,%rax
> => 0x00007ffff76cd0ff <+31>:    vmovdqa 0x46979(%rip),%xmm4        #
> 0x7ffff7713a80
>    0x00007ffff76cd107 <+39>:    vmovdqa 0x469a1(%rip),%xmm5        #
> 0x7ffff7713ab0
>    0x00007ffff76cd10f <+47>:    vmovdqa 0x46989(%rip),%xmm6        #
> 0x7ffff7713aa0
> 
> I will test with the additional patches linked in this bug report.
> 
> 
> BTW, just to confirm how this should be done, the intel manual [1] states:
> 1) Detect CPUID.1:ECX.OSXSAVE[bit 27] = 1 (XGETBV enabled for application use1)
> 2) Issue XGETBV and verify that XCR0[2:1] = ‘11b’ (XMM state and YMM state are
> enabled by OS).
> 3) detect CPUID.1:ECX.AVX[bit 28] = 1 (AVX instructions supported).
> (Step 3 can be done in any order relative to 1 and 2)
> 
> http://www.intel.com/content/www/us/en/architecture-and-technology/64-ia-32-architectures-software-developer-manual-325462-rmver.html
> - section 13.5

Can you test this?
http://sourceware.org/ml/libc-alpha/2012-05/msg00607.html

-- 
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] 15+ messages in thread

* [Bug libc/13753] [2.15 backport] Really fix AVX tests
  2012-02-25  1:33 [Bug libc/13753] New: [2.15 backport] Really fix AVX tests allan at archlinux dot org
                   ` (6 preceding siblings ...)
  2012-05-10 22:22 ` carlos_odonell at mentor dot com
@ 2012-05-11  3:18 ` law at redhat dot com
  2012-05-11  5:36 ` allan at archlinux dot org
                   ` (5 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: law at redhat dot com @ 2012-05-11  3:18 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #8 from law at redhat dot com 2012-05-11 03:17:19 UTC ---
Allan, if you could test the patch referenced by Carlos in c#7, that'd be
better than testing my hack.  

My hack (well actually Konrad's hack) is similar to what AJ posted on
libc-alpha and resets cpu_features, which Carlos would like to avoid (and which
I tend to agree is hackish).  We'll probably use my hack for f17 simply due to
time constraints.  But for f18 and beyond Carlos's change or a variant thereof
would be better.

-- 
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] 15+ messages in thread

* [Bug libc/13753] [2.15 backport] Really fix AVX tests
  2012-02-25  1:33 [Bug libc/13753] New: [2.15 backport] Really fix AVX tests allan at archlinux dot org
                   ` (7 preceding siblings ...)
  2012-05-11  3:18 ` law at redhat dot com
@ 2012-05-11  5:36 ` allan at archlinux dot org
  2012-05-11  6:52 ` aj at suse dot de
                   ` (4 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: allan at archlinux dot org @ 2012-05-11  5:36 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #9 from Allan McRae <allan at archlinux dot org> 2012-05-11 05:36:24 UTC ---
I still get illegal instructions (vmovdqa) in __strcasecmp_l_avx () with
Carlos' patch [1].  The patch from Andreas [2] works.

[1] http://sourceware.org/ml/libc-alpha/2012-05/msg00607.html
[2] http://sourceware.org/ml/libc-alpha/2012-05/msg00321.html

(Xen DomU, i7-2600, x86_64-unknown-linux-gnu)

-- 
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] 15+ messages in thread

* [Bug libc/13753] [2.15 backport] Really fix AVX tests
  2012-02-25  1:33 [Bug libc/13753] New: [2.15 backport] Really fix AVX tests allan at archlinux dot org
                   ` (8 preceding siblings ...)
  2012-05-11  5:36 ` allan at archlinux dot org
@ 2012-05-11  6:52 ` aj at suse dot de
  2012-05-17 14:13 ` carlos_odonell at mentor dot com
                   ` (3 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: aj at suse dot de @ 2012-05-11  6:52 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #10 from Andreas Jaeger <aj at suse dot de> 2012-05-11 06:51:12 UTC ---
Allan, please test:

http://sourceware.org/ml/libc-alpha/2012-05/msg00619.html

And let's continue this discussion on libc-alpha where I posted the 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] 15+ messages in thread

* [Bug libc/13753] [2.15 backport] Really fix AVX tests
  2012-02-25  1:33 [Bug libc/13753] New: [2.15 backport] Really fix AVX tests allan at archlinux dot org
                   ` (9 preceding siblings ...)
  2012-05-11  6:52 ` aj at suse dot de
@ 2012-05-17 14:13 ` carlos_odonell at mentor dot com
  2012-05-18 21:08 ` carlos_odonell at mentor dot com
                   ` (2 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: carlos_odonell at mentor dot com @ 2012-05-17 14:13 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #11 from Carlos O'Donell <carlos_odonell at mentor dot com> 2012-05-17 14:10:17 UTC ---
Final fix is now on trunk.

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=1a0994f5356214e8af8a1c1cc33fbf74a7ac8993

I will backport this to 2.15.

-- 
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] 15+ messages in thread

* [Bug libc/13753] [2.15 backport] Really fix AVX tests
  2012-02-25  1:33 [Bug libc/13753] New: [2.15 backport] Really fix AVX tests allan at archlinux dot org
                   ` (10 preceding siblings ...)
  2012-05-17 14:13 ` carlos_odonell at mentor dot com
@ 2012-05-18 21:08 ` carlos_odonell at mentor dot com
  2012-05-18 21:30 ` carlos_odonell at mentor dot com
  2014-06-26 14:37 ` fweimer at redhat dot com
  13 siblings, 0 replies; 15+ messages in thread
From: carlos_odonell at mentor dot com @ 2012-05-18 21:08 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #12 from Carlos O'Donell <carlos_odonell at mentor dot com> 2012-05-18 21:07:24 UTC ---
Backported final fix. Testing.

-- 
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] 15+ messages in thread

* [Bug libc/13753] [2.15 backport] Really fix AVX tests
  2012-02-25  1:33 [Bug libc/13753] New: [2.15 backport] Really fix AVX tests allan at archlinux dot org
                   ` (11 preceding siblings ...)
  2012-05-18 21:08 ` carlos_odonell at mentor dot com
@ 2012-05-18 21:30 ` carlos_odonell at mentor dot com
  2014-06-26 14:37 ` fweimer at redhat dot com
  13 siblings, 0 replies; 15+ messages in thread
From: carlos_odonell at mentor dot com @ 2012-05-18 21:30 UTC (permalink / raw)
  To: glibc-bugs

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

Carlos O'Donell <carlos_odonell at mentor dot com> changed:

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

--- Comment #13 from Carlos O'Donell <carlos_odonell at mentor dot com> 2012-05-18 21:29:34 UTC ---
Checked into 2.15.

-- 
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] 15+ messages in thread

* [Bug libc/13753] [2.15 backport] Really fix AVX tests
  2012-02-25  1:33 [Bug libc/13753] New: [2.15 backport] Really fix AVX tests allan at archlinux dot org
                   ` (12 preceding siblings ...)
  2012-05-18 21:30 ` carlos_odonell at mentor dot com
@ 2014-06-26 14:37 ` fweimer at redhat dot com
  13 siblings, 0 replies; 15+ messages in thread
From: fweimer at redhat dot com @ 2014-06-26 14:37 UTC (permalink / raw)
  To: glibc-bugs

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

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] 15+ messages in thread

end of thread, other threads:[~2014-06-26 14:37 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-25  1:33 [Bug libc/13753] New: [2.15 backport] Really fix AVX tests allan at archlinux dot org
2012-05-02  2:28 ` [Bug libc/13753] " carlos_odonell at mentor dot com
2012-05-08 13:45 ` aj at suse dot de
2012-05-10 19:07 ` law at redhat dot com
2012-05-10 20:26 ` carlos_odonell at mentor dot com
2012-05-10 20:50 ` law at redhat dot com
2012-05-10 22:03 ` allan at archlinux dot org
2012-05-10 22:22 ` carlos_odonell at mentor dot com
2012-05-11  3:18 ` law at redhat dot com
2012-05-11  5:36 ` allan at archlinux dot org
2012-05-11  6:52 ` aj at suse dot de
2012-05-17 14:13 ` carlos_odonell at mentor dot com
2012-05-18 21:08 ` carlos_odonell at mentor dot com
2012-05-18 21:30 ` carlos_odonell at mentor dot com
2014-06-26 14:37 ` 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).