summaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
authorMichael Pratt <mpratt@google.com>2019-04-04 18:00:54 -0700
committerShentubot <shentubot@google.com>2019-04-04 18:01:56 -0700
commit252f877f3d0ccc3f1aeb7de0e13d71fb3d4e7284 (patch)
treee01c2e8dd00c8cc260c69ecb6632875ce18d646c /tools
parent88409e983c463b6d9c8085e7fdbe7ff45b3c5184 (diff)
Set fixed field in CPUID function 2
From the SDM: "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." Unfortunately, online docs [1] [2] (likely based on an old version of the SDM) say: "The least-significant byte in register EAX (register AL) indicates the number of times the CPUID instruction must be executed with an input value of 2 to get a complete description of the processor's caches and TLBs." dlang uses this second interpretation [3] and will loop 2^32 times if we return zero. Fix this by specifying the fixed value of one. We still don't support exposing the actual cache information, leaving all other bytes empty. A zero byte means: "Null descriptor, this byte contains no information." [1] http://www.sandpile.org/x86/cpuid.htm#level_0000_0002h [2] https://c9x.me/x86/html/file_module_x86_id_45.html [3] https://github.com/dlang/druntime/blob/424640864c2aa001731467e96f637bd3e704e481/src/core/cpuid.d#L533-L534 PiperOrigin-RevId: 242046629 Change-Id: Ic0f0a5f974b20f71391cb85645bdcd4003e5fe88
Diffstat (limited to 'tools')
0 files changed, 0 insertions, 0 deletions