Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
#include <linux/module.h>
static inline uint64_t exec_rdmsr(uint64_t msr)
uint32_t low, high;
asm volatile (
: "=a"(low), "=d"(high)
: "c"(msr)
return ((uint64_t)high << 32) | low;
static int mymodule_init(void)
uint64_t res = exec_rdmsr(0xc0000082U);
printk(KERN_INFO "MOLY: MSR_IA32_LSTAR: %llx\n", res);
return 0;
static void mymodule_exit(void)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment