0

I was working on msr registers to manipulate processor frequency to save power to one of our research project for HPC Systems. I have done following:

[root@test/msr-tools-master]# ./rdmsr 410 -0
0000000000000000

We want to modify using msr-tools-master code provided by Intel on Github. We done the following:

[root@test/msr-tools-master]# ./wrmsr 410 -p 0 0x0000000000000012
wrmsr: pwrite: Operation not permitted

We have Operating System as:

Centos 7 (x86_64)
Kernel : 3.10.0-514.21.1.el7.x86_64

Processor Details:

processor   : 0
vendor_id   : GenuineIntel
cpu family  : 6
model       : 78
model name  : Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz
stepping    : 3
microcode   : 0x9e
cpu MHz     : 400.000
cache size  : 4096 KB
physical id : 0
siblings    : 4
core id     : 0
cpu cores   : 2
apicid      : 0
initial apicid  : 0
fpu     : yes
fpu_exception   : yes
cpuid level : 22
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch ida arat epb pln pts dtherm hwp hwp_noitfy hwp_act_window hwp_epp intel_pt tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx rdseed adx smap clflushopt xsaveopt xsavec xgetbv1
bogomips    : 5184.00
clflush size    : 64
cache_alignment : 64
address sizes   : 39 bits physical, 48 bits virtual
power management:

We have tried following debugging with no luck:

modprobe msr;
setcap CAP_SYS_RAWIO=ep wrmsr 

These are the file premissions:

crw-------. 1 root root 202, 0 Jun  5 09:11 /dev/cpu/0/msr
-rwxr-xr-x. 1 root root 13776 Jun  2 11:16 wrmsr

Now we are stuck. Any help is highly appreciated.

Thanks.

Amarjeet Sharma
  • 168
  • 1
  • 11
  • 1
    have you ever solved this? thx – NSGaga-mostly-inactive Jan 17 '19 at 12:20
  • *manipulate processor frequency to save power* - you might want `grep . /sys/devices/system/cpu/cpufreq/policy[0-9]*/energy_performance_preference` and `sudo sh -c 'for i in /sys/devices/system/cpu/cpufreq/policy[0-9]*/energy_performance_preference;do echo balance_performance > "$i";done'` instead of manually writing MSRs. Or https://patchwork.kernel.org/project/linux-pm/patch/20200623051233.1419218-2-srinivas.pandruvada@linux.intel.com/ for more fine-grained tweaking apparently via `/sys/devices/system/cpu/cpu*/power/energy_perf_bias` – Peter Cordes Jun 08 '21 at 02:15

1 Answers1

0

try disabling SecureBoot in bios

Tomot
  • 386
  • 3
  • 5
  • Is there any other way to do this? I have Secure Boot on, the MSR module is signed and loaded, but I still get the permission error. One answer [here](https://stackoverflow.com/questions/18661976/reading-dev-cpu-msr-from-userspace-operation-not-permitted?rq=1) suggest setting permissions for the excutable, but that didn't work for me. – Bim Mar 07 '19 at 10:12