* [Bug libc/30037] glibc 2.34 and newer segfault if CPUID leaf 0x2 reports zero
2023-01-24 3:48 [Bug libc/30037] New: glibc 2.34 and newer segfault if CPUID leaf 0x2 reports zero decui at microsoft dot com
@ 2023-01-24 4:03 ` decui at microsoft dot com
2023-01-24 4:18 ` decui at microsoft dot com
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: decui at microsoft dot com @ 2023-01-24 4:03 UTC (permalink / raw)
To: glibc-bugs
https://sourceware.org/bugzilla/show_bug.cgi?id=30037
Dexuan Cui <decui at microsoft dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |decui at microsoft dot com
--- Comment #1 from Dexuan Cui <decui at microsoft dot com> ---
I'm reading "Intel® 64 and IA-32 Architectures Software Developer’s Manual
Volume 2A: Instruction Set Reference, A-L" for the definition of CPUID leaf
0x2:
"
INPUT EAX = 02H: TLB/Cache/Prefetch Information Returned in EAX, EBX, ECX, EDX
When CPUID executes with EAX set to 02H, the processor returns information
about the processor’s internal TLBs, cache and prefetch hardware in the EAX,
EBX, ECX, and EDX registers. The information is reported in encoded form and
fall into the following categories:
• The least-significant byte in register EAX (register AL) will always return
01H. Software should ignore this value and not interpret it as an informational
descriptor.
• The most significant bit (bit 31) of each register indicates whether the
register contains valid information (set to 0) or is reserved (set to 1).
• If a register contains valid information, the information is contained in 1
byte descriptors. There are four types of encoding values for the byte
descriptor, the encoding type is noted in the second column of Table 3-12.
Table
3-12 lists the encoding of these descriptors. Note that the order of
descriptors in the EAX, EBX, ECX, and EDX registers is not defined; that is,
specific bytes are not designated to contain descriptors for specific cache,
prefetch, or TLB types. The descriptors may appear in any order. Note also a
processor may report a general descriptor type (FFH) and not report any byte
descriptor of “cache type” via CPUID leaf 2.
"
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug libc/30037] glibc 2.34 and newer segfault if CPUID leaf 0x2 reports zero
2023-01-24 3:48 [Bug libc/30037] New: glibc 2.34 and newer segfault if CPUID leaf 0x2 reports zero decui at microsoft dot com
2023-01-24 4:03 ` [Bug libc/30037] " decui at microsoft dot com
@ 2023-01-24 4:18 ` decui at microsoft dot com
2023-01-25 20:35 ` goldstein.w.n at gmail dot com
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: decui at microsoft dot com @ 2023-01-24 4:18 UTC (permalink / raw)
To: glibc-bugs
https://sourceware.org/bugzilla/show_bug.cgi?id=30037
--- Comment #2 from Dexuan Cui <decui at microsoft dot com> ---
CPUID leaf 0x2 is emulated for a TDX guest, and currently the returned
EAX/EBX/ECX/EDX are all zeros, and I see the segfault issue in recent releases
of glibc, including 2.36-0ubuntu4.
If I change the emulation logic in Linux kernel to return 0xff01 in EAX, then
the segfault is gone.
0xff01 in EAX means "CPUID leaf 2 does not report cache descriptor information,
use CPUID leaf 4 to query cache parameters".
So it looks like recent versions of glibc (2.34 and newer?) require a non-zero
value in EAX? Please shed some light on this. Thanks!
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug libc/30037] glibc 2.34 and newer segfault if CPUID leaf 0x2 reports zero
2023-01-24 3:48 [Bug libc/30037] New: glibc 2.34 and newer segfault if CPUID leaf 0x2 reports zero decui at microsoft dot com
2023-01-24 4:03 ` [Bug libc/30037] " decui at microsoft dot com
2023-01-24 4:18 ` decui at microsoft dot com
@ 2023-01-25 20:35 ` goldstein.w.n at gmail dot com
2023-01-27 18:13 ` hjl.tools at gmail dot com
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: goldstein.w.n at gmail dot com @ 2023-01-25 20:35 UTC (permalink / raw)
To: glibc-bugs
https://sourceware.org/bugzilla/show_bug.cgi?id=30037
Noah Goldstein <goldstein.w.n at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |goldstein.w.n at gmail dot com
--- Comment #3 from Noah Goldstein <goldstein.w.n at gmail dot com> ---
Maybe this is duplicate of:
https://sourceware.org/bugzilla/show_bug.cgi?id=29953 in which case it was
fixed by:
https://sourceware.org/git/?p=glibc.git;a=commit;h=48b74865c63840b288bd85b4d8743533b73b339b
x86: Check minimum/maximum of non_temporal_threshold [BZ #29953]
The minimum non_temporal_threshold is 0x4040. non_temporal_threshold may
be set to less than the minimum value when the shared cache size isn't
available (e.g., in an emulator) or by the tunable. Add checks for
minimum and maximum of non_temporal_threshold.
This fixes BZ #29953.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug libc/30037] glibc 2.34 and newer segfault if CPUID leaf 0x2 reports zero
2023-01-24 3:48 [Bug libc/30037] New: glibc 2.34 and newer segfault if CPUID leaf 0x2 reports zero decui at microsoft dot com
` (2 preceding siblings ...)
2023-01-25 20:35 ` goldstein.w.n at gmail dot com
@ 2023-01-27 18:13 ` hjl.tools at gmail dot com
2023-02-24 16:27 ` ayi at janestreet dot com
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: hjl.tools at gmail dot com @ 2023-01-27 18:13 UTC (permalink / raw)
To: glibc-bugs
https://sourceware.org/bugzilla/show_bug.cgi?id=30037
H.J. Lu <hjl.tools at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |hjl.tools at gmail dot com
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug libc/30037] glibc 2.34 and newer segfault if CPUID leaf 0x2 reports zero
2023-01-24 3:48 [Bug libc/30037] New: glibc 2.34 and newer segfault if CPUID leaf 0x2 reports zero decui at microsoft dot com
` (3 preceding siblings ...)
2023-01-27 18:13 ` hjl.tools at gmail dot com
@ 2023-02-24 16:27 ` ayi at janestreet dot com
2023-02-24 16:29 ` ayi at janestreet dot com
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: ayi at janestreet dot com @ 2023-02-24 16:27 UTC (permalink / raw)
To: glibc-bugs
https://sourceware.org/bugzilla/show_bug.cgi?id=30037
Adam Yi <ayi at janestreet dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ayi at janestreet dot com
--- Comment #4 from Adam Yi <ayi at janestreet dot com> ---
Created attachment 14719
--> https://sourceware.org/bugzilla/attachment.cgi?id=14719&action=edit
Proposed patch
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug libc/30037] glibc 2.34 and newer segfault if CPUID leaf 0x2 reports zero
2023-01-24 3:48 [Bug libc/30037] New: glibc 2.34 and newer segfault if CPUID leaf 0x2 reports zero decui at microsoft dot com
` (4 preceding siblings ...)
2023-02-24 16:27 ` ayi at janestreet dot com
@ 2023-02-24 16:29 ` ayi at janestreet dot com
2023-03-13 12:16 ` ioanna.alifieraki at gmail dot com
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: ayi at janestreet dot com @ 2023-02-24 16:29 UTC (permalink / raw)
To: glibc-bugs
https://sourceware.org/bugzilla/show_bug.cgi?id=30037
--- Comment #5 from Adam Yi <ayi at janestreet dot com> ---
Ah sorry please ignore the patch above. I added it to the wrong bug :(
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug libc/30037] glibc 2.34 and newer segfault if CPUID leaf 0x2 reports zero
2023-01-24 3:48 [Bug libc/30037] New: glibc 2.34 and newer segfault if CPUID leaf 0x2 reports zero decui at microsoft dot com
` (5 preceding siblings ...)
2023-02-24 16:29 ` ayi at janestreet dot com
@ 2023-03-13 12:16 ` ioanna.alifieraki at gmail dot com
2023-03-13 17:59 ` fweimer at redhat dot com
2023-07-17 7:29 ` fweimer at redhat dot com
8 siblings, 0 replies; 10+ messages in thread
From: ioanna.alifieraki at gmail dot com @ 2023-03-13 12:16 UTC (permalink / raw)
To: glibc-bugs
https://sourceware.org/bugzilla/show_bug.cgi?id=30037
ioanna alifieraki <ioanna.alifieraki at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ioanna.alifieraki at gmail dot com
--- Comment #6 from ioanna alifieraki <ioanna.alifieraki at gmail dot com> ---
I can confirm that this is a duplicate of
https://sourceware.org/bugzilla/show_bug.cgi?id=29953 and commit
https://sourceware.org/git/?p=glibc.git;a=commit;h=48b74865c63840b288bd85b4d8743533b73b339b
resolves the crash on Ubuntu 22.04.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug libc/30037] glibc 2.34 and newer segfault if CPUID leaf 0x2 reports zero
2023-01-24 3:48 [Bug libc/30037] New: glibc 2.34 and newer segfault if CPUID leaf 0x2 reports zero decui at microsoft dot com
` (6 preceding siblings ...)
2023-03-13 12:16 ` ioanna.alifieraki at gmail dot com
@ 2023-03-13 17:59 ` fweimer at redhat dot com
2023-07-17 7:29 ` fweimer at redhat dot com
8 siblings, 0 replies; 10+ messages in thread
From: fweimer at redhat dot com @ 2023-03-13 17:59 UTC (permalink / raw)
To: glibc-bugs
https://sourceware.org/bugzilla/show_bug.cgi?id=30037
Florian Weimer <fweimer at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |fweimer at redhat dot com
Status|UNCONFIRMED |RESOLVED
Resolution|--- |DUPLICATE
--- Comment #7 from Florian Weimer <fweimer at redhat dot com> ---
Marking as duplicated as instructed. Thanks.
*** This bug has been marked as a duplicate of bug 29953 ***
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug libc/30037] glibc 2.34 and newer segfault if CPUID leaf 0x2 reports zero
2023-01-24 3:48 [Bug libc/30037] New: glibc 2.34 and newer segfault if CPUID leaf 0x2 reports zero decui at microsoft dot com
` (7 preceding siblings ...)
2023-03-13 17:59 ` fweimer at redhat dot com
@ 2023-07-17 7:29 ` fweimer at redhat dot com
8 siblings, 0 replies; 10+ messages in thread
From: fweimer at redhat dot com @ 2023-07-17 7:29 UTC (permalink / raw)
To: glibc-bugs
https://sourceware.org/bugzilla/show_bug.cgi?id=30037
Florian Weimer <fweimer at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
See Also| |https://sourceware.org/bugz
| |illa/show_bug.cgi?id=30643
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 10+ messages in thread