py-cpuinfo
py-cpuinfo copied to clipboard
Read CPU flags related to Spectre and Meltdown Vulnerabilities
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
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?