Simon Glass | 18c2ccc | 2024-08-27 19:44:29 -0600 | [diff] [blame] | 1 | .. SPDX-License-Identifier: GPL-2.0+ |
| 2 | |
| 3 | .. index:: |
| 4 | single: msr (command) |
| 5 | |
| 6 | msr command |
| 7 | =========== |
| 8 | |
| 9 | Synopsis |
| 10 | -------- |
| 11 | |
| 12 | :: |
| 13 | |
| 14 | msr read <op> |
| 15 | msr write <op> <hi> <lo> |
| 16 | |
| 17 | Description |
| 18 | ----------- |
| 19 | |
| 20 | The msr command reads and writes machine-status registers (MSRs) on x86 CPUs. |
| 21 | The information is a 64-bit value split into two parts, <hi> for the top 32 |
| 22 | bits and <lo> for the bottom 32 bits. |
| 23 | |
| 24 | The operation <op> selects what information is read or written. |
| 25 | |
| 26 | msr read |
| 27 | ~~~~~~~~ |
| 28 | |
| 29 | This reads an MSR and displays the value obtained. |
| 30 | |
| 31 | msr write |
| 32 | ~~~~~~~~~ |
| 33 | |
| 34 | This writes a value to an MSR. |
| 35 | |
| 36 | Configuration |
| 37 | ------------- |
| 38 | |
| 39 | The msr command is only available on x86. |
| 40 | |
| 41 | Return value |
| 42 | ------------ |
| 43 | |
| 44 | The return value $? is 0 (true). |
| 45 | |
| 46 | Example |
| 47 | ------- |
| 48 | |
| 49 | This 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 | |
| 54 | This 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 |