From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 10A313857C40; Mon, 17 Jul 2023 07:29:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 10A313857C40 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1689578955; bh=co+5a16x33lIsKqoCOOUzFvouV5swwQ3CM09MLFCZFM=; h=From:To:Subject:Date:From; b=NfUq8VFdDJe5fudYKAG6HIXFpap/7VkL5PHb0j090/CySFOljLdB/tV5kC//59ueo 1GxJ4bmU8XanXI5w3hlAyKQaXVo/4YBHdK21P8T9VBRNV4rx+y533qoYhifL8j5AbV 70hs99PL/42LSkzqKJgl1lzyEG3HnPQeAxD/8kdE= From: "fweimer at redhat dot com" To: glibc-bugs@sourceware.org Subject: [Bug libc/30643] New: Missing cache information on x86-64 under Intel TDX Date: Mon, 17 Jul 2023 07:29:13 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: libc X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: fweimer at redhat dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: security- X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc target_milestone flagtypes.name Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D30643 Bug ID: 30643 Summary: Missing cache information on x86-64 under Intel TDX Product: glibc Version: unspecified Status: NEW Severity: normal Priority: P2 Component: libc Assignee: unassigned at sourceware dot org Reporter: fweimer at redhat dot com CC: drepper.fsp at gmail dot com Target Milestone: --- Flags: security- Bug 30037 has further consequences. While the immediate crash was fixed fix= ed via bug 29953, glibc still does not produce correct cache geometry informat= ion this case: # getconf -a | grep CACHE LEVEL1_ICACHE_SIZE 0 LEVEL1_ICACHE_ASSOC=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 LEVEL1_ICACHE_LINESIZE 0 LEVEL1_DCACHE_SIZE 0 LEVEL1_DCACHE_ASSOC 0 LEVEL1_DCACHE_LINESIZE 0 LEVEL2_CACHE_SIZE 0 LEVEL2_CACHE_ASSOC 0 LEVEL2_CACHE_LINESIZE 0 LEVEL3_CACHE_SIZE 0 LEVEL3_CACHE_ASSOC 0 LEVEL3_CACHE_LINESIZE 0 LEVEL4_CACHE_SIZE 0 LEVEL4_CACHE_ASSOC=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 LEVEL4_CACHE_LINESIZE=20=20=20=20=20=20=20=20=20=20=20=20=20=20 Some of these values are used for splitting arrays for processing, so a val= ue of 0 can result in an endless loop or a division-by-zero trap. The information is apparently available somewhere else via CPUID, but the E= AX=3D2 query is commonly used directly by applications, so it's not really clear t= o me that a glibc fix is sufficient. The following data is from an Azure TDX instance, share with permission. # /usr/bin/cpuid -1 -r=20=20 CPU: 0x00000000 0x00: eax=3D0x00000021 ebx=3D0x756e6547 ecx=3D0x6c65746e edx= =3D0x49656e69 0x00000001 0x00: eax=3D0x000806f8 ebx=3D0x00020800 ecx=3D0xfffaba17 edx= =3D0x1fabfbff 0x00000002 0x00: eax=3D0x00000000 ebx=3D0x00000000 ecx=3D0x00000000 edx= =3D0x00000000 0x00000003 0x00: eax=3D0x00000000 ebx=3D0x00000000 ecx=3D0x00000000 edx= =3D0x00000000 0x00000004 0x00: eax=3D0x00004121 ebx=3D0x02c0003f ecx=3D0x0000003f edx= =3D0x00000000 0x00000004 0x01: eax=3D0x00004122 ebx=3D0x01c0003f ecx=3D0x0000003f edx= =3D0x00000000 0x00000004 0x02: eax=3D0x00004143 ebx=3D0x03c0003f ecx=3D0x000007ff edx= =3D0x00000000 0x00000004 0x03: eax=3D0x00004163 ebx=3D0x0380003f ecx=3D0x0001bfff edx= =3D0x00000000 0x00000004 0x04: eax=3D0x00000000 ebx=3D0x00000000 ecx=3D0x00000000 edx= =3D0x00000000 0x00000005 0x00: eax=3D0x00000000 ebx=3D0x00000000 ecx=3D0x00000000 edx= =3D0x00000000 0x00000006 0x00: eax=3D0x00000000 ebx=3D0x00000000 ecx=3D0x00000000 edx= =3D0x00000000 0x00000007 0x00: eax=3D0x00000001 ebx=3D0xf1bf2ff9 ecx=3D0x1b415fe6 edx= =3D0xffd14410 0x00000007 0x01: eax=3D0x00001c30 ebx=3D0x00000000 ecx=3D0x00000000 edx= =3D0x00000000 0x00000008 0x00: eax=3D0x00000000 ebx=3D0x00000000 ecx=3D0x00000000 edx= =3D0x00000000 0x00000009 0x00: eax=3D0x00000000 ebx=3D0x00000000 ecx=3D0x00000000 edx= =3D0x00000000 0x0000000a 0x00: eax=3D0x00000000 ebx=3D0x00000000 ecx=3D0x00000000 edx= =3D0x00000000 0x0000000b 0x00: eax=3D0x00000000 ebx=3D0x00000000 ecx=3D0x00000000 edx= =3D0x00000000 0x0000000c 0x00: eax=3D0x00000000 ebx=3D0x00000000 ecx=3D0x00000000 edx= =3D0x00000000 0x0000000d 0x00: eax=3D0x000600e7 ebx=3D0x00002b00 ecx=3D0x00002b00 edx= =3D0x00000000 0x0000000d 0x01: eax=3D0x0000001f ebx=3D0x000029c0 ecx=3D0x00001800 edx= =3D0x00000000 0x0000000d 0x02: eax=3D0x00000100 ebx=3D0x00000240 ecx=3D0x00000000 edx= =3D0x00000000 0x0000000d 0x05: eax=3D0x00000040 ebx=3D0x00000440 ecx=3D0x00000000 edx= =3D0x00000000 0x0000000d 0x06: eax=3D0x00000200 ebx=3D0x00000480 ecx=3D0x00000000 edx= =3D0x00000000 0x0000000d 0x07: eax=3D0x00000400 ebx=3D0x00000680 ecx=3D0x00000000 edx= =3D0x00000000 0x0000000d 0x0b: eax=3D0x00000010 ebx=3D0x00000000 ecx=3D0x00000001 edx= =3D0x00000000 0x0000000d 0x0c: eax=3D0x00000018 ebx=3D0x00000000 ecx=3D0x00000001 edx= =3D0x00000000 0x0000000d 0x11: eax=3D0x00000040 ebx=3D0x00000ac0 ecx=3D0x00000002 edx= =3D0x00000000 0x0000000d 0x12: eax=3D0x00002000 ebx=3D0x00000b00 ecx=3D0x00000006 edx= =3D0x00000000 0x0000000e 0x00: eax=3D0x00000000 ebx=3D0x00000000 ecx=3D0x00000000 edx= =3D0x00000000 0x0000000f 0x00: eax=3D0x00000000 ebx=3D0x00000000 ecx=3D0x00000000 edx= =3D0x00000000 0x00000010 0x00: eax=3D0x00000000 ebx=3D0x00000000 ecx=3D0x00000000 edx= =3D0x00000000 0x00000011 0x00: eax=3D0x00000000 ebx=3D0x00000000 ecx=3D0x00000000 edx= =3D0x00000000 0x00000012 0x00: eax=3D0x00000000 ebx=3D0x00000000 ecx=3D0x00000000 edx= =3D0x00000000 0x00000012 0x01: eax=3D0x00000000 ebx=3D0x00000000 ecx=3D0x00000000 edx= =3D0x00000000 0x00000012 0x02: eax=3D0x00000000 ebx=3D0x00000000 ecx=3D0x00000000 edx= =3D0x00000000 0x00000013 0x00: eax=3D0x00000000 ebx=3D0x00000000 ecx=3D0x00000000 edx= =3D0x00000000 0x00000014 0x00: eax=3D0x00000000 ebx=3D0x00000000 ecx=3D0x00000000 edx= =3D0x00000000 0x00000015 0x00: eax=3D0x00000001 ebx=3D0x00000054 ecx=3D0x017d7840 edx= =3D0x00000000 0x00000016 0x00: eax=3D0x00000000 ebx=3D0x00000000 ecx=3D0x00000000 edx= =3D0x00000000 0x00000017 0x00: eax=3D0x00000000 ebx=3D0x00000000 ecx=3D0x00000000 edx= =3D0x00000000 0x00000018 0x00: eax=3D0x00000000 ebx=3D0x00000000 ecx=3D0x00000000 edx= =3D0x00000000 0x00000019 0x00: eax=3D0x00000000 ebx=3D0x00000000 ecx=3D0x00000000 edx= =3D0x00000000 0x0000001a 0x00: eax=3D0x00000000 ebx=3D0x00000000 ecx=3D0x00000000 edx= =3D0x00000000 0x0000001b 0x00: eax=3D0x00000000 ebx=3D0x00000000 ecx=3D0x00000000 edx= =3D0x00000000 0x0000001b 0x01: eax=3D0x00000000 ebx=3D0x00000000 ecx=3D0x00000000 edx= =3D0x00000000 0x0000001c 0x00: eax=3D0x00000000 ebx=3D0x00000000 ecx=3D0x00000000 edx= =3D0x00000000 0x0000001d 0x00: eax=3D0x00000001 ebx=3D0x00000000 ecx=3D0x00000000 edx= =3D0x00000000 0x0000001d 0x01: eax=3D0x04002000 ebx=3D0x00080040 ecx=3D0x00000010 edx= =3D0x00000000 0x0000001e 0x00: eax=3D0x00000000 ebx=3D0x00004010 ecx=3D0x00000000 edx= =3D0x00000000 0x0000001f 0x00: eax=3D0x00000000 ebx=3D0x00000000 ecx=3D0x00000000 edx= =3D0x00000000 0x0000001f 0x01: eax=3D0x00000000 ebx=3D0x00000000 ecx=3D0x00000000 edx= =3D0x00000000 0x00000020 0x00: eax=3D0x00000000 ebx=3D0x00000000 ecx=3D0x00000000 edx= =3D0x00000000 0x00000021 0x00: eax=3D0x00000000 ebx=3D0x65746e49 ecx=3D0x20202020 edx= =3D0x5844546c 0x20000000 0x00: eax=3D0x00000000 ebx=3D0x65746e49 ecx=3D0x20202020 edx= =3D0x5844546c 0x40000000 0x00: eax=3D0x4000000c ebx=3D0x7263694d ecx=3D0x666f736f edx= =3D0x76482074 0x40000001 0x00: eax=3D0x31237648 ebx=3D0x00000000 ecx=3D0x00000000 edx= =3D0x00000000 0x40000002 0x00: eax=3D0x0000585d ebx=3D0x000a0000 ecx=3D0x00000001 edx= =3D0x00000447 0x40000003 0x00: eax=3D0x0000ae7f ebx=3D0x00628030 ecx=3D0x00000002 edx= =3D0xe0be47a2 0x40000004 0x00: eax=3D0x00360e24 ebx=3D0x00000fff ecx=3D0x00000034 edx= =3D0x00000000 0x40000005 0x00: eax=3D0x00000800 ebx=3D0x00000800 ecx=3D0x00009720 edx= =3D0x00000000 0x40000006 0x00: eax=3D0x0000000f ebx=3D0x00000000 ecx=3D0x00000000 edx= =3D0x00000000 0x40000007 0x00: eax=3D0x00000000 ebx=3D0x00000000 ecx=3D0x00000000 edx= =3D0x00000000 0x40000008 0x00: eax=3D0x00000000 ebx=3D0x00000000 ecx=3D0x00000000 edx= =3D0x00000000 0x40000009 0x00: eax=3D0x00000000 ebx=3D0x00000000 ecx=3D0x00000000 edx= =3D0x00000000 0x4000000a 0x00: eax=3D0x00000000 ebx=3D0x00000000 ecx=3D0x00000000 edx= =3D0x00000000 0x4000000b 0x00: eax=3D0x00000000 ebx=3D0x00000000 ecx=3D0x00000000 edx= =3D0x00000000 0x4000000c 0x00: eax=3D0x00000000 ebx=3D0x00000003 ecx=3D0x00000000 edx= =3D0x00000000 0x40000100 0x00: eax=3D0x00000000 ebx=3D0x00000000 ecx=3D0x00000000 edx= =3D0x00000000 0x80000000 0x00: eax=3D0x80000008 ebx=3D0x00000000 ecx=3D0x00000000 edx= =3D0x00000000 0x80000001 0x00: eax=3D0x00000000 ebx=3D0x00000000 ecx=3D0x00000121 edx= =3D0x2c100800 0x80000002 0x00: eax=3D0x00000000 ebx=3D0x00000000 ecx=3D0x00000000 edx= =3D0x00000000 0x80000003 0x00: eax=3D0x00000000 ebx=3D0x00000000 ecx=3D0x00000000 edx= =3D0x00000000 0x80000004 0x00: eax=3D0x00000000 ebx=3D0x00000000 ecx=3D0x00000000 edx= =3D0x00000000 0x80000005 0x00: eax=3D0x00000000 ebx=3D0x00000000 ecx=3D0x00000000 edx= =3D0x00000000 0x80000006 0x00: eax=3D0x00000000 ebx=3D0x00000000 ecx=3D0x00000000 edx= =3D0x00000000 0x80000007 0x00: eax=3D0x00000000 ebx=3D0x00000000 ecx=3D0x00000000 edx= =3D0x00000000 0x80000008 0x00: eax=3D0x00003934 ebx=3D0x00000200 ecx=3D0x00000000 edx= =3D0x00000000 0x80860000 0x00: eax=3D0x00000000 ebx=3D0x65746e49 ecx=3D0x20202020 edx= =3D0x5844546c 0xc0000000 0x00: eax=3D0x00000000 ebx=3D0x65746e49 ecx=3D0x20202020 edx= =3D0x5844546c --=20 You are receiving this mail because: You are on the CC list for the bug.=