ajaiantilal/i7z

i7z works incorrectly if UEFI Secure Boot enabled

okudayukiko opened this issue · 6 comments

My PC:HP notebook,Core i5-1035G1 CPU.
Ubuntu 19.10/Debian 10.0(UEFI Secure Boot enabled):Execute "sudo i7z",it prompt:
WAIT ...
True Frequency (without accounting Turbo) 1190 MHz
wrmsr:pwrite:Operation not permitted
Quitting i7z

Linux(UEFI Secure Boot disabled):i7z works correctly.

Hi,
do you solve this?

Is there no other way around it, e.g. patching something minor in the i7z code? Why do you have to write to read CPU frequency, actually?

KastB commented

Probably there is nothing easier than this:
https://github.com/KastB/msr_no_lockdown

Is there no other way around it, e.g. patching something minor in the i7z code?
Why do you have to write to read CPU frequency, actually?

It configures the performance counters, writing to IA32_PERF_GLOBAL_CTRL and IA32_FIXED_CTR_CTL - the former is probably a no-op but the latter is needed. I haven't quite figured out how it gets the values as the code is a bit convoluted to say the least but it definitely doesn't work if it can't write to IA32_FIXED_CTR_CTL

The code is all a bit of a mess anyway, no CPU newer than about 2015 is correctly detected and I suspect coverage before that is not 100%, it doesn't understand CPUs with more than 6 cores for reporting max turbo boost multipliers, there's loads of dead code just left but commented out. Needs a thorough clean up.

I have faced the problem when I disabled vmd on my Asus laptop.
it was working fine while vmd was active
(I've changed vmd status in Bios)