summaryrefslogtreecommitdiff
path: root/doc/usage
diff options
context:
space:
mode:
authorSimon Glass <[email protected]>2024-08-27 19:44:29 -0600
committerSimon Glass <[email protected]>2024-10-18 14:10:21 -0600
commitc4e582654a94fc085196464ebe409ce7f89739f6 (patch)
treec5b4f57fe4c820d1abad1eb2dce1aa840ee835f0 /doc/usage
parent557767f80294054932c7453be0e268ad39643fdc (diff)
x86: Add msr command
It is useful to obtain the results of MSR queries as well as to update MSR registers, so add a command these tasks. Signed-off-by: Simon Glass <[email protected]>
Diffstat (limited to 'doc/usage')
-rw-r--r--doc/usage/cmd/msr.rst61
-rw-r--r--doc/usage/index.rst1
2 files changed, 62 insertions, 0 deletions
diff --git a/doc/usage/cmd/msr.rst b/doc/usage/cmd/msr.rst
new file mode 100644
index 00000000000..04ee52cc1c7
--- /dev/null
+++ b/doc/usage/cmd/msr.rst
@@ -0,0 +1,61 @@
+.. SPDX-License-Identifier: GPL-2.0+
+
+.. index::
+ single: msr (command)
+
+msr command
+===========
+
+Synopsis
+--------
+
+::
+
+ msr read <op>
+ msr write <op> <hi> <lo>
+
+Description
+-----------
+
+The msr command reads and writes machine-status registers (MSRs) on x86 CPUs.
+The information is a 64-bit value split into two parts, <hi> for the top 32
+bits and <lo> for the bottom 32 bits.
+
+The operation <op> selects what information is read or written.
+
+msr read
+~~~~~~~~
+
+This reads an MSR and displays the value obtained.
+
+msr write
+~~~~~~~~~
+
+This writes a value to an MSR.
+
+Configuration
+-------------
+
+The msr command is only available on x86.
+
+Return value
+------------
+
+The return value $? is 0 (true).
+
+Example
+-------
+
+This shows reading msr 0x194 which is MSR_FLEX_RATIO on Intel CPUs::
+
+ => msr read 194
+ 00000000 00011200 # Bits 16 (flex ratio enable) and 20 (lock) are set
+
+This shows adjusting the energy-performance bias on an Intel CPU::
+
+ => msr read 1b0
+ 00000000 00000006 # 6 means 'normal'
+
+ => msr write 1b0 0 f # change to power-save
+ => msr read 1b0
+ 00000000 0000000f
diff --git a/doc/usage/index.rst b/doc/usage/index.rst
index d2b187b0118..b84d8ee909f 100644
--- a/doc/usage/index.rst
+++ b/doc/usage/index.rst
@@ -87,6 +87,7 @@ Shell commands
cmd/mbr
cmd/md
cmd/mmc
+ cmd/msr
cmd/mtest
cmd/mtrr
cmd/panic