mtrr.rst 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. .. SPDX-License-Identifier: GPL-2.0+:
  2. mtrr command
  3. ============
  4. Synopis
  5. -------
  6. mtrr [list]
  7. mtrr set <reg> <type> <start> <size>
  8. mtrr disable <reg>
  9. mtrr enable
  10. Description
  11. -----------
  12. The *mtrr* command is used to dump the Memory Type Range Registers (MTRRs) on
  13. an x86 machine. These register control cache behaviour in selected memory
  14. ranges.
  15. Note that the number of registers can vary between CPUs.
  16. mtrr [list]
  17. ~~~~~~~~~~~
  18. List the MTRRs. The table shows the following information:
  19. Reg
  20. Register number (the first is register 0)
  21. Valid
  22. Shows Y if the register is valid (has bit 11 set), N if not
  23. Write-type
  24. Shows the behaviour when writing to the memory region. The types are
  25. abbreviated to fit a reasonable line length. Valid types shown below.
  26. ====== ============== ====================================================
  27. Value Type Meaning
  28. ====== ============== ====================================================
  29. 0 Uncacheable Skip cache and write directly to memory
  30. 1 Combine Multiple writes can be combined into one transaction
  31. 4 Through Update cache and also write to memory
  32. 5 Protect Writes are prohibited
  33. 6 Back Update cache but don't write to memory
  34. ====== ============== ====================================================
  35. Base
  36. Base memory address from which the register controls behaviour
  37. Mask
  38. Mask value, which also indicates the size
  39. Size
  40. Length of memory region within which the register controls behaviour
  41. mtrr set
  42. ~~~~~~~~
  43. This sets the value of a particular MTRR. Parameters are:
  44. reg
  45. Register number to set, with 0 being the first
  46. type
  47. Access type to set. See Write-type above for valid types. This uses the name
  48. rather than its numeric value.
  49. start
  50. Base memory address from which the register should control behaviour
  51. size
  52. Length of memory region within which the register controls behaviour
  53. mtrr disable
  54. ~~~~~~~~~~~~
  55. This disables a particular register, by clearing its `valid` bit (11).
  56. mtrr enable
  57. ~~~~~~~~~~~
  58. This enables a particular register, by setting its `valid` bit (11).
  59. Example
  60. -------
  61. This shows disabling and enabling an MTRR, as well as setting its type::
  62. => mtrr
  63. CPU 0:
  64. Reg Valid Write-type Base || Mask || Size ||
  65. 0 Y Back 0000000000000000 0000000f80000000 0000000080000000
  66. 1 Y Back 0000000080000000 0000000fe0000000 0000000020000000
  67. 2 Y Back 00000000a0000000 0000000ff0000000 0000000010000000
  68. 3 Y Uncacheable 00000000ad000000 0000000fff000000 0000000001000000
  69. 4 Y Uncacheable 00000000ae000000 0000000ffe000000 0000000002000000
  70. 5 Y Combine 00000000d0000000 0000000ff0000000 0000000010000000
  71. 6 N Uncacheable 0000000000000000 0000000000000000 0000001000000000
  72. 7 N Uncacheable 0000000000000000 0000000000000000 0000001000000000
  73. 8 N Uncacheable 0000000000000000 0000000000000000 0000001000000000
  74. 9 N Uncacheable 0000000000000000 0000000000000000 0000001000000000
  75. => mtrr d 5
  76. => mtrr
  77. CPU 0:
  78. Reg Valid Write-type Base || Mask || Size ||
  79. 0 Y Back 0000000000000000 0000000f80000000 0000000080000000
  80. 1 Y Back 0000000080000000 0000000fe0000000 0000000020000000
  81. 2 Y Back 00000000a0000000 0000000ff0000000 0000000010000000
  82. 3 Y Uncacheable 00000000ad000000 0000000fff000000 0000000001000000
  83. 4 Y Uncacheable 00000000ae000000 0000000ffe000000 0000000002000000
  84. 5 N Combine 00000000d0000000 0000000ff0000000 0000000010000000
  85. 6 N Uncacheable 0000000000000000 0000000000000000 0000001000000000
  86. 7 N Uncacheable 0000000000000000 0000000000000000 0000001000000000
  87. 8 N Uncacheable 0000000000000000 0000000000000000 0000001000000000
  88. 9 N Uncacheable 0000000000000000 0000000000000000 0000001000000000
  89. => mtrr e 5
  90. => mtrr
  91. CPU 0:
  92. Reg Valid Write-type Base || Mask || Size ||
  93. 0 Y Back 0000000000000000 0000000f80000000 0000000080000000
  94. 1 Y Back 0000000080000000 0000000fe0000000 0000000020000000
  95. 2 Y Back 00000000a0000000 0000000ff0000000 0000000010000000
  96. 3 Y Uncacheable 00000000ad000000 0000000fff000000 0000000001000000
  97. 4 Y Uncacheable 00000000ae000000 0000000ffe000000 0000000002000000
  98. 5 Y Combine 00000000d0000000 0000000ff0000000 0000000010000000
  99. 6 N Uncacheable 0000000000000000 0000000000000000 0000001000000000
  100. 7 N Uncacheable 0000000000000000 0000000000000000 0000001000000000
  101. 8 N Uncacheable 0000000000000000 0000000000000000 0000001000000000
  102. 9 N Uncacheable 0000000000000000 0000000000000000 0000001000000000
  103. => mtrr set 5 Uncacheable d0000000 10000000
  104. => mtrr
  105. CPU 0:
  106. Reg Valid Write-type Base || Mask || Size ||
  107. 0 Y Back 0000000000000000 0000000f80000000 0000000080000000
  108. 1 Y Back 0000000080000000 0000000fe0000000 0000000020000000
  109. 2 Y Back 00000000a0000000 0000000ff0000000 0000000010000000
  110. 3 Y Uncacheable 00000000ad000000 0000000fff000000 0000000001000000
  111. 4 Y Uncacheable 00000000ae000000 0000000ffe000000 0000000002000000
  112. 5 Y Uncacheable 00000000d0000000 0000000ff0000000 0000000010000000
  113. 6 N Uncacheable 0000000000000000 0000000000000000 0000001000000000
  114. 7 N Uncacheable 0000000000000000 0000000000000000 0000001000000000
  115. 8 N Uncacheable 0000000000000000 0000000000000000 0000001000000000
  116. 9 N Uncacheable 0000000000000000 0000000000000000 0000001000000000
  117. =>