Intel® ISA Extensions
Use hardware-based isolation and memory encryption to provide more code protection in your solutions.
1120 Discussions

Enabling Mon feature using IA32_MISC_ENABLES

K___Sina
Beginner
798 Views

Hi everyone,

During the past few days, I was reading Intel Manual about Monitor/Mwait instructions and as I understand this feature can be disabled and re-enabled by using IA32_MISC_ENABLES MSR.

I have the exact problem in my MacBook Pro as described in this topic.

The problem is Mon Feature is disabled when I check it in Windows but it is enabled when checking it in OS x. (In a dual boot system, not a virtual machine)

I check this by using MacCPUID (EAX=01H,ECX=0):ECX[3] which is enabled in OS X and using Gnu Win32 CPUID which says this feature is not enabled so it seems something like my OS turned off this feature.

I also check this by using the following assembly in Windows : 

0:  48 31 c0                xor    rax,rax
3:  48 c7 c0 01 00 00 00    mov    rax,0x1
a:  0f a2                   cpuid

Then figured out that 3rd bit of ECX is zero so mon is disabled.

In the above topic, one of the answers suggests that enable this feature by changing MSR in this way :

0:  b9 a0 01 00 00          mov    ecx,0x1a0
5:  0f 32                   rdmsr
7:  83 e2 04                and    edx,0x4
a:  25 89 18 c5 00          and    eax,0xc51889
f:  0d 00 00 04 00          or     eax,0x40000
14: 0f 30                   wrmsr

So I run the above code in an x64 Windows driver and test the 3rd bit of ECX by running CPUID with EAX=1H again, and see that the 3rd bit is still zero. 

I'm using a i7-6820HQ which is a Skylake - 6th Generation Intel Core.

So my questions are :

  • Is it correct to enable Mon feature by using the above code?
  • Or even is it possible to enable this feature when OS is already loaded and CPU is in protected mode?
0 Kudos
0 Replies
Reply