public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "fweimer at redhat dot com" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sourceware.org
Subject: [Bug libc/30643] Missing cache information on x86-64 under Intel TDX
Date: Mon, 17 Jul 2023 08:46:07 +0000	[thread overview]
Message-ID: <bug-30643-131-ZUKSVaUrkw@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-30643-131@http.sourceware.org/bugzilla/>

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

Florian Weimer <fweimer at redhat dot com> changed:

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

--- Comment #1 from Florian Weimer <fweimer at redhat dot com> ---
Raised on libc-alpha and elsewhere:

Missing cache information on x86-64 under Intel TDX (glibc bug 30643)
<https://sourceware.org/pipermail/libc-alpha/2023-July/150115.html>

This quick hack produces more reasonable values:

# bash testrun.sh posix/getconf -a | grep CACHE
LEVEL1_ICACHE_SIZE                 32768
LEVEL1_ICACHE_ASSOC                
LEVEL1_ICACHE_LINESIZE             64
LEVEL1_DCACHE_SIZE                 49152
LEVEL1_DCACHE_ASSOC                12
LEVEL1_DCACHE_LINESIZE             64
LEVEL2_CACHE_SIZE                  2097152
LEVEL2_CACHE_ASSOC                 16
LEVEL2_CACHE_LINESIZE              64
LEVEL3_CACHE_SIZE                  110100480
LEVEL3_CACHE_ASSOC                 15
LEVEL3_CACHE_LINESIZE              64
LEVEL4_CACHE_SIZE                  0
LEVEL4_CACHE_ASSOC                 
LEVEL4_CACHE_LINESIZE              

diff --git a/sysdeps/x86/dl-cacheinfo.h b/sysdeps/x86/dl-cacheinfo.h
index c98fa57a..814a314b 100644
--- a/sysdeps/x86/dl-cacheinfo.h
+++ b/sysdeps/x86/dl-cacheinfo.h
@@ -271,6 +271,10 @@ handle_intel (int name, const struct cpu_features
*cpu_features)
       unsigned int edx;
       __cpuid (2, eax, ebx, ecx, edx);

+      if (eax == 0 && ebx == 0 && ecx == 0 && edx == 0)
+       /* Redirect to other information source for Intel TDX.  */
+       eax = 0xff;
+
       /* The low byte of EAX in the first round contain the number of
         rounds we have to make.  At least one, the one we are already
         doing.  */

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  reply	other threads:[~2023-07-17  8:46 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-17  7:29 [Bug libc/30643] New: " fweimer at redhat dot com
2023-07-17  8:46 ` fweimer at redhat dot com [this message]
2023-07-17 13:49 ` [Bug libc/30643] " decui at microsoft dot com
2023-07-18  8:41 ` fweimer at redhat dot com
2023-07-18  8:42 ` fweimer at redhat dot com
2023-07-20 22:33 ` hjl.tools at gmail dot com
2023-08-25 16:20 ` hjl.tools at gmail dot com
2023-08-28  5:20 ` fweimer at redhat dot com
2023-08-28 17:05 ` decui at microsoft dot com
2023-08-28 17:46 ` hjl.tools at gmail dot com
2023-08-28 18:24 ` decui at microsoft dot com
2023-08-28 18:29 ` decui at microsoft dot com
2023-08-28 18:33 ` fweimer at redhat dot com
2023-08-28 18:48 ` decui at microsoft dot com
2023-08-28 19:00 ` fweimer at redhat dot com
2023-08-28 19:04 ` hjl.tools at gmail dot com
2023-08-29 19:58 ` cvs-commit at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-30643-131-ZUKSVaUrkw@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).