Browse Source

Update MSR access debug message; Update readme

tSte 6 years ago
parent
commit
b8ef7b72e5
2 changed files with 3 additions and 2 deletions
  1. 2 1
      README.md
  2. 1 1
      lenovo_fix.py

+ 2 - 1
README.md

@@ -33,8 +33,9 @@ On a lot of modern CPUs from Intel one can configure the TDP up or down based on
 ## Requirements
 A stripped down version of the python module `python-periphery` is now built-in and it is used for accessing the MCHBAR register by memory mapped I/O. You also need `dbus` and `gobject` python bindings for listening to dbus signals on resume from sleep/hibernate.
 
-### Secure Boot
+### Writing to MSR and PCI BAR
 Right now it is mandatory to **disable Secure Boot** (in BIOS) in order to avoid [Kernel Lockdown](https://lwn.net/Articles/706637/). In particular Lockdown restricts access to MSR and PCI BAR (via /dev/mem) which are required by this script.
+Note that some kernels (e.g. [linux-hardened](https://www.archlinux.org/packages/extra/x86_64/linux-hardened/)) will prevent from writing to `/dev/mem` too.
 
 ### Thermald
 As discovered by *DEvil0000* the Linux Thermal Monitor ([thermald](https://github.com/intel/thermal_daemon)) can conflict with the purpose of this script. In particular, thermald might be pre-installed (e.g. on Ubuntu) and configured in such a way to keep the CPU temperature below a certain threshold (~80 'C) by applying throtthling or messing up with RAPL or other CPU-specific registers. I strongly suggest to either disable/uninstall it or to review its default configuration.

+ 1 - 1
lenovo_fix.py

@@ -93,7 +93,7 @@ def writemsr(msr, val):
             os.close(f)
     except (IOError, OSError) as e:
         if e.errno == EPERM or e.errno == EACCES:
-            print('[E] Unable to write to MSR. Try to disable Secure Boot.')
+            print('[E] Unable to write to MSR. Try to disable Secure Boot and check if your kernel does not restrict access to MSR.')
             sys.exit(1)
         else:
             raise e