Skip to content

Commit

Permalink
print spec control CPUID info
Browse files Browse the repository at this point in the history
Change-Id: Ib46ee52111b5539155983c2fb92d4457962dd668
  • Loading branch information
rdementi committed Jan 31, 2019
1 parent 4b20d7a commit 28b7767
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cpucounters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,12 @@ bool PCM::detectModel()
return false;
}

pcm_cpuid(7, 0, cpuinfo);

std::cout << "IBRS and IBPB supported : " << ((cpuinfo.reg.edx & (1 << 26)) ? "yes" : "no") << std::endl;
std::cout << "STIBP supported : " << ((cpuinfo.reg.edx & (1 << 27)) ? "yes" : "no") << std::endl;
std::cout << "Spec arch caps supported : " << ((cpuinfo.reg.edx & (1 << 29)) ? "yes" : "no") << std::endl;

return true;
}

Expand Down

0 comments on commit 28b7767

Please sign in to comment.