blob: 04ee52cc1c75da5ecce986627cd3178e8c4604b6 [file] [log] [blame]
Simon Glass18c2ccc2024-08-27 19:44:29 -06001.. SPDX-License-Identifier: GPL-2.0+
2
3.. index::
4 single: msr (command)
5
6msr command
7===========
8
9Synopsis
10--------
11
12::
13
14 msr read <op>
15 msr write <op> <hi> <lo>
16
17Description
18-----------
19
20The msr command reads and writes machine-status registers (MSRs) on x86 CPUs.
21The information is a 64-bit value split into two parts, <hi> for the top 32
22bits and <lo> for the bottom 32 bits.
23
24The operation <op> selects what information is read or written.
25
26msr read
27~~~~~~~~
28
29This reads an MSR and displays the value obtained.
30
31msr write
32~~~~~~~~~
33
34This writes a value to an MSR.
35
36Configuration
37-------------
38
39The msr command is only available on x86.
40
41Return value
42------------
43
44The return value $? is 0 (true).
45
46Example
47-------
48
49This shows reading msr 0x194 which is MSR_FLEX_RATIO on Intel CPUs::
50
51 => msr read 194
52 00000000 00011200 # Bits 16 (flex ratio enable) and 20 (lock) are set
53
54This shows adjusting the energy-performance bias on an Intel CPU::
55
56 => msr read 1b0
57 00000000 00000006 # 6 means 'normal'
58
59 => msr write 1b0 0 f # change to power-save
60 => msr read 1b0
61 00000000 0000000f