I can read / write the MSR register, but I do not know how to indicate which main MSR should be started.
For example, I want to write the gaps of the private L2 cache for each core, respectively, so I need to specify the kernel ID for each core.
I know smp_call_function () to call code on all cores. If I add an insn that writes the kernel ID, this code runs and uses smp_call_function (), it should work. But if I just want to learn about the 1st personal cache memory of kernel 1, I will have to leave all the kernels, writing down a number that does not match me.
Is there a better solution for this?
My codes for the MSR read / write operation are:
mov $0x0001010E, %eax
xor %edx, %edx
mov $0x187, %ecx
wrmsr
mov $0xc2, %ecx
rdmsr