From b8ef7b72e54c1620fb631a92d4d503330b51a955 Mon Sep 17 00:00:00 2001 From: tSte Date: Tue, 6 Nov 2018 07:11:37 +0100 Subject: [PATCH] Update MSR access debug message; Update readme --- README.md | 3 ++- lenovo_fix.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ba4359c..eae5b7c 100644 --- a/README.md +++ b/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. diff --git a/lenovo_fix.py b/lenovo_fix.py index 96f5de7..4abf759 100755 --- a/lenovo_fix.py +++ b/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