Marc Jones | 8f21076 | 2009-03-08 04:37:39 +0000 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of msrtool. |
| 3 | * |
| 4 | * Copyright (c) 2009 Marc Jones <marcj303@gmail.com> |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License version 2 as |
| 8 | * published by the Free Software Foundation. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
Marc Jones | 8f21076 | 2009-03-08 04:37:39 +0000 | [diff] [blame] | 14 | */ |
| 15 | |
| 16 | #include "msrtool.h" |
| 17 | |
Anton Kochkov | 59b36f1 | 2012-07-21 07:29:48 +0400 | [diff] [blame] | 18 | int k8_probe(const struct targetdef *target, const struct cpuid_t *id) { |
Kyösti Mälkki | 1edd66c | 2018-05-14 11:19:09 +0300 | [diff] [blame] | 19 | return (VENDOR_AMD == id->vendor) && (0xF == id->family); |
Marc Jones | 8f21076 | 2009-03-08 04:37:39 +0000 | [diff] [blame] | 20 | } |
| 21 | |
| 22 | /* |
| 23 | * AMD BKDG Publication # 32559 Revision: 3.08 Issue Date: July 2007 |
| 24 | */ |
| 25 | const struct msrdef k8_msrs[] = { |
| 26 | { 0xC0000080, MSRTYPE_RDWR, MSR2(0, 0), "EFER Register", "Extended Feature Enable Register", { |
| 27 | { 63, 32, RESERVED }, |
| 28 | { 31, 18, RESERVED }, |
| 29 | { 14, 1, "FFXSR:", "Fast FXSAVE/FRSTOR Enable", PRESENT_DEC, { |
| 30 | { MSR1(0), "FXSAVE/FRSTOR disabled" }, |
| 31 | { MSR1(1), "FXSAVE/FRSTOR enabled" }, |
| 32 | { BITVAL_EOT } |
| 33 | }}, |
| 34 | { 13, 1, "LMSLE:", "Long Mode Segment Limit Enable", PRESENT_DEC, { |
| 35 | { MSR1(0), "Long mode segment limit check disabled" }, |
Uwe Hermann | 708ccac | 2009-04-10 21:05:56 +0000 | [diff] [blame] | 36 | { MSR1(1), "Long mode segment limit check enabled" }, |
Marc Jones | 8f21076 | 2009-03-08 04:37:39 +0000 | [diff] [blame] | 37 | { BITVAL_EOT } |
| 38 | }}, |
| 39 | { 12, 1, "SVME:", "SVM Enable", PRESENT_DEC, { |
| 40 | { MSR1(0), "SVM features disabled" }, |
| 41 | { MSR1(1), "SVM features enabled" }, |
| 42 | { BITVAL_EOT } |
| 43 | }}, |
| 44 | { 11, 1, "NXE:", "No-Execute Page Enable", PRESENT_DEC, { |
| 45 | { MSR1(0), "NXE features disabled" }, |
| 46 | { MSR1(1), "NXE features enabled" }, |
| 47 | { BITVAL_EOT } |
| 48 | }}, |
| 49 | { 10, 1, "LMA:", "Long Mode Active", PRESENT_DEC, { |
| 50 | { MSR1(0), "Long Mode feature not active" }, |
| 51 | { MSR1(1), "Long Mode feature active" }, |
| 52 | { BITVAL_EOT } |
| 53 | }}, |
| 54 | { 9, 1, RESERVED }, |
| 55 | { 8, 1, "LME:", "Long Mode Enable", PRESENT_DEC, { |
| 56 | { MSR1(0), "Long Mode feature disabled" }, |
| 57 | { MSR1(1), "Long Mode feature enabled" }, |
| 58 | { BITVAL_EOT } |
| 59 | }}, |
| 60 | { 7, 7, RESERVED }, |
| 61 | { 0, 1, "SYSCALL:", "System Call Extension Enable", PRESENT_DEC, { |
| 62 | { MSR1(0), "System Call feature disabled" }, |
| 63 | { MSR1(1), "System Call feature enabled" }, |
| 64 | { BITVAL_EOT } |
| 65 | }}, |
| 66 | { BITS_EOT } |
| 67 | }}, |
| 68 | |
| 69 | { 0xC0010010, MSRTYPE_RDWR, MSR2(0, 0), "SYSCFG Register", "This register controls the system configuration", { |
| 70 | { 63, 32, RESERVED }, |
| 71 | { 31, 9, RESERVED }, |
| 72 | { 22, 1, "Tom2ForceMemTypeWB:", "Top of Memory 2 Memory Type Write Back", PRESENT_DEC, { |
| 73 | { MSR1(0), "Tom2ForceMemTypeWB disabled" }, |
| 74 | { MSR1(1), "Tom2ForceMemTypeWB enabled" }, |
| 75 | { BITVAL_EOT } |
| 76 | }}, |
| 77 | { 21, 1, "MtrrTom2En:", "Top of Memory Address Register 2 Enable", PRESENT_DEC, { |
| 78 | { MSR1(0), "MtrrTom2En disabled" }, |
| 79 | { MSR1(1), "MtrrTom2En enabled" }, |
| 80 | { BITVAL_EOT } |
| 81 | }}, |
| 82 | { 20, 1, "MtrrVarDramEn:", "Top of Memory Address Register and I/O Range Register Enable", PRESENT_DEC, { |
| 83 | { MSR1(0), "MtrrVarDramEn disabled" }, |
| 84 | { MSR1(1), "MtrrVarDramEn enabled" }, |
| 85 | { BITVAL_EOT } |
| 86 | }}, |
| 87 | { 19, 1, "MtrrFixDramModEn:", "RdDram and WrDram Bits Modification Enable", PRESENT_DEC, { |
| 88 | { MSR1(0), "MtrrFixDramModEn disabled" }, |
| 89 | { MSR1(1), "MtrrFixDramModEn enabled" }, |
| 90 | { BITVAL_EOT } |
| 91 | }}, |
| 92 | { 18, 1, "MtrrFixDramEn:", "Fixed RdDram and WrDram Attributes Enable", PRESENT_DEC, { |
| 93 | { MSR1(0), "MtrrFixDramEn disabled" }, |
| 94 | { MSR1(1), "MtrrFixDramEn enabled" }, |
| 95 | { BITVAL_EOT } |
| 96 | }}, |
| 97 | { 17, 1, "SysUcLockEn:", "System Interface Lock Command Enable", PRESENT_DEC, { |
| 98 | { MSR1(0), "SysUcLockEn disabled" }, |
| 99 | { MSR1(1), "SysUcLockEn enabled" }, |
| 100 | { BITVAL_EOT } |
| 101 | }}, |
| 102 | { 16, 1, "ChxToDirtyDis:", "Change to Dirty Command Disable", PRESENT_DEC, { |
| 103 | { MSR1(0), "ChxToDirtyDis disabled" }, |
| 104 | { MSR1(1), "ChxToDirtyDis enabled" }, |
| 105 | { BITVAL_EOT } |
| 106 | }}, |
| 107 | { 15, 5, RESERVED }, |
| 108 | { 10, 1, "SetDirtyEnO:", "SharedToDirty Command for O->M State Transition Enable", PRESENT_DEC, { |
| 109 | { MSR1(0), "SetDirtyEnO disabled" }, |
| 110 | { MSR1(1), "SetDirtyEnO enabled" }, |
| 111 | { BITVAL_EOT } |
| 112 | }}, |
| 113 | { 9, 1, "SetDirtyEnS:", "SharedToDirty Command for S->M State Transition Enable", PRESENT_DEC, { |
| 114 | { MSR1(0), "SetDirtyEnS disabled" }, |
| 115 | { MSR1(1), "SetDirtyEnS enabled" }, |
| 116 | { BITVAL_EOT } |
| 117 | }}, |
| 118 | { 8, 1, "SetDirtyEnE:", "CleanToDirty Command for E->M State Transition Enable", PRESENT_DEC, { |
| 119 | { MSR1(0), "SetDirtyEnE disabled" }, |
| 120 | { MSR1(1), "SetDirtyEnE enabled" }, |
| 121 | { BITVAL_EOT } |
| 122 | }}, |
| 123 | { 7, 3, "SysVicLimit:", "Outstanding Victim Bus Command Limit", PRESENT_HEX, { |
| 124 | { BITVAL_EOT } |
| 125 | }}, |
| 126 | { 4, 5, "SysAckLimit:", "Outstanding Bus Command Limit", PRESENT_HEX, { |
| 127 | { BITVAL_EOT } |
| 128 | }}, |
| 129 | { BITS_EOT } |
| 130 | }}, |
| 131 | |
Uwe Hermann | 708ccac | 2009-04-10 21:05:56 +0000 | [diff] [blame] | 132 | { 0xC0010015, MSRTYPE_RDWR, MSR2(0, 0), "HWCR Register", "This register controls the hardware configuration", { |
Marc Jones | 8f21076 | 2009-03-08 04:37:39 +0000 | [diff] [blame] | 133 | { 63, 32, RESERVED }, |
| 134 | { 31, 2, RESERVED }, |
| 135 | { 29, 6, "START_FID:", "Status of the startup FID", PRESENT_HEX, { |
| 136 | { BITVAL_EOT } |
| 137 | }}, |
| 138 | { 23, 5, RESERVED }, |
| 139 | { 18, 1, "MCi_STATUS_WREN:", "MCi Status Write Enable", PRESENT_DEC, { |
| 140 | { MSR1(0), "MCi_STATUS_WREN disabled" }, |
| 141 | { MSR1(1), "MCi_STATUS_WREN enabled" }, |
| 142 | { BITVAL_EOT } |
| 143 | }}, |
| 144 | { 17, 1, "WRAP32DIS:", "32-bit Address Wrap Disable", PRESENT_DEC, { |
| 145 | { MSR1(0), "WRAP32DIS clear" }, |
| 146 | { MSR1(1), "WRAP32DIS set" }, |
| 147 | { BITVAL_EOT } |
| 148 | }}, |
| 149 | { 16, 1, RESERVED }, |
| 150 | { 15, 1, "SSEDIS:", "SSE Instructions Disable", PRESENT_DEC, { |
| 151 | { MSR1(0), "SSEDIS clear" }, |
| 152 | { MSR1(1), "SSEDIS set" }, |
| 153 | { BITVAL_EOT } |
| 154 | }}, |
| 155 | { 14, 1, "RSMSPCYCDIS:", "Special Bus Cycle On RSM Disable", PRESENT_DEC, { |
| 156 | { MSR1(0), "RSMSPCYCDIS clear" }, |
| 157 | { MSR1(1), "RSMSPCYCDIS set" }, |
| 158 | { BITVAL_EOT } |
| 159 | }}, |
| 160 | { 13, 1, "SMISPCYCDIS:", "Special Bus Cycle On SMI Disable", PRESENT_DEC, { |
| 161 | { MSR1(0), "SMISPCYCDIS clear" }, |
| 162 | { MSR1(1), "SMISPCYCDIS set" }, |
| 163 | { BITVAL_EOT } |
| 164 | }}, |
| 165 | { 12, 1, "HLTXSPCYCEN:", "Enable Special Bus Cycle On Exit From HLT", PRESENT_DEC, { |
| 166 | { MSR1(0), "HLTXSPCYCEN disabled" }, |
| 167 | { MSR1(1), "HLTXSPCYCEN enabled" }, |
| 168 | { BITVAL_EOT } |
| 169 | }}, |
| 170 | { 11, 4, RESERVED }, |
| 171 | { 8, 1, "IGNNE_EM:", "IGNNE Port Emulation Enable", PRESENT_DEC, { |
| 172 | { MSR1(0), "IGNNE_EM disabled" }, |
| 173 | { MSR1(1), "IGNNE_EM enabled" }, |
| 174 | { BITVAL_EOT } |
| 175 | }}, |
| 176 | { 7, 1, "DISLOCK:", "Disable x86 LOCK prefix functionality", PRESENT_DEC, { |
| 177 | { MSR1(0), "DISLOCK clear" }, |
| 178 | { MSR1(1), "DISLOCK set" }, |
| 179 | { BITVAL_EOT } |
| 180 | }}, |
| 181 | { 6, 1, "FFDIS:", "TLB Flush Filter Disable", PRESENT_DEC, { |
| 182 | { MSR1(0), "FFDIS clear" }, |
| 183 | { MSR1(1), "FFDIS set" }, |
| 184 | { BITVAL_EOT } |
| 185 | }}, |
| 186 | { 5, 1, RESERVED }, |
| 187 | { 4, 1, "INVD_WBINVD:", "INVD to WBINVD Conversion", PRESENT_DEC, { |
| 188 | { MSR1(0), "INVD_WBINVD disabled" }, |
| 189 | { MSR1(1), "INVD_WBINVD enabled" }, |
| 190 | { BITVAL_EOT } |
| 191 | }}, |
| 192 | { 3, 1, "TLBCACHEDIS:", "TLB Cacheable Memory Disable", PRESENT_DEC, { |
| 193 | { MSR1(0), "TLBCACHEDIS clear" }, |
| 194 | { MSR1(1), "TLBCACHEDIS set" }, |
| 195 | { BITVAL_EOT } |
| 196 | }}, |
| 197 | { 2, 1, RESERVED }, |
| 198 | { 1, 1, "SLOWFENCE:", "Slow SFENCE Enable", PRESENT_DEC, { |
| 199 | { MSR1(0), "SLOWFENCE disabled" }, |
| 200 | { MSR1(1), "SLOWFENCE enabled" }, |
| 201 | { BITVAL_EOT } |
| 202 | }}, |
| 203 | { 0, 1, "SMMLOCK:", "SMM Configuration Lock", PRESENT_DEC, { |
| 204 | { MSR1(0), "SMMLOCK disabled" }, |
| 205 | { MSR1(1), "SMMLOCK enabled" }, |
| 206 | { BITVAL_EOT } |
| 207 | }}, |
| 208 | { BITS_EOT } |
| 209 | }}, |
| 210 | |
| 211 | { 0xC001001F, MSRTYPE_RDWR, MSR2(0, 0), "NB_CFG Register", "", { |
| 212 | { 63, 9, RESERVED }, |
| 213 | { 54, 1, "InitApicIdCpuIdLo:", "CpuId and NodeId[2:0] bit field positions are swapped in the APICID", PRESENT_DEC, { |
| 214 | { MSR1(0), "CpuId and NodeId not swapped" }, |
| 215 | { MSR1(1), "CpuId and NodeId swapped" }, |
| 216 | { BITVAL_EOT } |
| 217 | }}, |
| 218 | { 53, 8, RESERVED }, |
| 219 | { 45, 1, "DisUsSysMgtRqToNLdt:", "Disable Upstream System Management Rebroadcast", PRESENT_DEC, { |
| 220 | { MSR1(0), "Upstream Rebroadcast disabled" }, |
| 221 | { MSR1(1), "Upstream Rebroadcast enabled" }, |
| 222 | { BITVAL_EOT } |
| 223 | }}, |
| 224 | { 44, 1, RESERVED }, |
| 225 | { 43, 1, "DisThmlPfMonSmiInt:", "Disable Performance Monitor SMI", PRESENT_DEC, { |
| 226 | { MSR1(0), "Performance Monitor SMI enabled" }, |
| 227 | { MSR1(1), "Performance Monitor SMI disabled" }, |
| 228 | { BITVAL_EOT } |
| 229 | }}, |
| 230 | { 42, 6, RESERVED }, |
| 231 | { 36, 1, "DisDatMsk:", "Disables DRAM data masking function", PRESENT_DEC, { |
| 232 | { MSR1(0), "DRAM data masking enabled" }, |
| 233 | { MSR1(1), "DRAM data masking disabled" }, |
| 234 | { BITVAL_EOT } |
| 235 | }}, |
| 236 | { 35, 4, RESERVED }, |
| 237 | { 31, 1, "DisCohLdtCfg:", "Disable Coherent HyperTransport Configuration Accesses", PRESENT_DEC, { |
| 238 | { MSR1(0), "Coherent HyperTransport Configuration enabled" }, |
| 239 | { MSR1(1), "Coherent HyperTransport Configuration disabled" }, |
| 240 | { BITVAL_EOT } |
| 241 | }}, |
| 242 | { 30, 21, RESERVED }, |
| 243 | { 9, 1, "DisRefUseFreeBuf:", "Disable Display Refresh from Using Free List Buffers", PRESENT_DEC, { |
| 244 | { MSR1(0), "Display refresh requests enabled" }, |
| 245 | { MSR1(1), "Display refresh requests disabled" }, |
| 246 | { BITVAL_EOT } |
| 247 | }}, |
| 248 | { BITS_EOT } |
| 249 | }}, |
| 250 | |
| 251 | { 0xC001001A, MSRTYPE_RDWR, MSR2(0, 0), "TOP_MEM Register", "This register indicates the first byte of I/O above DRAM", { |
| 252 | { 63, 24, RESERVED }, |
| 253 | { 39, 8, "TOM 39-32", "", PRESENT_HEX, { |
| 254 | { BITVAL_EOT } |
| 255 | }}, |
| 256 | { 31, 9, "TOM 31-23", "", PRESENT_HEX, { |
| 257 | { BITVAL_EOT } |
| 258 | }}, |
| 259 | { 22, 23, RESERVED }, |
| 260 | { BITS_EOT } |
| 261 | }}, |
| 262 | |
| 263 | { 0xC001001D, MSRTYPE_RDWR, MSR2(0, 0), "TOP_MEM2 Register", "This register indicates the Top of Memory above 4GB", { |
| 264 | { 63, 24, RESERVED }, |
| 265 | { 39, 8, "TOM2 39-32", "", PRESENT_HEX, { |
| 266 | { BITVAL_EOT } |
| 267 | }}, |
| 268 | { 31, 9, "TOM2 31-23", "", PRESENT_HEX, { |
| 269 | { BITVAL_EOT } |
| 270 | }}, |
| 271 | { 22, 23, RESERVED }, |
| 272 | { BITS_EOT } |
| 273 | }}, |
| 274 | |
| 275 | { 0xC0010016, MSRTYPE_RDWR, MSR2(0, 0), "IORRBase0", "This register holds the base of the variable I/O range", { |
| 276 | { 63, 24, RESERVED }, |
| 277 | { 39, 8, "BASE 27-20", "", PRESENT_HEX, { |
| 278 | { BITVAL_EOT } |
| 279 | }}, |
| 280 | { 31, 20, "BASE 20-0", "", PRESENT_HEX, { |
| 281 | { BITVAL_EOT } |
| 282 | }}, |
| 283 | { 11, 6, RESERVED }, |
| 284 | { 5, 1, "RdDram:", "Read from DRAM", PRESENT_DEC, { |
| 285 | { MSR1(0), "RdDram disabled" }, |
| 286 | { MSR1(1), "RdDram enabled" }, |
| 287 | { BITVAL_EOT } |
| 288 | }}, |
| 289 | { 4, 1, "WrDram:", "Write to DRAM", PRESENT_DEC, { |
| 290 | { MSR1(0), "WrDram disabled" }, |
| 291 | { MSR1(1), "WrDram enabled" }, |
| 292 | { BITVAL_EOT } |
| 293 | }}, |
| 294 | { BITS_EOT } |
| 295 | }}, |
| 296 | |
| 297 | { 0xC0010017, MSRTYPE_RDWR, MSR2(0, 0), "IORRMask0", "This register holds the mask of the variable I/O range", { |
| 298 | { 63, 24, RESERVED }, |
| 299 | { 39, 8, "MASK 27-20", "", PRESENT_HEX, { |
| 300 | { BITVAL_EOT } |
| 301 | }}, |
| 302 | { 31, 20, "MASK 20-0", "", PRESENT_HEX, { |
| 303 | { BITVAL_EOT } |
| 304 | }}, |
| 305 | { 11, 1, "V:", "Enables variable I/O range registers", PRESENT_DEC, { |
| 306 | { MSR1(0), "V I/O range disabled" }, |
| 307 | { MSR1(1), "V I/O range enabled" }, |
| 308 | { BITVAL_EOT } |
| 309 | }}, |
| 310 | { 10, 11, RESERVED }, |
| 311 | { BITS_EOT } |
| 312 | }}, |
| 313 | |
| 314 | { 0xC0010018, MSRTYPE_RDWR, MSR2(0, 0), "IORRBase1", "This register holds the base of the variable I/O range", { |
| 315 | { 63, 24, RESERVED }, |
| 316 | { 39, 8, "BASE 27-20", "", PRESENT_HEX, { |
| 317 | { BITVAL_EOT } |
| 318 | }}, |
| 319 | { 31, 20, "BASE 20-0", "", PRESENT_HEX, { |
| 320 | { BITVAL_EOT } |
| 321 | }}, |
| 322 | { 11, 6, RESERVED }, |
| 323 | { 5, 1, "RdDram:", "Read from DRAM", PRESENT_DEC, { |
| 324 | { MSR1(0), "RdDram disabled" }, |
| 325 | { MSR1(1), "RdDram enabled" }, |
| 326 | { BITVAL_EOT } |
| 327 | }}, |
| 328 | { 4, 1, "WrDram:", "Write to DRAM", PRESENT_DEC, { |
| 329 | { MSR1(0), "WrDram disabled" }, |
| 330 | { MSR1(1), "WrDram enabled" }, |
| 331 | { BITVAL_EOT } |
| 332 | }}, |
| 333 | { BITS_EOT } |
| 334 | }}, |
| 335 | |
| 336 | { 0xC0010019, MSRTYPE_RDWR, MSR2(0, 0), "IORRMask1", "This register holds the mask of the variable I/O range", { |
| 337 | { 63, 24, RESERVED }, |
| 338 | { 39, 8, "MASK 27-20", "", PRESENT_HEX, { |
| 339 | { BITVAL_EOT } |
| 340 | }}, |
| 341 | { 31, 20, "MASK 20-0", "", PRESENT_HEX, { |
| 342 | { BITVAL_EOT } |
| 343 | }}, |
| 344 | { 11, 1, "V:", "Enables variable I/O range registers", PRESENT_DEC, { |
| 345 | { MSR1(0), "V I/O range disabled" }, |
| 346 | { MSR1(1), "V I/O range enabled" }, |
| 347 | { BITVAL_EOT } |
| 348 | }}, |
| 349 | { 10, 11, RESERVED }, |
| 350 | { BITS_EOT } |
| 351 | }}, |
| 352 | |
Marc Jones | 8f21076 | 2009-03-08 04:37:39 +0000 | [diff] [blame] | 353 | { MSR_EOT } |
| 354 | }; |