valderama

monitor/mwait in user-mode

Discussion created by valderama on Dec 21, 2009
Latest reply on Jan 7, 2010 by sigmainfotech

Hi,

According to the AMD specs, it seems that monitor/mwait can be used in CPL bigger than 0. Nevertheless, all my trials on two different machines, one running windows, and the other LINUX ended with illegal instruction failure.

The spec do state that the MSR C001_0015h[MonMwaitUserEn] must be set to 1.

I have no idea what either LINUX or Windows do with this MSR. Anyone has better experience with playing with monitor/mwait in user-mode in any OS (Windows?LINUX?FreeBSD?)

Those instructions can be highly beneficial in special cases when you can spare the hardware thread for waiting, but want it to wake up very fast when the occassion arrives.

 

Cheers!!

Outcomes