From e60525e4ddd9a7fff8b27d0be8119ce3203a2f5c Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Fri, 26 Oct 2018 14:25:26 -0700 Subject: 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 --- pkg/cpuid/cpuid.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'pkg/cpuid') 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", } -- cgit v1.2.3