Skip to content

Commit

Permalink
Detect Control-flow Enforcement Technology (CET) bits (#93)
Browse files Browse the repository at this point in the history
Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
  • Loading branch information
mythi committed Feb 7, 2022
1 parent eb76847 commit 1a69123
Show file tree
Hide file tree
Showing 2 changed files with 108 additions and 102 deletions.
4 changes: 4 additions & 0 deletions cpuid.go
Expand Up @@ -95,6 +95,8 @@ const (
AVXSLOW // Indicates the CPU performs 2 128 bit operations instead of one.
BMI1 // Bit Manipulation Instruction Set 1
BMI2 // Bit Manipulation Instruction Set 2
CETIBT // Intel CET Indirect Branch Tracking
CETSS // Intel CET Shadow Stack
CLDEMOTE // Cache Line Demote
CLMUL // Carry-less Multiplication
CLZERO // CLZERO instruction supported
Expand Down Expand Up @@ -993,6 +995,7 @@ func support() flagSet {
fs.setIf(ebx&(1<<29) != 0, SHA)
// CPUID.(EAX=7, ECX=0).ECX
fs.setIf(ecx&(1<<5) != 0, WAITPKG)
fs.setIf(ecx&(1<<7) != 0, CETSS)
fs.setIf(ecx&(1<<25) != 0, CLDEMOTE)
fs.setIf(ecx&(1<<27) != 0, MOVDIRI)
fs.setIf(ecx&(1<<28) != 0, MOVDIR64B)
Expand All @@ -1002,6 +1005,7 @@ func support() flagSet {
fs.setIf(edx&(1<<11) != 0, RTM_ALWAYS_ABORT)
fs.setIf(edx&(1<<14) != 0, SERIALIZE)
fs.setIf(edx&(1<<16) != 0, TSXLDTRK)
fs.setIf(edx&(1<<20) != 0, CETIBT)
fs.setIf(edx&(1<<26) != 0, IBPB)
fs.setIf(edx&(1<<27) != 0, STIBP)

Expand Down
206 changes: 104 additions & 102 deletions featureid_string.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1a69123

Please sign in to comment.