Execute RDMSR and WRMSR instructions from C/C++ code

前端 未结 1 1874
小蘑菇
小蘑菇 2020-12-05 22:17

I need to control C-State configuration. Specifically, I\'d probably like to execute the following asm code:

__asm
{
    rdmsr
    and eax, 0x00
    or eax,          


        
相关标签:
1条回答
  • 2020-12-05 22:43

    Chances are, you are running this code on an x86 processor within Ring 3. You do not have the privileges to execute this command. Period. This is a hardware limitation. The only way to execute that instruction is to go into Ring 0 and chances are, your OS won't let you do that. You will need to write a kernel-mode driver to accomplish this.

    Edit: http://faydoc.tripod.com/cpu/rdmsr.htm has more info.

    0 讨论(0)
提交回复
热议问题