gvisor/pkg/cpuid
Michael Pratt 252f877f3d 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] 424640864c/src/core/cpuid.d (L533-L534)

PiperOrigin-RevId: 242046629
Change-Id: Ic0f0a5f974b20f71391cb85645bdcd4003e5fe88
2019-04-04 18:01:56 -07:00
..
BUILD Remove license comments 2019-01-31 11:12:53 -08:00
cpu_amd64.s Use correct company name in copyright header 2018-10-19 16:35:11 -07:00
cpuid.go Set fixed field in CPUID function 2 2019-04-04 18:01:56 -07:00
cpuid_parse_test.go Automated rollback of changelist 234892473 2019-03-26 17:27:48 -07:00
cpuid_test.go Add AMD-specific features to cpuid package 2018-10-26 16:55:39 -07:00