diff options
author | Michael Pratt <mpratt@google.com> | 2018-10-26 14:25:26 -0700 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2018-10-26 14:26:25 -0700 |
commit | e60525e4ddd9a7fff8b27d0be8119ce3203a2f5c (patch) | |
tree | 136e9dd9d3b9b9981c042eeb22e578664c4c4591 /pkg/cpuid | |
parent | 624cc329d89bff5f2b0e787d255e718514ec585b (diff) |
Add block 3 features to /proc/cpuinfo
Linux added these block 3 features to the end of /proc/cpuinfo in
dfb4a70f20c5b3880da56ee4c9484bdb4e8f1e65.
This also fixes that block 3 features were completely missing from
FeatureSet.FlagsString(false) because FlagsString only prints Linux
blocks regardless of the cpuinfo option.
PiperOrigin-RevId: 218913816
Change-Id: I2f9c38c7c9da4b247a140877d4aca782e80684bd
Diffstat (limited to 'pkg/cpuid')
-rw-r--r-- | pkg/cpuid/cpuid.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/pkg/cpuid/cpuid.go b/pkg/cpuid/cpuid.go index 9eec45717..efe9ebe87 100644 --- a/pkg/cpuid/cpuid.go +++ b/pkg/cpuid/cpuid.go @@ -222,7 +222,7 @@ const ( // which doesn't match well here, so for the /proc/cpuinfo generation we simply // re-map the blocks to Linux's ordering and then go through the bits in each // block. -var linuxBlockOrder = []block{1, 6, 0, 5, 2, 4} +var linuxBlockOrder = []block{1, 6, 0, 5, 2, 4, 3} // To make emulation of /proc/cpuinfo easy down the line, these names match the // names of the basic features in Linux defined in @@ -317,6 +317,12 @@ var x86FeatureStrings = map[Feature]string{ X86FeatureAVX512BW: "avx512bw", X86FeatureAVX512VL: "avx512vl", + // Block 3. + X86FeaturePREFETCHWT1: "prefetchwt1", + X86FeatureAVX512VBMI: "avx512vbmi", + X86FeatureUMIP: "umip", + X86FeaturePKU: "pku", + // Block 4. X86FeatureXSAVEOPT: "xsaveopt", X86FeatureXSAVEC: "xsavec", @@ -348,12 +354,6 @@ var x86FeatureParseOnlyStrings = map[Feature]string{ X86FeatureIPT: "pt", X86FeatureCLFLUSHOPT: "clfushopt", - // Block 3. - X86FeaturePREFETCHWT1: "prefetchwt1", - X86FeatureAVX512VBMI: "avx512vbmi", - X86FeatureUMIP: "umip", - X86FeaturePKU: "pku", - // Block 4. X86FeatureXSAVES: "xsaves", } |