MSR (Model-Specific Registers) are registers inside the CPU that provide direct access to advanced CPU features.
Questions tagged [msr]
73 questions
3
votes
1 answer
IA32 vs MSR prefix for x86 MSR names
Intel sometimes uses the MSR_ prefix for MSR names, and sometimes IA32_, even for the same MSR.
For example, on SNB, in SDM Volume 4, they document both IA32_PERF_STATUS and MSR_PERF_STATUS for MSR 0x198 with somewhat different (but not exactly…

BeeOnRope
- 60,350
- 16
- 207
- 386
3
votes
1 answer
Correctly disable Hardware Prefetching with MSR in Skylake
I am trying to disable hardware prefetching on my machine:
CPU family: 6
Model: 78
Model name: Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz
I have checked with: gcc -march=native -Q --help=target|grep march - command and…

Ana Khorguani
- 896
- 4
- 18
3
votes
2 answers
Perf Error: The sys_perf_event_open() syscall returned with 22 (Invalid argument) for event (msr/tsc/)
I am using perf to monitor the system for certain events. However, I get the following error and I have no idea where it comes from,as the event is listed in perf list
sudo perf record -e msr/tsc/ -a
Error:
The sys_perf_event_open() syscall returned…

assembly_question
- 39
- 1
- 3
3
votes
2 answers
Precise measurements of maximum cycle count with RDTSC
I'm developing low level routines for binary search in C and x64 assembly, and trying to measure the exact execution time for searches of uncached arrays (data in RAM). Searching the same array for different targets takes widely varying amounts of…

Nathan Kurz
- 1,649
- 1
- 14
- 28
3
votes
1 answer
How to execute a piece of kernel code on all CPUs?
I'm trying to make a kernel module to enable FOP compatibility mode for x87 FPU. This is done via setting bit 2 in IA32_MISC_ENABLE MSR. Here's the code:
#include
#include
#include
#include…

Ruslan
- 18,162
- 8
- 67
- 136
3
votes
1 answer
How to measure energy consumption of a process in linux without any external hardware meter?
I had tried googling for it and had found MSR_PKG_ENERGY_STATUS under RAPL but unfortunately it has support for only newer processors like Sandy Bridge, Ivy Bridge etc. Is there any other way to get it in older processors?
This is my processor :…

Saravanan Setty
- 408
- 5
- 20
2
votes
2 answers
MSR vs MMIO/PCIe configuration space
Intel sometimes uses MSRs and sometimes "internal" PCIe devices to expose configuration options to the OS. I could not find any ressources which describe the advantages/reasons for using PCIe devices over MSRs. Since the MSR space is 2^32 there…

Benedict Schlüter
- 329
- 4
- 16
2
votes
0 answers
wrmsr instruction causing triple fault in bootloader while trying to enable paging?
I am working on an OS and am trying to transition into long mode in order to execute 64-bit Rust code in an x86_64 environment.
boot.asm:
;;;;;;;;;;;;;;;;;;;;;;;;;
; STAGE ONE / BOOT SECTOR
;;;;;;;;;;;;;;;;;;;;;;;;;
[ORG 0x7c00] ; this doesn't work…

TheTetrisDude
- 21
- 4
2
votes
0 answers
Reading CPU temperature with assembly
Hi i was wondering how could i read the CPU's temperature. I tried putting 0x19C in the ECX register and then calling rdmsr (to get IA32_THERM_STATUS) but the destination registries (EDX:EAX) are empty. I am using Pure64 operating system.

NICOLAS FRANCO RAMPOLDI
- 125
- 1
- 5
2
votes
0 answers
value of PMC (Performance Monitoring Counter) for L3 cache-misses is too high
I'm searching a way to estimate the number of L3 cache-misses by using 'IA32_PERFEVTSELx' and 'IA32_PMCx' MSR pair on my Linux PC with Intel CPU (Intel i7 6700 skylake).
To do that, I installed a timer in the kernel and it reported the value of a…

nickeys
- 137
- 2
- 10
2
votes
1 answer
How to check msr.le at runtime using built-ins?
This question came up in a Power8 in-core crypto patch. The patch provides AES using Power8 built-ins. When loading a VSX register we need to perform a 128-bit endian reversal when running on a little-endian machine to ensure the VSX register loads…

jww
- 97,681
- 90
- 411
- 885
2
votes
0 answers
Intel PMU: Setting overflow flags in IA32_PERF_GLOBAL_STATUS register
I need to set an overflow flag (e.g. bit #33) in IA32_PERF_GLOBAL_STATUS MSR, which is read-only.
On Skylake (which supports architectural performance monitoring version 4) it's easy, because there is IA32_PERF_GLOBAL_STATUS_SET MSR available for…

Ilya Verbin
- 647
- 5
- 20
2
votes
0 answers
how to enable linux perf tool's branch sampling
I use linux perf tool to collect branch info of programs, and the command and result is as follow:
$ sudo perf record -b /bin/ls
Error:
No hardware sampling interrupt available.
No APIC? If so then you can boot the kernel with the "lapic" boot…

e_ahrea
- 31
- 5
2
votes
2 answers
How do I write x86 Debug registers from user space on OSX?
I'd like to play around with the debug MSRs defined in the x86 spec (DR0-7) from my OSX user-space program. Unfortunately, these require CPL == 0 (aka ring 0). I've thumbed through the OSX syscalls and with the exception of kernel_debug nothing…

nall
- 15,899
- 4
- 61
- 65
2
votes
0 answers
Write/Read AMD geode LX800 CPU EEPROM
I have read in AMD geode LX800 CPU datasheet (http://goo.gl/fUl5RM) that this CPU have in Security Block an internal EEPROM that can be used to store user data.
I can read and write MSR registers using linux, but i dont now how to access eeprom…

frico
- 101
- 3