public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/28784] New: [x86] crash in 32bit memset-sse2.s when the cache size can not be determined
@ 2022-01-15 10:12 aurelien at aurel32 dot net
  2022-01-15 10:17 ` [Bug libc/28784] " aurelien at aurel32 dot net
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: aurelien at aurel32 dot net @ 2022-01-15 10:12 UTC (permalink / raw)
  To: glibc-bugs

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

            Bug ID: 28784
           Summary: [x86] crash in 32bit memset-sse2.s when the cache size
                    can not be determined
           Product: glibc
           Version: 2.35
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
          Assignee: unassigned at sourceware dot org
          Reporter: aurelien at aurel32 dot net
                CC: drepper.fsp at gmail dot com
  Target Milestone: ---

In some cases (e.g QEMU, non-Intel/AMD CPU like VIA C7) the cache information
can not be retrieved and the corresponding values are set to 0.

Commit 2d651eb9265d ("x86: Move x86 processor cache info to cpu_features")
changed the behaviour in such case by defining the __x86_shared_cache_size and
__x86_data_cache_size variables to 0 instead of using the default values. This
cause an issue with the i686 SSE2 optimized bzero/routine which assumes that
the cache size is at least 128 bytes, and otherwise tries to zero/set the whole
address space minus 128 bytes.

-- 
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/28784] [x86] crash in 32bit memset-sse2.s when the cache size can not be determined
  2022-01-15 10:12 [Bug libc/28784] New: [x86] crash in 32bit memset-sse2.s when the cache size can not be determined aurelien at aurel32 dot net
@ 2022-01-15 10:17 ` aurelien at aurel32 dot net
  2022-01-17 18:43 ` cvs-commit at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: aurelien at aurel32 dot net @ 2022-01-15 10:17 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #1 from Aurelien Jarno <aurelien at aurel32 dot net> ---
Patch available here:
https://sourceware.org/pipermail/libc-alpha/2022-January/135358.html

-- 
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/28784] [x86] crash in 32bit memset-sse2.s when the cache size can not be determined
  2022-01-15 10:12 [Bug libc/28784] New: [x86] crash in 32bit memset-sse2.s when the cache size can not be determined aurelien at aurel32 dot net
  2022-01-15 10:17 ` [Bug libc/28784] " aurelien at aurel32 dot net
@ 2022-01-17 18:43 ` cvs-commit at gcc dot gnu.org
  2022-01-17 18:44 ` aurelien at aurel32 dot net
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-01-17 18:43 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #2 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Aurelien Jarno <aurel32@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=c242fcce06e3102ca663b2f992611d0bda4f2668

commit c242fcce06e3102ca663b2f992611d0bda4f2668
Author: Aurelien Jarno <aurelien@aurel32.net>
Date:   Mon Jan 17 19:41:40 2022 +0100

    x86: use default cache size if it cannot be determined [BZ #28784]

    In some cases (e.g QEMU, non-Intel/AMD CPU) the cache information can
    not be retrieved and the corresponding values are set to 0.

    Commit 2d651eb9265d ("x86: Move x86 processor cache info to
    cpu_features") changed the behaviour in such case by defining the
    __x86_shared_cache_size and __x86_data_cache_size variables to 0 instead
    of using the default values. This cause an issue with the i686 SSE2
    optimized bzero/routine which assumes that the cache size is at least
    128 bytes, and otherwise tries to zero/set the whole address space minus
    128 bytes.

    Fix that by restoring the original code to only update
    __x86_shared_cache_size and __x86_data_cache_size variables if the
    corresponding cache sizes are not zero.

    Fixes bug 28784
    Fixes commit 2d651eb9265d

    Reviewed-by: H.J. Lu <hjl.tools@gmail.com>

-- 
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/28784] [x86] crash in 32bit memset-sse2.s when the cache size can not be determined
  2022-01-15 10:12 [Bug libc/28784] New: [x86] crash in 32bit memset-sse2.s when the cache size can not be determined aurelien at aurel32 dot net
  2022-01-15 10:17 ` [Bug libc/28784] " aurelien at aurel32 dot net
  2022-01-17 18:43 ` cvs-commit at gcc dot gnu.org
@ 2022-01-17 18:44 ` aurelien at aurel32 dot net
  2022-01-17 18:45 ` [Bug libc/28784] x86: " aurelien at aurel32 dot net
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: aurelien at aurel32 dot net @ 2022-01-17 18:44 UTC (permalink / raw)
  To: glibc-bugs

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

Aurelien Jarno <aurelien at aurel32 dot net> changed:

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

--- Comment #3 from Aurelien Jarno <aurelien at aurel32 dot net> ---
Fixed for glibc 2.35

-- 
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/28784] x86: crash in 32bit memset-sse2.s when the cache size can not be determined
  2022-01-15 10:12 [Bug libc/28784] New: [x86] crash in 32bit memset-sse2.s when the cache size can not be determined aurelien at aurel32 dot net
                   ` (2 preceding siblings ...)
  2022-01-17 18:44 ` aurelien at aurel32 dot net
@ 2022-01-17 18:45 ` aurelien at aurel32 dot net
  2022-01-17 18:47 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: aurelien at aurel32 dot net @ 2022-01-17 18:45 UTC (permalink / raw)
  To: glibc-bugs

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

Aurelien Jarno <aurelien at aurel32 dot net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[x86] crash in 32bit        |x86: crash in 32bit
                   |memset-sse2.s when the      |memset-sse2.s when the
                   |cache size can not be       |cache size can not be
                   |determined                  |determined

-- 
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/28784] x86: crash in 32bit memset-sse2.s when the cache size can not be determined
  2022-01-15 10:12 [Bug libc/28784] New: [x86] crash in 32bit memset-sse2.s when the cache size can not be determined aurelien at aurel32 dot net
                   ` (3 preceding siblings ...)
  2022-01-17 18:45 ` [Bug libc/28784] x86: " aurelien at aurel32 dot net
@ 2022-01-17 18:47 ` cvs-commit at gcc dot gnu.org
  2022-01-18  6:45 ` cvs-commit at gcc dot gnu.org
  2023-01-24 20:33 ` decui at microsoft dot com
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-01-17 18:47 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #4 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The release/2.34/master branch has been updated by Aurelien Jarno
<aurel32@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=1d401d1fccb85046402089268b94d86d822070e6

commit 1d401d1fccb85046402089268b94d86d822070e6
Author: Aurelien Jarno <aurelien@aurel32.net>
Date:   Mon Jan 17 19:41:40 2022 +0100

    x86: use default cache size if it cannot be determined [BZ #28784]

    In some cases (e.g QEMU, non-Intel/AMD CPU) the cache information can
    not be retrieved and the corresponding values are set to 0.

    Commit 2d651eb9265d ("x86: Move x86 processor cache info to
    cpu_features") changed the behaviour in such case by defining the
    __x86_shared_cache_size and __x86_data_cache_size variables to 0 instead
    of using the default values. This cause an issue with the i686 SSE2
    optimized bzero/routine which assumes that the cache size is at least
    128 bytes, and otherwise tries to zero/set the whole address space minus
    128 bytes.

    Fix that by restoring the original code to only update
    __x86_shared_cache_size and __x86_data_cache_size variables if the
    corresponding cache sizes are not zero.

    Fixes bug 28784
    Fixes commit 2d651eb9265d

    Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
    (cherry picked from commit c242fcce06e3102ca663b2f992611d0bda4f2668)

-- 
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/28784] x86: crash in 32bit memset-sse2.s when the cache size can not be determined
  2022-01-15 10:12 [Bug libc/28784] New: [x86] crash in 32bit memset-sse2.s when the cache size can not be determined aurelien at aurel32 dot net
                   ` (4 preceding siblings ...)
  2022-01-17 18:47 ` cvs-commit at gcc dot gnu.org
@ 2022-01-18  6:45 ` cvs-commit at gcc dot gnu.org
  2023-01-24 20:33 ` decui at microsoft dot com
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-01-18  6:45 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #5 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The release/2.33/master branch has been updated by Aurelien Jarno
<aurel32@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=a51b76b71e8190a50b0e0c0b32f313888b930108

commit a51b76b71e8190a50b0e0c0b32f313888b930108
Author: Aurelien Jarno <aurelien@aurel32.net>
Date:   Mon Jan 17 19:41:40 2022 +0100

    x86: use default cache size if it cannot be determined [BZ #28784]

    In some cases (e.g QEMU, non-Intel/AMD CPU) the cache information can
    not be retrieved and the corresponding values are set to 0.

    Commit 2d651eb9265d ("x86: Move x86 processor cache info to
    cpu_features") changed the behaviour in such case by defining the
    __x86_shared_cache_size and __x86_data_cache_size variables to 0 instead
    of using the default values. This cause an issue with the i686 SSE2
    optimized bzero/routine which assumes that the cache size is at least
    128 bytes, and otherwise tries to zero/set the whole address space minus
    128 bytes.

    Fix that by restoring the original code to only update
    __x86_shared_cache_size and __x86_data_cache_size variables if the
    corresponding cache sizes are not zero.

    Fixes bug 28784
    Fixes commit 2d651eb9265d

    Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
    (cherry picked from commit c242fcce06e3102ca663b2f992611d0bda4f2668)

-- 
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/28784] x86: crash in 32bit memset-sse2.s when the cache size can not be determined
  2022-01-15 10:12 [Bug libc/28784] New: [x86] crash in 32bit memset-sse2.s when the cache size can not be determined aurelien at aurel32 dot net
                   ` (5 preceding siblings ...)
  2022-01-18  6:45 ` cvs-commit at gcc dot gnu.org
@ 2023-01-24 20:33 ` decui at microsoft dot com
  6 siblings, 0 replies; 8+ messages in thread
From: decui at microsoft dot com @ 2023-01-24 20:33 UTC (permalink / raw)
  To: glibc-bugs

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

Dexuan Cui <decui at microsoft dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |decui at microsoft dot com

--- Comment #6 from Dexuan Cui <decui at microsoft dot com> ---
(In reply to Aurelien Jarno from comment #3)
> Fixed for glibc 2.35

Hi Aurelien and all, could you please take a look at this new bug I just
reported:
https://sourceware.org/bugzilla/show_bug.cgi?id=30037

-- 
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:[~2023-01-24 20:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-15 10:12 [Bug libc/28784] New: [x86] crash in 32bit memset-sse2.s when the cache size can not be determined aurelien at aurel32 dot net
2022-01-15 10:17 ` [Bug libc/28784] " aurelien at aurel32 dot net
2022-01-17 18:43 ` cvs-commit at gcc dot gnu.org
2022-01-17 18:44 ` aurelien at aurel32 dot net
2022-01-17 18:45 ` [Bug libc/28784] x86: " aurelien at aurel32 dot net
2022-01-17 18:47 ` cvs-commit at gcc dot gnu.org
2022-01-18  6:45 ` cvs-commit at gcc dot gnu.org
2023-01-24 20:33 ` decui at microsoft 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).