py-cpuinfo icon indicating copy to clipboard operation
py-cpuinfo copied to clipboard

Read CPU flags related to Spectre and Meltdown Vulnerabilities

Open ale5000-git opened this issue 7 years ago • 1 comments

Hi, is it possible to read CPU flags related to Spectre and Meltdown vulnerabilities?

These ones:

spec_ctrl
spec_ctrl_ibrs
pti
kaiser
pcid
invpcid

ale5000-git avatar Feb 08 '18 13:02 ale5000-git

Maybe. It may just happen to work with the current way it reads flags:

On Linux, it is doing:

cat /proc/cpuinfo | grep flags

On OSX it is using sysctl and reading machdep.cpu.features, machdep.cpu.leaf7_features, and machdep.cpu.extfeatures fields:

sysctl machdep.cpu hw.cpufrequency

I don't think it will work on Windows, as I don't have an affected Windows machine to test it on. And I'm not sure how to read the new cpu flags. Anybody want to help with this?

workhorsy avatar Feb 09 '18 00:02 workhorsy