Skip to content

Commit

Permalink
Update amdctl.c
Browse files Browse the repository at this point in the history
Linux 5.9 and 5.10 started to remove msr support.
Maybe a fopen / fgets / strstr at "Write to unrecognized MSR" would be required on /var/log/kern.log, to detect if the operation was succesfull, or the kernel blocked the call alltogether.
  • Loading branch information
programmingzor authored May 8, 2021
1 parent 3986dc9 commit 2c0062b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions amdctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#pragma GCC diagnostic ignored "-Wwrite-strings"

#define _XOPEN_SOURCE 500
#include <stdio.h>
#include <fcntl.h>
Expand All @@ -23,6 +26,11 @@
#include <string.h>
#include <math.h>

#include <linux/version.h>
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,9,0)
#warning Incompatible kernel! MSR access deprecated by your Linux kernel! To use this program, you must set GRUB_CMDLINE_LINUX="msr.allow_writes=on" kernel parameter in the file /etc/default/grub and run upgrade-grub.
#endif

void printBaseFmt(const int);
int getDec(const char *);
void getReg(const uint32_t);
Expand Down

0 comments on commit 2c0062b

Please sign in to comment.