Intel® Moderncode for Parallel Architectures
Support for developing parallel programming applications on Intel® Architecture.
Announcements
Intel Customer Support will be observing the Martin Luther King holiday on Monday, Jan. 17, and will return on Tues. Jan. 18.
For the latest information on Intel’s response to the Log4j/Log4Shell vulnerability, please see Intel-SA-00646

How to get/set unique MSR registers for each core

tsunghsunwu
Beginner
252 Views

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
ILevi1
Valued Contributor I
252 Views
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.
zhangyihere
Beginner
252 Views
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?
Reply