Intel® Moderncode for Parallel Architectures
Support for developing parallel programming applications on Intel® Architecture.
The Intel sign-in experience has changed to support enhanced security controls. If you sign in, click here for more information.

How to get/set unique MSR registers for each core


I knew that MSR registers (for example, IA32_CLOCK_MODULATION and IA32_THERM_STATUS) can be set and get throughRDMSR and WRMSR instruction. However, I would like to know how to set and get for 'each core' of dual core processor. Can anyone kindly tell me?

Besides, how to enter privilege level 0 by some instruction?

P.S.I am using QNX operating system, only assembly instruction can be used.

0 Kudos
2 Replies
Valued Contributor I
You cannot enter ring 0 with any particular instruction under any modern operating system because that is considered security risk and the kernel does not allow your process to execute such instructions. However, you can write a device driver or use already existing driver from within your application to perform privileged operations such as access to MSR registers. In order to access unique MSR registers your application needs to change its process/thread affinity for each CPU whose MSR you want to read/write. Under Windows that is accomplished by calling SetThreadAffinityMask() API but for QNX you will have to consult proper OS API documentation or ask someone else.
Hi, now I also would like to control the unique MSRs for each core. According to this post, ifone application which is running on "core 0" sets the uniqueMSR registers, then it istheunique MSRs of "core 0"be set. Inother words,one application running on one core can't set the unique MSRs on the other core?Is my understanding right?