Root Has Segfault Executing RDMSR Assembly Code
问题 I would like to read msr 0x19a (IA32_CLOCK_MODULATIOn) directly from C code WITH root privilege. However, I get the following segfault error. a.out[27843] general protection ip:40053b sp:7fffefc38020 error:0 in a.out[400000+1000] Does anyone know whether this way of calling rdmsr is a viable option? Thanks in advance! #include <stdio.h> #define __init typedef unsigned uint32_t; static int __init test3_init(void) { uint32_t hi,lo; hi=0x0; lo=0x0; asm volatile("mov $0x19a,%ecx"); asm volatile(