]> git.proxmox.com Git - mirror_edk2.git/blame - UefiCpuPkg/Include/Register/ArchitecturalMsr.h
UefiCpuPkg/Include: Update MSR header files with SDM (Sep.2016)
[mirror_edk2.git] / UefiCpuPkg / Include / Register / ArchitecturalMsr.h
CommitLineData
04c980a6
MK
1/** @file\r
2 Architectural MSR Definitions.\r
3\r
4 Provides defines for Machine Specific Registers(MSR) indexes. Data structures\r
5 are provided for MSRs that contain one or more bit fields. If the MSR value\r
6 returned is a single 32-bit or 64-bit value, then a data structure is not\r
7 provided for that MSR.\r
8\r
9 Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>\r
10 This program and the accompanying materials\r
11 are licensed and made available under the terms and conditions of the BSD License\r
12 which accompanies this distribution. The full text of the license may be found at\r
13 http://opensource.org/licenses/bsd-license.php\r
14\r
15 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
16 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
17\r
18 @par Specification Reference:\r
19 Intel(R) 64 and IA-32 Architectures Software Developer's Manual, Volume 3,\r
0f16be6d 20 September 2016, Chapter 35 Model-Specific-Registers (MSR), Section 35.1.\r
04c980a6 21\r
831d287a
MK
22 @par Specification Reference:\r
23 Intel(R) 64 and IA-32 Architectures Software Developer's Manual, Volume 3,\r
0f16be6d 24 September 2016, Appendix A VMX Capability Reporting Facility, Section A.1.\r
831d287a
MK
25\r
26 @par Specification Reference:\r
27 Intel(R) 64 and IA-32 Architectures Software Developer's Manual, Volume 3,\r
0f16be6d 28 September 2016, Appendix A VMX Capability Reporting Facility, Section A.6.\r
831d287a 29\r
04c980a6
MK
30**/\r
31\r
32#ifndef __ARCHITECTURAL_MSR_H__\r
33#define __ARCHITECTURAL_MSR_H__\r
34\r
35/**\r
0f16be6d 36 See Section 35.22, "MSRs in Pentium Processors.". Pentium Processor (05_01H).\r
04c980a6
MK
37\r
38 @param ECX MSR_IA32_P5_MC_ADDR (0x00000000)\r
39 @param EAX Lower 32-bits of MSR value.\r
40 @param EDX Upper 32-bits of MSR value.\r
41\r
42 <b>Example usage</b>\r
43 @code\r
44 UINT64 Msr;\r
45\r
46 Msr = AsmReadMsr64 (MSR_IA32_P5_MC_ADDR);\r
47 AsmWriteMsr64 (MSR_IA32_P5_MC_ADDR, Msr);\r
48 @endcode\r
7de98828 49 @note MSR_IA32_P5_MC_ADDR is defined as IA32_P5_MC_ADDR in SDM.\r
04c980a6
MK
50**/\r
51#define MSR_IA32_P5_MC_ADDR 0x00000000\r
52\r
53\r
54/**\r
0f16be6d 55 See Section 35.22, "MSRs in Pentium Processors.". DF_DM = 05_01H.\r
04c980a6
MK
56\r
57 @param ECX MSR_IA32_P5_MC_TYPE (0x00000001)\r
58 @param EAX Lower 32-bits of MSR value.\r
59 @param EDX Upper 32-bits of MSR value.\r
60\r
61 <b>Example usage</b>\r
62 @code\r
63 UINT64 Msr;\r
64\r
65 Msr = AsmReadMsr64 (MSR_IA32_P5_MC_TYPE);\r
66 AsmWriteMsr64 (MSR_IA32_P5_MC_TYPE, Msr);\r
67 @endcode\r
7de98828 68 @note MSR_IA32_P5_MC_TYPE is defined as IA32_P5_MC_TYPE in SDM.\r
04c980a6
MK
69**/\r
70#define MSR_IA32_P5_MC_TYPE 0x00000001\r
71\r
72\r
73/**\r
74 See Section 8.10.5, "Monitor/Mwait Address Range Determination.". Introduced\r
75 at Display Family / Display Model 0F_03H.\r
76\r
77 @param ECX MSR_IA32_MONITOR_FILTER_SIZE (0x00000006)\r
78 @param EAX Lower 32-bits of MSR value.\r
79 @param EDX Upper 32-bits of MSR value.\r
80\r
81 <b>Example usage</b>\r
82 @code\r
83 UINT64 Msr;\r
84\r
85 Msr = AsmReadMsr64 (MSR_IA32_MONITOR_FILTER_SIZE);\r
86 AsmWriteMsr64 (MSR_IA32_MONITOR_FILTER_SIZE, Msr);\r
87 @endcode\r
7de98828 88 @note MSR_IA32_MONITOR_FILTER_SIZE is defined as IA32_MONITOR_FILTER_SIZE in SDM.\r
04c980a6
MK
89**/\r
90#define MSR_IA32_MONITOR_FILTER_SIZE 0x00000006\r
91\r
92\r
93/**\r
0f16be6d 94 See Section 17.15, "Time-Stamp Counter.". Introduced at Display Family /\r
04c980a6
MK
95 Display Model 05_01H.\r
96\r
97 @param ECX MSR_IA32_TIME_STAMP_COUNTER (0x00000010)\r
98 @param EAX Lower 32-bits of MSR value.\r
99 @param EDX Upper 32-bits of MSR value.\r
100\r
101 <b>Example usage</b>\r
102 @code\r
103 UINT64 Msr;\r
104\r
105 Msr = AsmReadMsr64 (MSR_IA32_TIME_STAMP_COUNTER);\r
106 AsmWriteMsr64 (MSR_IA32_TIME_STAMP_COUNTER, Msr);\r
107 @endcode\r
7de98828 108 @note MSR_IA32_TIME_STAMP_COUNTER is defined as IA32_TIME_STAMP_COUNTER in SDM.\r
04c980a6
MK
109**/\r
110#define MSR_IA32_TIME_STAMP_COUNTER 0x00000010\r
111\r
112\r
113/**\r
114 Platform ID (RO) The operating system can use this MSR to determine "slot"\r
115 information for the processor and the proper microcode update to load.\r
116 Introduced at Display Family / Display Model 06_01H.\r
117\r
118 @param ECX MSR_IA32_PLATFORM_ID (0x00000017)\r
119 @param EAX Lower 32-bits of MSR value.\r
120 Described by the type MSR_IA32_PLATFORM_ID_REGISTER.\r
121 @param EDX Upper 32-bits of MSR value.\r
122 Described by the type MSR_IA32_PLATFORM_ID_REGISTER.\r
123\r
124 <b>Example usage</b>\r
125 @code\r
126 MSR_IA32_PLATFORM_ID_REGISTER Msr;\r
127\r
128 Msr.Uint64 = AsmReadMsr64 (MSR_IA32_PLATFORM_ID);\r
129 @endcode\r
7de98828 130 @note MSR_IA32_PLATFORM_ID is defined as IA32_PLATFORM_ID in SDM.\r
04c980a6
MK
131**/\r
132#define MSR_IA32_PLATFORM_ID 0x00000017\r
133\r
134/**\r
135 MSR information returned for MSR index #MSR_IA32_PLATFORM_ID\r
136**/\r
137typedef union {\r
138 ///\r
139 /// Individual bit fields\r
140 ///\r
141 struct {\r
142 UINT32 Reserved1:32;\r
143 UINT32 Reserved2:18;\r
144 ///\r
145 /// [Bits 52:50] Platform Id (RO) Contains information concerning the\r
146 /// intended platform for the processor.\r
147 /// 52 51 50\r
148 /// -- -- --\r
149 /// 0 0 0 Processor Flag 0.\r
150 /// 0 0 1 Processor Flag 1\r
151 /// 0 1 0 Processor Flag 2\r
152 /// 0 1 1 Processor Flag 3\r
153 /// 1 0 0 Processor Flag 4\r
154 /// 1 0 1 Processor Flag 5\r
155 /// 1 1 0 Processor Flag 6\r
156 /// 1 1 1 Processor Flag 7\r
157 ///\r
158 UINT32 PlatformId:3;\r
159 UINT32 Reserved3:11;\r
160 } Bits;\r
161 ///\r
162 /// All bit fields as a 64-bit value\r
163 ///\r
164 UINT64 Uint64;\r
165} MSR_IA32_PLATFORM_ID_REGISTER;\r
166\r
167\r
168/**\r
169 06_01H.\r
170\r
171 @param ECX MSR_IA32_APIC_BASE (0x0000001B)\r
172 @param EAX Lower 32-bits of MSR value.\r
173 Described by the type MSR_IA32_APIC_BASE_REGISTER.\r
174 @param EDX Upper 32-bits of MSR value.\r
175 Described by the type MSR_IA32_APIC_BASE_REGISTER.\r
176\r
177 <b>Example usage</b>\r
178 @code\r
179 MSR_IA32_APIC_BASE_REGISTER Msr;\r
180\r
181 Msr.Uint64 = AsmReadMsr64 (MSR_IA32_APIC_BASE);\r
182 AsmWriteMsr64 (MSR_IA32_APIC_BASE, Msr.Uint64);\r
183 @endcode\r
7de98828 184 @note MSR_IA32_APIC_BASE is defined as IA32_APIC_BASE in SDM.\r
04c980a6
MK
185**/\r
186#define MSR_IA32_APIC_BASE 0x0000001B\r
187\r
188/**\r
189 MSR information returned for MSR index #MSR_IA32_APIC_BASE\r
190**/\r
191typedef union {\r
192 ///\r
193 /// Individual bit fields\r
194 ///\r
195 struct {\r
196 UINT32 Reserved1:8;\r
197 ///\r
198 /// [Bit 8] BSP flag (R/W).\r
199 ///\r
200 UINT32 BSP:1;\r
201 UINT32 Reserved2:1;\r
202 ///\r
203 /// [Bit 10] Enable x2APIC mode. Introduced at Display Family / Display\r
204 /// Model 06_1AH.\r
205 ///\r
206 UINT32 EXTD:1;\r
207 ///\r
208 /// [Bit 11] APIC Global Enable (R/W).\r
209 ///\r
210 UINT32 EN:1;\r
211 ///\r
212 /// [Bits 31:12] APIC Base (R/W).\r
213 ///\r
214 UINT32 ApicBase:20;\r
215 ///\r
216 /// [Bits 63:32] APIC Base (R/W).\r
217 ///\r
218 UINT32 ApicBaseHi:32;\r
219 } Bits;\r
220 ///\r
221 /// All bit fields as a 64-bit value\r
222 ///\r
223 UINT64 Uint64;\r
224} MSR_IA32_APIC_BASE_REGISTER;\r
225\r
226\r
227/**\r
228 Control Features in Intel 64 Processor (R/W). If any one enumeration\r
229 condition for defined bit field holds.\r
230\r
231 @param ECX MSR_IA32_FEATURE_CONTROL (0x0000003A)\r
232 @param EAX Lower 32-bits of MSR value.\r
233 Described by the type MSR_IA32_FEATURE_CONTROL_REGISTER.\r
234 @param EDX Upper 32-bits of MSR value.\r
235 Described by the type MSR_IA32_FEATURE_CONTROL_REGISTER.\r
236\r
237 <b>Example usage</b>\r
238 @code\r
239 MSR_IA32_FEATURE_CONTROL_REGISTER Msr;\r
240\r
241 Msr.Uint64 = AsmReadMsr64 (MSR_IA32_FEATURE_CONTROL);\r
242 AsmWriteMsr64 (MSR_IA32_FEATURE_CONTROL, Msr.Uint64);\r
243 @endcode\r
7de98828 244 @note MSR_IA32_FEATURE_CONTROL is defined as IA32_FEATURE_CONTROL in SDM.\r
04c980a6
MK
245**/\r
246#define MSR_IA32_FEATURE_CONTROL 0x0000003A\r
247\r
248/**\r
249 MSR information returned for MSR index #MSR_IA32_FEATURE_CONTROL\r
250**/\r
251typedef union {\r
252 ///\r
253 /// Individual bit fields\r
254 ///\r
255 struct {\r
256 ///\r
257 /// [Bit 0] Lock bit (R/WO): (1 = locked). When set, locks this MSR from\r
258 /// being written, writes to this bit will result in GP(0). Note: Once the\r
259 /// Lock bit is set, the contents of this register cannot be modified.\r
260 /// Therefore the lock bit must be set after configuring support for Intel\r
261 /// Virtualization Technology and prior to transferring control to an\r
262 /// option ROM or the OS. Hence, once the Lock bit is set, the entire\r
263 /// IA32_FEATURE_CONTROL contents are preserved across RESET when PWRGOOD\r
264 /// is not deasserted. If any one enumeration condition for defined bit\r
265 /// field position greater than bit 0 holds.\r
266 ///\r
267 UINT32 Lock:1;\r
268 ///\r
269 /// [Bit 1] Enable VMX inside SMX operation (R/WL): This bit enables a\r
270 /// system executive to use VMX in conjunction with SMX to support\r
271 /// Intel(R) Trusted Execution Technology. BIOS must set this bit only\r
272 /// when the CPUID function 1 returns VMX feature flag and SMX feature\r
273 /// flag set (ECX bits 5 and 6 respectively). If CPUID.01H:ECX[5] = 1 &&\r
274 /// CPUID.01H:ECX[6] = 1.\r
275 ///\r
276 UINT32 EnableVmxInsideSmx:1;\r
277 ///\r
278 /// [Bit 2] Enable VMX outside SMX operation (R/WL): This bit enables VMX\r
279 /// for system executive that do not require SMX. BIOS must set this bit\r
280 /// only when the CPUID function 1 returns VMX feature flag set (ECX bit\r
281 /// 5). If CPUID.01H:ECX[5] = 1.\r
282 ///\r
283 UINT32 EnableVmxOutsideSmx:1;\r
284 UINT32 Reserved1:5;\r
285 ///\r
286 /// [Bits 14:8] SENTER Local Function Enables (R/WL): When set, each bit\r
287 /// in the field represents an enable control for a corresponding SENTER\r
288 /// function. This bit is supported only if CPUID.1:ECX.[bit 6] is set. If\r
289 /// CPUID.01H:ECX[6] = 1.\r
290 ///\r
291 UINT32 SenterLocalFunctionEnables:7;\r
292 ///\r
293 /// [Bit 15] SENTER Global Enable (R/WL): This bit must be set to enable\r
294 /// SENTER leaf functions. This bit is supported only if CPUID.1:ECX.[bit\r
295 /// 6] is set. If CPUID.01H:ECX[6] = 1.\r
296 ///\r
297 UINT32 SenterGlobalEnable:1;\r
0f16be6d
HW
298 UINT32 Reserved2:1;\r
299 ///\r
300 /// [Bit 17] SGX Launch Control Enable (R/WL): This bit must be set to\r
301 /// enable runtime reconfiguration of SGX Launch Control via\r
302 /// IA32_SGXLEPUBKEYHASHn MSR. If CPUID.(EAX=07H, ECX=0H): ECX[30] = 1.\r
303 ///\r
304 UINT32 SgxLaunchControlEnable:1;\r
04c980a6
MK
305 ///\r
306 /// [Bit 18] SGX Global Enable (R/WL): This bit must be set to enable SGX\r
0f16be6d 307 /// leaf functions. If CPUID.(EAX=07H, ECX=0H): EBX[2] = 1.\r
04c980a6
MK
308 ///\r
309 UINT32 SgxEnable:1;\r
310 UINT32 Reserved3:1;\r
311 ///\r
312 /// [Bit 20] LMCE On (R/WL): When set, system software can program the\r
313 /// MSRs associated with LMCE to configure delivery of some machine check\r
314 /// exceptions to a single logical processor. If IA32_MCG_CAP[27] = 1.\r
315 ///\r
316 UINT32 LmceOn:1;\r
317 UINT32 Reserved4:11;\r
318 UINT32 Reserved5:32;\r
319 } Bits;\r
320 ///\r
321 /// All bit fields as a 32-bit value\r
322 ///\r
323 UINT32 Uint32;\r
324 ///\r
325 /// All bit fields as a 64-bit value\r
326 ///\r
327 UINT64 Uint64;\r
328} MSR_IA32_FEATURE_CONTROL_REGISTER;\r
329\r
330\r
331/**\r
332 Per Logical Processor TSC Adjust (R/Write to clear). If CPUID.(EAX=07H,\r
333 ECX=0H): EBX[1] = 1. THREAD_ADJUST: Local offset value of the IA32_TSC for\r
334 a logical processor. Reset value is Zero. A write to IA32_TSC will modify\r
335 the local offset in IA32_TSC_ADJUST and the content of IA32_TSC, but does\r
336 not affect the internal invariant TSC hardware.\r
337\r
338 @param ECX MSR_IA32_TSC_ADJUST (0x0000003B)\r
339 @param EAX Lower 32-bits of MSR value.\r
340 @param EDX Upper 32-bits of MSR value.\r
341\r
342 <b>Example usage</b>\r
343 @code\r
344 UINT64 Msr;\r
345\r
346 Msr = AsmReadMsr64 (MSR_IA32_TSC_ADJUST);\r
347 AsmWriteMsr64 (MSR_IA32_TSC_ADJUST, Msr);\r
348 @endcode\r
7de98828 349 @note MSR_IA32_TSC_ADJUST is defined as IA32_TSC_ADJUST in SDM.\r
04c980a6
MK
350**/\r
351#define MSR_IA32_TSC_ADJUST 0x0000003B\r
352\r
353\r
354/**\r
355 BIOS Update Trigger (W) Executing a WRMSR instruction to this MSR causes a\r
356 microcode update to be loaded into the processor. See Section 9.11.6,\r
357 "Microcode Update Loader." A processor may prevent writing to this MSR when\r
358 loading guest states on VM entries or saving guest states on VM exits.\r
359 Introduced at Display Family / Display Model 06_01H.\r
360\r
361 @param ECX MSR_IA32_BIOS_UPDT_TRIG (0x00000079)\r
362 @param EAX Lower 32-bits of MSR value.\r
363 @param EDX Upper 32-bits of MSR value.\r
364\r
365 <b>Example usage</b>\r
366 @code\r
367 UINT64 Msr;\r
368\r
369 Msr = 0;\r
370 AsmWriteMsr64 (MSR_IA32_BIOS_UPDT_TRIG, Msr);\r
371 @endcode\r
7de98828 372 @note MSR_IA32_BIOS_UPDT_TRIG is defined as IA32_BIOS_UPDT_TRIG in SDM.\r
04c980a6
MK
373**/\r
374#define MSR_IA32_BIOS_UPDT_TRIG 0x00000079\r
375\r
376\r
377/**\r
378 BIOS Update Signature (RO) Returns the microcode update signature following\r
379 the execution of CPUID.01H. A processor may prevent writing to this MSR when\r
380 loading guest states on VM entries or saving guest states on VM exits.\r
381 Introduced at Display Family / Display Model 06_01H.\r
382\r
383 @param ECX MSR_IA32_BIOS_SIGN_ID (0x0000008B)\r
384 @param EAX Lower 32-bits of MSR value.\r
385 Described by the type MSR_IA32_BIOS_SIGN_ID_REGISTER.\r
386 @param EDX Upper 32-bits of MSR value.\r
387 Described by the type MSR_IA32_BIOS_SIGN_ID_REGISTER.\r
388\r
389 <b>Example usage</b>\r
390 @code\r
391 MSR_IA32_BIOS_SIGN_ID_REGISTER Msr;\r
392\r
393 Msr.Uint64 = AsmReadMsr64 (MSR_IA32_BIOS_SIGN_ID);\r
394 @endcode\r
7de98828 395 @note MSR_IA32_BIOS_SIGN_ID is defined as IA32_BIOS_SIGN_ID in SDM.\r
04c980a6
MK
396**/\r
397#define MSR_IA32_BIOS_SIGN_ID 0x0000008B\r
398\r
399/**\r
400 MSR information returned for MSR index #MSR_IA32_BIOS_SIGN_ID\r
401**/\r
402typedef union {\r
403 ///\r
404 /// Individual bit fields\r
405 ///\r
406 struct {\r
407 UINT32 Reserved:32;\r
408 ///\r
409 /// [Bits 63:32] Microcode update signature. This field contains the\r
410 /// signature of the currently loaded microcode update when read following\r
411 /// the execution of the CPUID instruction, function 1. It is required\r
412 /// that this register field be pre-loaded with zero prior to executing\r
413 /// the CPUID, function 1. If the field remains equal to zero, then there\r
414 /// is no microcode update loaded. Another nonzero value will be the\r
415 /// signature.\r
416 ///\r
417 UINT32 MicrocodeUpdateSignature:32;\r
418 } Bits;\r
419 ///\r
420 /// All bit fields as a 64-bit value\r
421 ///\r
422 UINT64 Uint64;\r
423} MSR_IA32_BIOS_SIGN_ID_REGISTER;\r
424\r
425\r
0f16be6d
HW
426/**\r
427 IA32_SGXLEPUBKEYHASH[(64*n+63):(64*n)] (R/W) Bits (64*n+63):(64*n) of the\r
428 SHA256 digest of the SIGSTRUCT.MODULUS for SGX Launch Enclave. On reset, the\r
429 default value is the digest of Intel's signing key. Read permitted If\r
430 CPUID.(EAX=12H,ECX=0H):EAX[0]=1, Write permitted if CPUID.(EAX=12H,ECX=0H):\r
431 EAX[0]=1 && IA32_FEATURE_CONTROL[17] = 1 && IA32_FEATURE_CONTROL[0] = 1.\r
432\r
433 @param ECX MSR_IA32_SGXLEPUBKEYHASHn\r
434 @param EAX Lower 32-bits of MSR value.\r
435 @param EDX Upper 32-bits of MSR value.\r
436\r
437 <b>Example usage</b>\r
438 @code\r
439 UINT64 Msr;\r
440\r
441 Msr = AsmReadMsr64 (MSR_IA32_SGXLEPUBKEYHASHn);\r
442 AsmWriteMsr64 (MSR_IA32_SGXLEPUBKEYHASHn, Msr);\r
443 @endcode\r
444 @note MSR_IA32_SGXLEPUBKEYHASH0 is defined as IA32_SGXLEPUBKEYHASH0 in SDM.\r
445 MSR_IA32_SGXLEPUBKEYHASH1 is defined as IA32_SGXLEPUBKEYHASH1 in SDM.\r
446 MSR_IA32_SGXLEPUBKEYHASH2 is defined as IA32_SGXLEPUBKEYHASH2 in SDM.\r
447 MSR_IA32_SGXLEPUBKEYHASH3 is defined as IA32_SGXLEPUBKEYHASH3 in SDM.\r
448 @{\r
449**/\r
450#define MSR_IA32_SGXLEPUBKEYHASH0 0x0000008C\r
451#define MSR_IA32_SGXLEPUBKEYHASH1 0x0000008D\r
452#define MSR_IA32_SGXLEPUBKEYHASH2 0x0000008E\r
453#define MSR_IA32_SGXLEPUBKEYHASH3 0x0000008F\r
454/// @}\r
455\r
456\r
04c980a6 457/**\r
831d287a 458 SMM Monitor Configuration (R/W). If CPUID.01H: ECX[5]=1 or CPUID.01H: ECX[6] =\r
04c980a6
MK
459 1.\r
460\r
461 @param ECX MSR_IA32_SMM_MONITOR_CTL (0x0000009B)\r
462 @param EAX Lower 32-bits of MSR value.\r
463 Described by the type MSR_IA32_SMM_MONITOR_CTL_REGISTER.\r
464 @param EDX Upper 32-bits of MSR value.\r
465 Described by the type MSR_IA32_SMM_MONITOR_CTL_REGISTER.\r
466\r
467 <b>Example usage</b>\r
468 @code\r
469 MSR_IA32_SMM_MONITOR_CTL_REGISTER Msr;\r
470\r
471 Msr.Uint64 = AsmReadMsr64 (MSR_IA32_SMM_MONITOR_CTL);\r
472 AsmWriteMsr64 (MSR_IA32_SMM_MONITOR_CTL, Msr.Uint64);\r
473 @endcode\r
7de98828 474 @note MSR_IA32_SMM_MONITOR_CTL is defined as IA32_SMM_MONITOR_CTL in SDM.\r
04c980a6
MK
475**/\r
476#define MSR_IA32_SMM_MONITOR_CTL 0x0000009B\r
477\r
478/**\r
479 MSR information returned for MSR index #MSR_IA32_SMM_MONITOR_CTL\r
480**/\r
481typedef union {\r
482 ///\r
483 /// Individual bit fields\r
484 ///\r
485 struct {\r
486 ///\r
487 /// [Bit 0] Valid (R/W). The STM may be invoked using VMCALL only if this\r
488 /// bit is 1. Because VMCALL is used to activate the dual-monitor treatment\r
489 /// (see Section 34.15.6), the dual-monitor treatment cannot be activated\r
490 /// if the bit is 0. This bit is cleared when the logical processor is\r
491 /// reset.\r
492 ///\r
493 UINT32 Valid:1;\r
494 UINT32 Reserved1:1;\r
495 ///\r
496 /// [Bit 2] Determines whether executions of VMXOFF unblock SMIs under the\r
497 /// default treatment of SMIs and SMM. Executions of VMXOFF unblock SMIs\r
498 /// unless bit 2 is 1 (the value of bit 0 is irrelevant).\r
499 ///\r
500 UINT32 BlockSmi:1;\r
501 UINT32 Reserved2:9;\r
502 ///\r
503 /// [Bits 31:12] MSEG Base (R/W).\r
504 ///\r
505 UINT32 MsegBase:20;\r
506 UINT32 Reserved3:32;\r
507 } Bits;\r
508 ///\r
509 /// All bit fields as a 32-bit value\r
510 ///\r
511 UINT32 Uint32;\r
512 ///\r
513 /// All bit fields as a 64-bit value\r
514 ///\r
515 UINT64 Uint64;\r
516} MSR_IA32_SMM_MONITOR_CTL_REGISTER;\r
517\r
831d287a
MK
518/**\r
519 MSEG header that is located at the physical address specified by the MsegBase\r
520 field of #MSR_IA32_SMM_MONITOR_CTL_REGISTER.\r
521**/\r
522typedef struct {\r
523 UINT32 MsegHeaderRevision;\r
524 UINT32 MonitorFeatures;\r
525 UINT32 GdtrLimit;\r
526 UINT32 GdtrBaseOffset;\r
527 UINT32 CsSelector;\r
528 UINT32 EipOffset;\r
529 UINT32 EspOffset;\r
530 UINT32 Cr3Offset;\r
531 //\r
532 // Pad header so total size is 2KB\r
533 //\r
534 UINT8 Reserved[SIZE_2KB - 8 * sizeof (UINT32)];\r
535} MSEG_HEADER;\r
536\r
04c980a6
MK
537\r
538/**\r
539 Base address of the logical processor's SMRAM image (RO, SMM only). If\r
540 IA32_VMX_MISC[15].\r
541\r
542 @param ECX MSR_IA32_SMBASE (0x0000009E)\r
543 @param EAX Lower 32-bits of MSR value.\r
544 @param EDX Upper 32-bits of MSR value.\r
545\r
546 <b>Example usage</b>\r
547 @code\r
548 UINT64 Msr;\r
549\r
550 Msr = AsmReadMsr64 (MSR_IA32_SMBASE);\r
551 @endcode\r
7de98828 552 @note MSR_IA32_SMBASE is defined as IA32_SMBASE in SDM.\r
04c980a6
MK
553**/\r
554#define MSR_IA32_SMBASE 0x0000009E\r
555\r
556\r
557/**\r
558 General Performance Counters (R/W).\r
559 MSR_IA32_PMCn is supported if CPUID.0AH: EAX[15:8] > n.\r
560\r
561 @param ECX MSR_IA32_PMCn\r
562 @param EAX Lower 32-bits of MSR value.\r
563 @param EDX Upper 32-bits of MSR value.\r
564\r
565 <b>Example usage</b>\r
566 @code\r
567 UINT64 Msr;\r
568\r
569 Msr = AsmReadMsr64 (MSR_IA32_PMC0);\r
570 AsmWriteMsr64 (MSR_IA32_PMC0, Msr);\r
571 @endcode\r
7de98828
JF
572 @note MSR_IA32_PMC0 is defined as IA32_PMC0 in SDM.\r
573 MSR_IA32_PMC1 is defined as IA32_PMC1 in SDM.\r
574 MSR_IA32_PMC2 is defined as IA32_PMC2 in SDM.\r
575 MSR_IA32_PMC3 is defined as IA32_PMC3 in SDM.\r
576 MSR_IA32_PMC4 is defined as IA32_PMC4 in SDM.\r
577 MSR_IA32_PMC5 is defined as IA32_PMC5 in SDM.\r
578 MSR_IA32_PMC6 is defined as IA32_PMC6 in SDM.\r
579 MSR_IA32_PMC7 is defined as IA32_PMC7 in SDM.\r
04c980a6
MK
580 @{\r
581**/\r
582#define MSR_IA32_PMC0 0x000000C1\r
583#define MSR_IA32_PMC1 0x000000C2\r
584#define MSR_IA32_PMC2 0x000000C3\r
585#define MSR_IA32_PMC3 0x000000C4\r
586#define MSR_IA32_PMC4 0x000000C5\r
587#define MSR_IA32_PMC5 0x000000C6\r
588#define MSR_IA32_PMC6 0x000000C7\r
589#define MSR_IA32_PMC7 0x000000C8\r
590/// @}\r
591\r
592\r
593/**\r
594 TSC Frequency Clock Counter (R/Write to clear). If CPUID.06H: ECX[0] = 1.\r
595 C0_MCNT: C0 TSC Frequency Clock Count Increments at fixed interval (relative\r
596 to TSC freq.) when the logical processor is in C0. Cleared upon overflow /\r
597 wrap-around of IA32_APERF.\r
598\r
599 @param ECX MSR_IA32_MPERF (0x000000E7)\r
600 @param EAX Lower 32-bits of MSR value.\r
601 @param EDX Upper 32-bits of MSR value.\r
602\r
603 <b>Example usage</b>\r
604 @code\r
605 UINT64 Msr;\r
606\r
607 Msr = AsmReadMsr64 (MSR_IA32_MPERF);\r
608 AsmWriteMsr64 (MSR_IA32_MPERF, Msr);\r
609 @endcode\r
7de98828 610 @note MSR_IA32_MPERF is defined as IA32_MPERF in SDM.\r
04c980a6
MK
611**/\r
612#define MSR_IA32_MPERF 0x000000E7\r
613\r
614\r
615/**\r
616 Actual Performance Clock Counter (R/Write to clear). If CPUID.06H: ECX[0] =\r
617 1. C0_ACNT: C0 Actual Frequency Clock Count Accumulates core clock counts at\r
618 the coordinated clock frequency, when the logical processor is in C0.\r
619 Cleared upon overflow / wrap-around of IA32_MPERF.\r
620\r
621 @param ECX MSR_IA32_APERF (0x000000E8)\r
622 @param EAX Lower 32-bits of MSR value.\r
623 @param EDX Upper 32-bits of MSR value.\r
624\r
625 <b>Example usage</b>\r
626 @code\r
627 UINT64 Msr;\r
628\r
629 Msr = AsmReadMsr64 (MSR_IA32_APERF);\r
630 AsmWriteMsr64 (MSR_IA32_APERF, Msr);\r
631 @endcode\r
7de98828 632 @note MSR_IA32_APERF is defined as IA32_APERF in SDM.\r
04c980a6
MK
633**/\r
634#define MSR_IA32_APERF 0x000000E8\r
635\r
636\r
637/**\r
638 MTRR Capability (RO) Section 11.11.2.1, "IA32_MTRR_DEF_TYPE MSR.".\r
639 Introduced at Display Family / Display Model 06_01H.\r
640\r
641 @param ECX MSR_IA32_MTRRCAP (0x000000FE)\r
642 @param EAX Lower 32-bits of MSR value.\r
643 Described by the type MSR_IA32_MTRRCAP_REGISTER.\r
644 @param EDX Upper 32-bits of MSR value.\r
645 Described by the type MSR_IA32_MTRRCAP_REGISTER.\r
646\r
647 <b>Example usage</b>\r
648 @code\r
649 MSR_IA32_MTRRCAP_REGISTER Msr;\r
650\r
651 Msr.Uint64 = AsmReadMsr64 (MSR_IA32_MTRRCAP);\r
652 @endcode\r
7de98828 653 @note MSR_IA32_MTRRCAP is defined as IA32_MTRRCAP in SDM.\r
04c980a6
MK
654**/\r
655#define MSR_IA32_MTRRCAP 0x000000FE\r
656\r
657/**\r
658 MSR information returned for MSR index #MSR_IA32_MTRRCAP\r
659**/\r
660typedef union {\r
661 ///\r
662 /// Individual bit fields\r
663 ///\r
664 struct {\r
665 ///\r
666 /// [Bits 7:0] VCNT: The number of variable memory type ranges in the\r
667 /// processor.\r
668 ///\r
669 UINT32 VCNT:8;\r
670 ///\r
671 /// [Bit 8] Fixed range MTRRs are supported when set.\r
672 ///\r
673 UINT32 FIX:1;\r
674 UINT32 Reserved1:1;\r
675 ///\r
676 /// [Bit 10] WC Supported when set.\r
677 ///\r
678 UINT32 WC:1;\r
679 ///\r
680 /// [Bit 11] SMRR Supported when set.\r
681 ///\r
682 UINT32 SMRR:1;\r
683 UINT32 Reserved2:20;\r
684 UINT32 Reserved3:32;\r
685 } Bits;\r
686 ///\r
687 /// All bit fields as a 32-bit value\r
688 ///\r
689 UINT32 Uint32;\r
690 ///\r
691 /// All bit fields as a 64-bit value\r
692 ///\r
693 UINT64 Uint64;\r
694} MSR_IA32_MTRRCAP_REGISTER;\r
695\r
696\r
697/**\r
698 SYSENTER_CS_MSR (R/W). Introduced at Display Family / Display Model 06_01H.\r
699\r
700 @param ECX MSR_IA32_SYSENTER_CS (0x00000174)\r
701 @param EAX Lower 32-bits of MSR value.\r
702 Described by the type MSR_IA32_SYSENTER_CS_REGISTER.\r
703 @param EDX Upper 32-bits of MSR value.\r
704 Described by the type MSR_IA32_SYSENTER_CS_REGISTER.\r
705\r
706 <b>Example usage</b>\r
707 @code\r
708 MSR_IA32_SYSENTER_CS_REGISTER Msr;\r
709\r
710 Msr.Uint64 = AsmReadMsr64 (MSR_IA32_SYSENTER_CS);\r
711 AsmWriteMsr64 (MSR_IA32_SYSENTER_CS, Msr.Uint64);\r
712 @endcode\r
7de98828 713 @note MSR_IA32_SYSENTER_CS is defined as IA32_SYSENTER_CS in SDM.\r
04c980a6
MK
714**/\r
715#define MSR_IA32_SYSENTER_CS 0x00000174\r
716\r
717/**\r
718 MSR information returned for MSR index #MSR_IA32_SYSENTER_CS\r
719**/\r
720typedef union {\r
721 ///\r
722 /// Individual bit fields\r
723 ///\r
724 struct {\r
725 ///\r
726 /// [Bits 15:0] CS Selector.\r
727 ///\r
728 UINT32 CS:16;\r
729 UINT32 Reserved1:16;\r
730 UINT32 Reserved2:32;\r
731 } Bits;\r
732 ///\r
733 /// All bit fields as a 32-bit value\r
734 ///\r
735 UINT32 Uint32;\r
736 ///\r
737 /// All bit fields as a 64-bit value\r
738 ///\r
739 UINT64 Uint64;\r
740} MSR_IA32_SYSENTER_CS_REGISTER;\r
741\r
742\r
743/**\r
744 SYSENTER_ESP_MSR (R/W). Introduced at Display Family / Display Model 06_01H.\r
745\r
746 @param ECX MSR_IA32_SYSENTER_ESP (0x00000175)\r
747 @param EAX Lower 32-bits of MSR value.\r
748 @param EDX Upper 32-bits of MSR value.\r
749\r
750 <b>Example usage</b>\r
751 @code\r
752 UINT64 Msr;\r
753\r
754 Msr = AsmReadMsr64 (MSR_IA32_SYSENTER_ESP);\r
755 AsmWriteMsr64 (MSR_IA32_SYSENTER_ESP, Msr);\r
756 @endcode\r
7de98828 757 @note MSR_IA32_SYSENTER_ESP is defined as IA32_SYSENTER_ESP in SDM.\r
04c980a6
MK
758**/\r
759#define MSR_IA32_SYSENTER_ESP 0x00000175\r
760\r
761\r
762/**\r
763 SYSENTER_EIP_MSR (R/W). Introduced at Display Family / Display Model 06_01H.\r
764\r
765 @param ECX MSR_IA32_SYSENTER_EIP (0x00000176)\r
766 @param EAX Lower 32-bits of MSR value.\r
767 @param EDX Upper 32-bits of MSR value.\r
768\r
769 <b>Example usage</b>\r
770 @code\r
771 UINT64 Msr;\r
772\r
773 Msr = AsmReadMsr64 (MSR_IA32_SYSENTER_EIP);\r
774 AsmWriteMsr64 (MSR_IA32_SYSENTER_EIP, Msr);\r
775 @endcode\r
7de98828 776 @note MSR_IA32_SYSENTER_EIP is defined as IA32_SYSENTER_EIP in SDM.\r
04c980a6
MK
777**/\r
778#define MSR_IA32_SYSENTER_EIP 0x00000176\r
779\r
780\r
781/**\r
782 Global Machine Check Capability (RO). Introduced at Display Family / Display\r
783 Model 06_01H.\r
784\r
785 @param ECX MSR_IA32_MCG_CAP (0x00000179)\r
786 @param EAX Lower 32-bits of MSR value.\r
787 Described by the type MSR_IA32_MCG_CAP_REGISTER.\r
788 @param EDX Upper 32-bits of MSR value.\r
789 Described by the type MSR_IA32_MCG_CAP_REGISTER.\r
790\r
791 <b>Example usage</b>\r
792 @code\r
793 MSR_IA32_MCG_CAP_REGISTER Msr;\r
794\r
795 Msr.Uint64 = AsmReadMsr64 (MSR_IA32_MCG_CAP);\r
796 @endcode\r
7de98828 797 @note MSR_IA32_MCG_CAP is defined as IA32_MCG_CAP in SDM.\r
04c980a6
MK
798**/\r
799#define MSR_IA32_MCG_CAP 0x00000179\r
800\r
801/**\r
802 MSR information returned for MSR index #MSR_IA32_MCG_CAP\r
803**/\r
804typedef union {\r
805 ///\r
806 /// Individual bit fields\r
807 ///\r
808 struct {\r
809 ///\r
810 /// [Bits 7:0] Count: Number of reporting banks.\r
811 ///\r
812 UINT32 Count:8;\r
813 ///\r
814 /// [Bit 8] MCG_CTL_P: IA32_MCG_CTL is present if this bit is set.\r
815 ///\r
816 UINT32 MCG_CTL_P:1;\r
817 ///\r
818 /// [Bit 9] MCG_EXT_P: Extended machine check state registers are present\r
819 /// if this bit is set.\r
820 ///\r
821 UINT32 MCG_EXT_P:1;\r
822 ///\r
823 /// [Bit 10] MCP_CMCI_P: Support for corrected MC error event is present.\r
824 /// Introduced at Display Family / Display Model 06_01H.\r
825 ///\r
826 UINT32 MCP_CMCI_P:1;\r
827 ///\r
828 /// [Bit 11] MCG_TES_P: Threshold-based error status register are present\r
829 /// if this bit is set.\r
830 ///\r
831 UINT32 MCG_TES_P:1;\r
832 UINT32 Reserved1:4;\r
833 ///\r
834 /// [Bits 23:16] MCG_EXT_CNT: Number of extended machine check state\r
835 /// registers present.\r
836 ///\r
837 UINT32 MCG_EXT_CNT:8;\r
838 ///\r
839 /// [Bit 24] MCG_SER_P: The processor supports software error recovery if\r
840 /// this bit is set.\r
841 ///\r
842 UINT32 MCG_SER_P:1;\r
843 UINT32 Reserved2:1;\r
844 ///\r
845 /// [Bit 26] MCG_ELOG_P: Indicates that the processor allows platform\r
846 /// firmware to be invoked when an error is detected so that it may\r
847 /// provide additional platform specific information in an ACPI format\r
848 /// "Generic Error Data Entry" that augments the data included in machine\r
849 /// check bank registers. Introduced at Display Family / Display Model\r
850 /// 06_3EH.\r
851 ///\r
852 UINT32 MCG_ELOG_P:1;\r
853 ///\r
854 /// [Bit 27] MCG_LMCE_P: Indicates that the processor support extended\r
855 /// state in IA32_MCG_STATUS and associated MSR necessary to configure\r
856 /// Local Machine Check Exception (LMCE). Introduced at Display Family /\r
857 /// Display Model 06_3EH.\r
858 ///\r
859 UINT32 MCG_LMCE_P:1;\r
860 UINT32 Reserved3:4;\r
861 UINT32 Reserved4:32;\r
862 } Bits;\r
863 ///\r
864 /// All bit fields as a 32-bit value\r
865 ///\r
866 UINT32 Uint32;\r
867 ///\r
868 /// All bit fields as a 64-bit value\r
869 ///\r
870 UINT64 Uint64;\r
871} MSR_IA32_MCG_CAP_REGISTER;\r
872\r
873\r
874/**\r
875 Global Machine Check Status (R/W0). Introduced at Display Family / Display\r
876 Model 06_01H.\r
877\r
878 @param ECX MSR_IA32_MCG_STATUS (0x0000017A)\r
879 @param EAX Lower 32-bits of MSR value.\r
880 Described by the type MSR_IA32_MCG_STATUS_REGISTER.\r
881 @param EDX Upper 32-bits of MSR value.\r
882 Described by the type MSR_IA32_MCG_STATUS_REGISTER.\r
883\r
884 <b>Example usage</b>\r
885 @code\r
886 MSR_IA32_MCG_STATUS_REGISTER Msr;\r
887\r
888 Msr.Uint64 = AsmReadMsr64 (MSR_IA32_MCG_STATUS);\r
889 AsmWriteMsr64 (MSR_IA32_MCG_STATUS, Msr.Uint64);\r
890 @endcode\r
7de98828 891 @note MSR_IA32_MCG_STATUS is defined as IA32_MCG_STATUS in SDM.\r
04c980a6
MK
892**/\r
893#define MSR_IA32_MCG_STATUS 0x0000017A\r
894\r
895/**\r
896 MSR information returned for MSR index #MSR_IA32_MCG_STATUS\r
897**/\r
898typedef union {\r
899 ///\r
900 /// Individual bit fields\r
901 ///\r
902 struct {\r
903 ///\r
904 /// [Bit 0] RIPV. Restart IP valid. Introduced at Display Family / Display\r
905 /// Model 06_01H.\r
906 ///\r
907 UINT32 RIPV:1;\r
908 ///\r
909 /// [Bit 1] EIPV. Error IP valid. Introduced at Display Family / Display\r
910 /// Model 06_01H.\r
911 ///\r
912 UINT32 EIPV:1;\r
913 ///\r
914 /// [Bit 2] MCIP. Machine check in progress. Introduced at Display Family\r
915 /// / Display Model 06_01H.\r
916 ///\r
917 UINT32 MCIP:1;\r
918 ///\r
919 /// [Bit 3] LMCE_S. If IA32_MCG_CAP.LMCE_P[2 7] =1.\r
920 ///\r
921 UINT32 LMCE_S:1;\r
922 UINT32 Reserved1:28;\r
923 UINT32 Reserved2:32;\r
924 } Bits;\r
925 ///\r
926 /// All bit fields as a 32-bit value\r
927 ///\r
928 UINT32 Uint32;\r
929 ///\r
930 /// All bit fields as a 64-bit value\r
931 ///\r
932 UINT64 Uint64;\r
933} MSR_IA32_MCG_STATUS_REGISTER;\r
934\r
935\r
936/**\r
937 Global Machine Check Control (R/W). If IA32_MCG_CAP.CTL_P[8] =1.\r
938\r
939 @param ECX MSR_IA32_MCG_CTL (0x0000017B)\r
940 @param EAX Lower 32-bits of MSR value.\r
941 @param EDX Upper 32-bits of MSR value.\r
942\r
943 <b>Example usage</b>\r
944 @code\r
945 UINT64 Msr;\r
946\r
947 Msr = AsmReadMsr64 (MSR_IA32_MCG_CTL);\r
948 AsmWriteMsr64 (MSR_IA32_MCG_CTL, Msr);\r
949 @endcode\r
7de98828 950 @note MSR_IA32_MCG_CTL is defined as IA32_MCG_CTL in SDM.\r
04c980a6
MK
951**/\r
952#define MSR_IA32_MCG_CTL 0x0000017B\r
953\r
954\r
955/**\r
956 Performance Event Select Register n (R/W). If CPUID.0AH: EAX[15:8] > n.\r
957\r
958 @param ECX MSR_IA32_PERFEVTSELn\r
959 @param EAX Lower 32-bits of MSR value.\r
960 Described by the type MSR_IA32_PERFEVTSEL_REGISTER.\r
961 @param EDX Upper 32-bits of MSR value.\r
962 Described by the type MSR_IA32_PERFEVTSEL_REGISTER.\r
963\r
964 <b>Example usage</b>\r
965 @code\r
966 MSR_IA32_PERFEVTSEL_REGISTER Msr;\r
967\r
968 Msr.Uint64 = AsmReadMsr64 (MSR_IA32_PERFEVTSEL0);\r
969 AsmWriteMsr64 (MSR_IA32_PERFEVTSEL0, Msr.Uint64);\r
970 @endcode\r
7de98828
JF
971 @note MSR_IA32_PERFEVTSEL0 is defined as IA32_PERFEVTSEL0 in SDM.\r
972 MSR_IA32_PERFEVTSEL1 is defined as IA32_PERFEVTSEL1 in SDM.\r
973 MSR_IA32_PERFEVTSEL2 is defined as IA32_PERFEVTSEL2 in SDM.\r
974 MSR_IA32_PERFEVTSEL3 is defined as IA32_PERFEVTSEL3 in SDM.\r
04c980a6
MK
975 @{\r
976**/\r
977#define MSR_IA32_PERFEVTSEL0 0x00000186\r
978#define MSR_IA32_PERFEVTSEL1 0x00000187\r
979#define MSR_IA32_PERFEVTSEL2 0x00000188\r
980#define MSR_IA32_PERFEVTSEL3 0x00000189\r
981/// @}\r
982\r
983/**\r
984 MSR information returned for MSR indexes #MSR_IA32_PERFEVTSEL0 to\r
985 #MSR_IA32_PERFEVTSEL3\r
986**/\r
987typedef union {\r
988 ///\r
989 /// Individual bit fields\r
990 ///\r
991 struct {\r
992 ///\r
993 /// [Bits 7:0] Event Select: Selects a performance event logic unit.\r
994 ///\r
995 UINT32 EventSelect:8;\r
996 ///\r
997 /// [Bits 15:8] UMask: Qualifies the microarchitectural condition to\r
998 /// detect on the selected event logic.\r
999 ///\r
1000 UINT32 UMASK:8;\r
1001 ///\r
1002 /// [Bit 16] USR: Counts while in privilege level is not ring 0.\r
1003 ///\r
1004 UINT32 USR:1;\r
1005 ///\r
1006 /// [Bit 17] OS: Counts while in privilege level is ring 0.\r
1007 ///\r
1008 UINT32 OS:1;\r
1009 ///\r
1010 /// [Bit 18] Edge: Enables edge detection if set.\r
1011 ///\r
1012 UINT32 E:1;\r
1013 ///\r
1014 /// [Bit 19] PC: enables pin control.\r
1015 ///\r
1016 UINT32 PC:1;\r
1017 ///\r
1018 /// [Bit 20] INT: enables interrupt on counter overflow.\r
1019 ///\r
1020 UINT32 INT:1;\r
1021 ///\r
1022 /// [Bit 21] AnyThread: When set to 1, it enables counting the associated\r
1023 /// event conditions occurring across all logical processors sharing a\r
1024 /// processor core. When set to 0, the counter only increments the\r
1025 /// associated event conditions occurring in the logical processor which\r
1026 /// programmed the MSR.\r
1027 ///\r
1028 UINT32 ANY:1;\r
1029 ///\r
1030 /// [Bit 22] EN: enables the corresponding performance counter to commence\r
1031 /// counting when this bit is set.\r
1032 ///\r
1033 UINT32 EN:1;\r
1034 ///\r
1035 /// [Bit 23] INV: invert the CMASK.\r
1036 ///\r
1037 UINT32 INV:1;\r
1038 ///\r
1039 /// [Bits 31:24] CMASK: When CMASK is not zero, the corresponding\r
1040 /// performance counter increments each cycle if the event count is\r
1041 /// greater than or equal to the CMASK.\r
1042 ///\r
1043 UINT32 CMASK:8;\r
1044 UINT32 Reserved:32;\r
1045 } Bits;\r
1046 ///\r
1047 /// All bit fields as a 32-bit value\r
1048 ///\r
1049 UINT32 Uint32;\r
1050 ///\r
1051 /// All bit fields as a 64-bit value\r
1052 ///\r
1053 UINT64 Uint64;\r
1054} MSR_IA32_PERFEVTSEL_REGISTER;\r
1055\r
1056\r
1057/**\r
1058 Current performance state(P-State) operating point (RO). Introduced at\r
1059 Display Family / Display Model 0F_03H.\r
1060\r
1061 @param ECX MSR_IA32_PERF_STATUS (0x00000198)\r
1062 @param EAX Lower 32-bits of MSR value.\r
1063 Described by the type MSR_IA32_PERF_STATUS_REGISTER.\r
1064 @param EDX Upper 32-bits of MSR value.\r
1065 Described by the type MSR_IA32_PERF_STATUS_REGISTER.\r
1066\r
1067 <b>Example usage</b>\r
1068 @code\r
1069 MSR_IA32_PERF_STATUS_REGISTER Msr;\r
1070\r
1071 Msr.Uint64 = AsmReadMsr64 (MSR_IA32_PERF_STATUS);\r
1072 @endcode\r
7de98828 1073 @note MSR_IA32_PERF_STATUS is defined as IA32_PERF_STATUS in SDM.\r
04c980a6
MK
1074**/\r
1075#define MSR_IA32_PERF_STATUS 0x00000198\r
1076\r
1077/**\r
1078 MSR information returned for MSR index #MSR_IA32_PERF_STATUS\r
1079**/\r
1080typedef union {\r
1081 ///\r
1082 /// Individual bit fields\r
1083 ///\r
1084 struct {\r
1085 ///\r
1086 /// [Bits 15:0] Current performance State Value.\r
1087 ///\r
1088 UINT32 State:16;\r
1089 UINT32 Reserved1:16;\r
1090 UINT32 Reserved2:32;\r
1091 } Bits;\r
1092 ///\r
1093 /// All bit fields as a 32-bit value\r
1094 ///\r
1095 UINT32 Uint32;\r
1096 ///\r
1097 /// All bit fields as a 64-bit value\r
1098 ///\r
1099 UINT64 Uint64;\r
1100} MSR_IA32_PERF_STATUS_REGISTER;\r
1101\r
1102\r
1103/**\r
1104 (R/W). Introduced at Display Family / Display Model 0F_03H.\r
1105\r
1106 @param ECX MSR_IA32_PERF_CTL (0x00000199)\r
1107 @param EAX Lower 32-bits of MSR value.\r
1108 Described by the type MSR_IA32_PERF_CTL_REGISTER.\r
1109 @param EDX Upper 32-bits of MSR value.\r
1110 Described by the type MSR_IA32_PERF_CTL_REGISTER.\r
1111\r
1112 <b>Example usage</b>\r
1113 @code\r
1114 MSR_IA32_PERF_CTL_REGISTER Msr;\r
1115\r
1116 Msr.Uint64 = AsmReadMsr64 (MSR_IA32_PERF_CTL);\r
1117 AsmWriteMsr64 (MSR_IA32_PERF_CTL, Msr.Uint64);\r
1118 @endcode\r
7de98828 1119 @note MSR_IA32_PERF_CTL is defined as IA32_PERF_CTL in SDM.\r
04c980a6
MK
1120**/\r
1121#define MSR_IA32_PERF_CTL 0x00000199\r
1122\r
1123/**\r
1124 MSR information returned for MSR index #MSR_IA32_PERF_CTL\r
1125**/\r
1126typedef union {\r
1127 ///\r
1128 /// Individual bit fields\r
1129 ///\r
1130 struct {\r
1131 ///\r
1132 /// [Bits 15:0] Target performance State Value.\r
1133 ///\r
1134 UINT32 TargetState:16;\r
1135 UINT32 Reserved1:16;\r
1136 ///\r
1137 /// [Bit 32] IDA Engage. (R/W) When set to 1: disengages IDA. 06_0FH\r
1138 /// (Mobile only).\r
1139 ///\r
1140 UINT32 IDA:1;\r
1141 UINT32 Reserved2:31;\r
1142 } Bits;\r
1143 ///\r
1144 /// All bit fields as a 64-bit value\r
1145 ///\r
1146 UINT64 Uint64;\r
1147} MSR_IA32_PERF_CTL_REGISTER;\r
1148\r
1149\r
1150/**\r
1151 Clock Modulation Control (R/W) See Section 14.7.3, "Software Controlled\r
0f16be6d 1152 Clock Modulation.". If CPUID.01H:EDX[22] = 1.\r
04c980a6
MK
1153\r
1154 @param ECX MSR_IA32_CLOCK_MODULATION (0x0000019A)\r
1155 @param EAX Lower 32-bits of MSR value.\r
1156 Described by the type MSR_IA32_CLOCK_MODULATION_REGISTER.\r
1157 @param EDX Upper 32-bits of MSR value.\r
1158 Described by the type MSR_IA32_CLOCK_MODULATION_REGISTER.\r
1159\r
1160 <b>Example usage</b>\r
1161 @code\r
1162 MSR_IA32_CLOCK_MODULATION_REGISTER Msr;\r
1163\r
1164 Msr.Uint64 = AsmReadMsr64 (MSR_IA32_CLOCK_MODULATION);\r
1165 AsmWriteMsr64 (MSR_IA32_CLOCK_MODULATION, Msr.Uint64);\r
1166 @endcode\r
7de98828 1167 @note MSR_IA32_CLOCK_MODULATION is defined as IA32_CLOCK_MODULATION in SDM.\r
04c980a6
MK
1168**/\r
1169#define MSR_IA32_CLOCK_MODULATION 0x0000019A\r
1170\r
1171/**\r
1172 MSR information returned for MSR index #MSR_IA32_CLOCK_MODULATION\r
1173**/\r
1174typedef union {\r
1175 ///\r
1176 /// Individual bit fields\r
1177 ///\r
1178 struct {\r
1179 ///\r
1180 /// [Bit 0] Extended On-Demand Clock Modulation Duty Cycle:. If\r
1181 /// CPUID.06H:EAX[5] = 1.\r
1182 ///\r
1183 UINT32 ExtendedOnDemandClockModulationDutyCycle:1;\r
1184 ///\r
1185 /// [Bits 3:1] On-Demand Clock Modulation Duty Cycle: Specific encoded\r
0f16be6d 1186 /// values for target duty cycle modulation. If CPUID.01H:EDX[22] = 1.\r
04c980a6
MK
1187 ///\r
1188 UINT32 OnDemandClockModulationDutyCycle:3;\r
1189 ///\r
1190 /// [Bit 4] On-Demand Clock Modulation Enable: Set 1 to enable modulation.\r
0f16be6d 1191 /// If CPUID.01H:EDX[22] = 1.\r
04c980a6
MK
1192 ///\r
1193 UINT32 OnDemandClockModulationEnable:1;\r
1194 UINT32 Reserved1:27;\r
1195 UINT32 Reserved2:32;\r
1196 } Bits;\r
1197 ///\r
1198 /// All bit fields as a 32-bit value\r
1199 ///\r
1200 UINT32 Uint32;\r
1201 ///\r
1202 /// All bit fields as a 64-bit value\r
1203 ///\r
1204 UINT64 Uint64;\r
1205} MSR_IA32_CLOCK_MODULATION_REGISTER;\r
1206\r
1207\r
1208/**\r
1209 Thermal Interrupt Control (R/W) Enables and disables the generation of an\r
1210 interrupt on temperature transitions detected with the processor's thermal\r
1211 sensors and thermal monitor. See Section 14.7.2, "Thermal Monitor.".\r
0f16be6d 1212 If CPUID.01H:EDX[22] = 1\r
04c980a6
MK
1213\r
1214 @param ECX MSR_IA32_THERM_INTERRUPT (0x0000019B)\r
1215 @param EAX Lower 32-bits of MSR value.\r
1216 Described by the type MSR_IA32_THERM_INTERRUPT_REGISTER.\r
1217 @param EDX Upper 32-bits of MSR value.\r
1218 Described by the type MSR_IA32_THERM_INTERRUPT_REGISTER.\r
1219\r
1220 <b>Example usage</b>\r
1221 @code\r
1222 MSR_IA32_THERM_INTERRUPT_REGISTER Msr;\r
1223\r
1224 Msr.Uint64 = AsmReadMsr64 (MSR_IA32_THERM_INTERRUPT);\r
1225 AsmWriteMsr64 (MSR_IA32_THERM_INTERRUPT, Msr.Uint64);\r
1226 @endcode\r
7de98828 1227 @note MSR_IA32_THERM_INTERRUPT is defined as IA32_THERM_INTERRUPT in SDM.\r
04c980a6
MK
1228**/\r
1229#define MSR_IA32_THERM_INTERRUPT 0x0000019B\r
1230\r
1231/**\r
1232 MSR information returned for MSR index #MSR_IA32_THERM_INTERRUPT\r
1233**/\r
1234typedef union {\r
1235 ///\r
1236 /// Individual bit fields\r
1237 ///\r
1238 struct {\r
1239 ///\r
0f16be6d 1240 /// [Bit 0] High-Temperature Interrupt Enable. If CPUID.01H:EDX[22] = 1.\r
04c980a6
MK
1241 ///\r
1242 UINT32 HighTempEnable:1;\r
1243 ///\r
0f16be6d 1244 /// [Bit 1] Low-Temperature Interrupt Enable. If CPUID.01H:EDX[22] = 1.\r
04c980a6
MK
1245 ///\r
1246 UINT32 LowTempEnable:1;\r
1247 ///\r
0f16be6d 1248 /// [Bit 2] PROCHOT# Interrupt Enable. If CPUID.01H:EDX[22] = 1.\r
04c980a6
MK
1249 ///\r
1250 UINT32 PROCHOT_Enable:1;\r
1251 ///\r
0f16be6d 1252 /// [Bit 3] FORCEPR# Interrupt Enable. If CPUID.01H:EDX[22] = 1.\r
04c980a6
MK
1253 ///\r
1254 UINT32 FORCEPR_Enable:1;\r
1255 ///\r
1256 /// [Bit 4] Critical Temperature Interrupt Enable.\r
0f16be6d 1257 /// If CPUID.01H:EDX[22] = 1.\r
04c980a6
MK
1258 ///\r
1259 UINT32 CriticalTempEnable:1;\r
1260 UINT32 Reserved1:3;\r
1261 ///\r
0f16be6d 1262 /// [Bits 14:8] Threshold #1 Value. If CPUID.01H:EDX[22] = 1.\r
04c980a6
MK
1263 ///\r
1264 UINT32 Threshold1:7;\r
1265 ///\r
0f16be6d 1266 /// [Bit 15] Threshold #1 Interrupt Enable. If CPUID.01H:EDX[22] = 1.\r
04c980a6
MK
1267 ///\r
1268 UINT32 Threshold1Enable:1;\r
1269 ///\r
0f16be6d 1270 /// [Bits 22:16] Threshold #2 Value. If CPUID.01H:EDX[22] = 1.\r
04c980a6
MK
1271 ///\r
1272 UINT32 Threshold2:7;\r
1273 ///\r
0f16be6d 1274 /// [Bit 23] Threshold #2 Interrupt Enable. If CPUID.01H:EDX[22] = 1.\r
04c980a6
MK
1275 ///\r
1276 UINT32 Threshold2Enable:1;\r
1277 ///\r
1278 /// [Bit 24] Power Limit Notification Enable. If CPUID.06H:EAX[4] = 1.\r
1279 ///\r
1280 UINT32 PowerLimitNotificationEnable:1;\r
1281 UINT32 Reserved2:7;\r
1282 UINT32 Reserved3:32;\r
1283 } Bits;\r
1284 ///\r
1285 /// All bit fields as a 32-bit value\r
1286 ///\r
1287 UINT32 Uint32;\r
1288 ///\r
1289 /// All bit fields as a 64-bit value\r
1290 ///\r
1291 UINT64 Uint64;\r
1292} MSR_IA32_THERM_INTERRUPT_REGISTER;\r
1293\r
1294\r
1295/**\r
1296 Thermal Status Information (RO) Contains status information about the\r
1297 processor's thermal sensor and automatic thermal monitoring facilities. See\r
0f16be6d 1298 Section 14.7.2, "Thermal Monitor". If CPUID.01H:EDX[22] = 1.\r
04c980a6
MK
1299\r
1300 @param ECX MSR_IA32_THERM_STATUS (0x0000019C)\r
1301 @param EAX Lower 32-bits of MSR value.\r
1302 Described by the type MSR_IA32_THERM_STATUS_REGISTER.\r
1303 @param EDX Upper 32-bits of MSR value.\r
1304 Described by the type MSR_IA32_THERM_STATUS_REGISTER.\r
1305\r
1306 <b>Example usage</b>\r
1307 @code\r
1308 MSR_IA32_THERM_STATUS_REGISTER Msr;\r
1309\r
1310 Msr.Uint64 = AsmReadMsr64 (MSR_IA32_THERM_STATUS);\r
1311 @endcode\r
7de98828 1312 @note MSR_IA32_THERM_STATUS is defined as IA32_THERM_STATUS in SDM.\r
04c980a6
MK
1313**/\r
1314#define MSR_IA32_THERM_STATUS 0x0000019C\r
1315\r
1316/**\r
1317 MSR information returned for MSR index #MSR_IA32_THERM_STATUS\r
1318**/\r
1319typedef union {\r
1320 ///\r
1321 /// Individual bit fields\r
1322 ///\r
1323 struct {\r
1324 ///\r
0f16be6d 1325 /// [Bit 0] Thermal Status (RO):. If CPUID.01H:EDX[22] = 1.\r
04c980a6
MK
1326 ///\r
1327 UINT32 ThermalStatus:1;\r
1328 ///\r
0f16be6d 1329 /// [Bit 1] Thermal Status Log (R/W):. If CPUID.01H:EDX[22] = 1.\r
04c980a6
MK
1330 ///\r
1331 UINT32 ThermalStatusLog:1;\r
1332 ///\r
0f16be6d 1333 /// [Bit 2] PROCHOT # or FORCEPR# event (RO). If CPUID.01H:EDX[22] = 1.\r
04c980a6
MK
1334 ///\r
1335 UINT32 PROCHOT_FORCEPR_Event:1;\r
1336 ///\r
0f16be6d 1337 /// [Bit 3] PROCHOT # or FORCEPR# log (R/WC0). If CPUID.01H:EDX[22] = 1.\r
04c980a6
MK
1338 ///\r
1339 UINT32 PROCHOT_FORCEPR_Log:1;\r
1340 ///\r
0f16be6d 1341 /// [Bit 4] Critical Temperature Status (RO). If CPUID.01H:EDX[22] = 1.\r
04c980a6
MK
1342 ///\r
1343 UINT32 CriticalTempStatus:1;\r
1344 ///\r
1345 /// [Bit 5] Critical Temperature Status log (R/WC0).\r
0f16be6d 1346 /// If CPUID.01H:EDX[22] = 1.\r
04c980a6
MK
1347 ///\r
1348 UINT32 CriticalTempStatusLog:1;\r
1349 ///\r
1350 /// [Bit 6] Thermal Threshold #1 Status (RO). If CPUID.01H:ECX[8] = 1.\r
1351 ///\r
1352 UINT32 ThermalThreshold1Status:1;\r
1353 ///\r
1354 /// [Bit 7] Thermal Threshold #1 log (R/WC0). If CPUID.01H:ECX[8] = 1.\r
1355 ///\r
1356 UINT32 ThermalThreshold1Log:1;\r
1357 ///\r
1358 /// [Bit 8] Thermal Threshold #2 Status (RO). If CPUID.01H:ECX[8] = 1.\r
1359 ///\r
1360 UINT32 ThermalThreshold2Status:1;\r
1361 ///\r
1362 /// [Bit 9] Thermal Threshold #2 log (R/WC0). If CPUID.01H:ECX[8] = 1.\r
1363 ///\r
1364 UINT32 ThermalThreshold2Log:1;\r
1365 ///\r
1366 /// [Bit 10] Power Limitation Status (RO). If CPUID.06H:EAX[4] = 1.\r
1367 ///\r
1368 UINT32 PowerLimitStatus:1;\r
1369 ///\r
1370 /// [Bit 11] Power Limitation log (R/WC0). If CPUID.06H:EAX[4] = 1.\r
1371 ///\r
1372 UINT32 PowerLimitLog:1;\r
1373 ///\r
1374 /// [Bit 12] Current Limit Status (RO). If CPUID.06H:EAX[7] = 1.\r
1375 ///\r
1376 UINT32 CurrentLimitStatus:1;\r
1377 ///\r
1378 /// [Bit 13] Current Limit log (R/WC0). If CPUID.06H:EAX[7] = 1.\r
1379 ///\r
1380 UINT32 CurrentLimitLog:1;\r
1381 ///\r
1382 /// [Bit 14] Cross Domain Limit Status (RO). If CPUID.06H:EAX[7] = 1.\r
1383 ///\r
1384 UINT32 CrossDomainLimitStatus:1;\r
1385 ///\r
1386 /// [Bit 15] Cross Domain Limit log (R/WC0). If CPUID.06H:EAX[7] = 1.\r
1387 ///\r
1388 UINT32 CrossDomainLimitLog:1;\r
1389 ///\r
1390 /// [Bits 22:16] Digital Readout (RO). If CPUID.06H:EAX[0] = 1.\r
1391 ///\r
1392 UINT32 DigitalReadout:7;\r
1393 UINT32 Reserved1:4;\r
1394 ///\r
1395 /// [Bits 30:27] Resolution in Degrees Celsius (RO). If CPUID.06H:EAX[0] =\r
1396 /// 1.\r
1397 ///\r
1398 UINT32 ResolutionInDegreesCelsius:4;\r
1399 ///\r
1400 /// [Bit 31] Reading Valid (RO). If CPUID.06H:EAX[0] = 1.\r
1401 ///\r
1402 UINT32 ReadingValid:1;\r
1403 UINT32 Reserved2:32;\r
1404 } Bits;\r
1405 ///\r
1406 /// All bit fields as a 32-bit value\r
1407 ///\r
1408 UINT32 Uint32;\r
1409 ///\r
1410 /// All bit fields as a 64-bit value\r
1411 ///\r
1412 UINT64 Uint64;\r
1413} MSR_IA32_THERM_STATUS_REGISTER;\r
1414\r
1415\r
1416/**\r
1417 Enable Misc. Processor Features (R/W) Allows a variety of processor\r
1418 functions to be enabled and disabled.\r
1419\r
1420 @param ECX MSR_IA32_MISC_ENABLE (0x000001A0)\r
1421 @param EAX Lower 32-bits of MSR value.\r
1422 Described by the type MSR_IA32_MISC_ENABLE_REGISTER.\r
1423 @param EDX Upper 32-bits of MSR value.\r
1424 Described by the type MSR_IA32_MISC_ENABLE_REGISTER.\r
1425\r
1426 <b>Example usage</b>\r
1427 @code\r
1428 MSR_IA32_MISC_ENABLE_REGISTER Msr;\r
1429\r
1430 Msr.Uint64 = AsmReadMsr64 (MSR_IA32_MISC_ENABLE);\r
1431 AsmWriteMsr64 (MSR_IA32_MISC_ENABLE, Msr.Uint64);\r
1432 @endcode\r
7de98828 1433 @note MSR_IA32_MISC_ENABLE is defined as IA32_MISC_ENABLE in SDM.\r
04c980a6
MK
1434**/\r
1435#define MSR_IA32_MISC_ENABLE 0x000001A0\r
1436\r
1437/**\r
1438 MSR information returned for MSR index #MSR_IA32_MISC_ENABLE\r
1439**/\r
1440typedef union {\r
1441 ///\r
1442 /// Individual bit fields\r
1443 ///\r
1444 struct {\r
1445 ///\r
1446 /// [Bit 0] Fast-Strings Enable When set, the fast-strings feature (for\r
1447 /// REP MOVS and REP STORS) is enabled (default); when clear, fast-strings\r
1448 /// are disabled. Introduced at Display Family / Display Model 0F_0H.\r
1449 ///\r
1450 UINT32 FastStrings:1;\r
1451 UINT32 Reserved1:2;\r
1452 ///\r
1453 /// [Bit 3] Automatic Thermal Control Circuit Enable (R/W) 1 = Setting\r
1454 /// this bit enables the thermal control circuit (TCC) portion of the\r
1455 /// Intel Thermal Monitor feature. This allows the processor to\r
1456 /// automatically reduce power consumption in response to TCC activation.\r
1457 /// 0 = Disabled. Note: In some products clearing this bit might be\r
1458 /// ignored in critical thermal conditions, and TM1, TM2 and adaptive\r
0f16be6d
HW
1459 /// thermal throttling will still be activated. The default value of this\r
1460 /// field varies with product. See respective tables where default value is\r
1461 /// listed. Introduced at Display Family / Display Model 0F_0H.\r
04c980a6
MK
1462 ///\r
1463 UINT32 AutomaticThermalControlCircuit:1;\r
1464 UINT32 Reserved2:3;\r
1465 ///\r
1466 /// [Bit 7] Performance Monitoring Available (R) 1 = Performance\r
1467 /// monitoring enabled 0 = Performance monitoring disabled. Introduced at\r
1468 /// Display Family / Display Model 0F_0H.\r
1469 ///\r
1470 UINT32 PerformanceMonitoring:1;\r
1471 UINT32 Reserved3:3;\r
1472 ///\r
1473 /// [Bit 11] Branch Trace Storage Unavailable (RO) 1 = Processor doesn't\r
1474 /// support branch trace storage (BTS) 0 = BTS is supported. Introduced at\r
1475 /// Display Family / Display Model 0F_0H.\r
1476 ///\r
1477 UINT32 BTS:1;\r
1478 ///\r
0f16be6d 1479 /// [Bit 12] Processor Event Based Sampling (PEBS) Unavailable (RO) 1 =\r
04c980a6
MK
1480 /// PEBS is not supported; 0 = PEBS is supported. Introduced at Display\r
1481 /// Family / Display Model 06_0FH.\r
1482 ///\r
1483 UINT32 PEBS:1;\r
1484 UINT32 Reserved4:3;\r
1485 ///\r
1486 /// [Bit 16] Enhanced Intel SpeedStep Technology Enable (R/W) 0= Enhanced\r
1487 /// Intel SpeedStep Technology disabled 1 = Enhanced Intel SpeedStep\r
1488 /// Technology enabled. If CPUID.01H: ECX[7] =1.\r
1489 ///\r
1490 UINT32 EIST:1;\r
1491 UINT32 Reserved5:1;\r
1492 ///\r
1493 /// [Bit 18] ENABLE MONITOR FSM (R/W) When this bit is set to 0, the\r
1494 /// MONITOR feature flag is not set (CPUID.01H:ECX[bit 3] = 0). This\r
1495 /// indicates that MONITOR/MWAIT are not supported. Software attempts to\r
1496 /// execute MONITOR/MWAIT will cause #UD when this bit is 0. When this bit\r
1497 /// is set to 1 (default), MONITOR/MWAIT are supported (CPUID.01H:ECX[bit\r
1498 /// 3] = 1). If the SSE3 feature flag ECX[0] is not set (CPUID.01H:ECX[bit\r
1499 /// 0] = 0), the OS must not attempt to alter this bit. BIOS must leave it\r
1500 /// in the default state. Writing this bit when the SSE3 feature flag is\r
1501 /// set to 0 may generate a #GP exception. Introduced at Display Family /\r
1502 /// Display Model 0F_03H.\r
1503 ///\r
1504 UINT32 MONITOR:1;\r
1505 UINT32 Reserved6:3;\r
1506 ///\r
1507 /// [Bit 22] Limit CPUID Maxval (R/W) When this bit is set to 1, CPUID.00H\r
0f16be6d 1508 /// returns a maximum value in EAX[7:0] of 2. BIOS should contain a setup\r
04c980a6 1509 /// question that allows users to specify when the installed OS does not\r
0f16be6d 1510 /// support CPUID functions greater than 2. Before setting this bit, BIOS\r
04c980a6 1511 /// must execute the CPUID.0H and examine the maximum value returned in\r
0f16be6d
HW
1512 /// EAX[7:0]. If the maximum value is greater than 2, this bit is\r
1513 /// supported. Otherwise, this bit is not supported. Setting this bit when\r
1514 /// the maximum value is not greater than 2 may generate a #GP exception.\r
04c980a6 1515 /// Setting this bit may cause unexpected behavior in software that\r
0f16be6d 1516 /// depends on the availability of CPUID leaves greater than 2. Introduced\r
04c980a6
MK
1517 /// at Display Family / Display Model 0F_03H.\r
1518 ///\r
1519 UINT32 LimitCpuidMaxval:1;\r
1520 ///\r
1521 /// [Bit 23] xTPR Message Disable (R/W) When set to 1, xTPR messages are\r
1522 /// disabled. xTPR messages are optional messages that allow the processor\r
1523 /// to inform the chipset of its priority. if CPUID.01H:ECX[14] = 1.\r
1524 ///\r
1525 UINT32 xTPR_Message_Disable:1;\r
1526 UINT32 Reserved7:8;\r
1527 UINT32 Reserved8:2;\r
1528 ///\r
1529 /// [Bit 34] XD Bit Disable (R/W) When set to 1, the Execute Disable Bit\r
1530 /// feature (XD Bit) is disabled and the XD Bit extended feature flag will\r
1531 /// be clear (CPUID.80000001H: EDX[20]=0). When set to a 0 (default), the\r
1532 /// Execute Disable Bit feature (if available) allows the OS to enable PAE\r
1533 /// paging and take advantage of data only pages. BIOS must not alter the\r
1534 /// contents of this bit location, if XD bit is not supported. Writing\r
1535 /// this bit to 1 when the XD Bit extended feature flag is set to 0 may\r
1536 /// generate a #GP exception. if CPUID.80000001H:EDX[2 0] = 1.\r
1537 ///\r
1538 UINT32 XD:1;\r
1539 UINT32 Reserved9:29;\r
1540 } Bits;\r
1541 ///\r
1542 /// All bit fields as a 64-bit value\r
1543 ///\r
1544 UINT64 Uint64;\r
1545} MSR_IA32_MISC_ENABLE_REGISTER;\r
1546\r
1547\r
1548/**\r
1549 Performance Energy Bias Hint (R/W). if CPUID.6H:ECX[3] = 1.\r
1550\r
1551 @param ECX MSR_IA32_ENERGY_PERF_BIAS (0x000001B0)\r
1552 @param EAX Lower 32-bits of MSR value.\r
1553 Described by the type MSR_IA32_ENERGY_PERF_BIAS_REGISTER.\r
1554 @param EDX Upper 32-bits of MSR value.\r
1555 Described by the type MSR_IA32_ENERGY_PERF_BIAS_REGISTER.\r
1556\r
1557 <b>Example usage</b>\r
1558 @code\r
1559 MSR_IA32_ENERGY_PERF_BIAS_REGISTER Msr;\r
1560\r
1561 Msr.Uint64 = AsmReadMsr64 (MSR_IA32_ENERGY_PERF_BIAS);\r
1562 AsmWriteMsr64 (MSR_IA32_ENERGY_PERF_BIAS, Msr.Uint64);\r
1563 @endcode\r
7de98828 1564 @note MSR_IA32_ENERGY_PERF_BIAS is defined as IA32_ENERGY_PERF_BIAS in SDM.\r
04c980a6
MK
1565**/\r
1566#define MSR_IA32_ENERGY_PERF_BIAS 0x000001B0\r
1567\r
1568/**\r
1569 MSR information returned for MSR index #MSR_IA32_ENERGY_PERF_BIAS\r
1570**/\r
1571typedef union {\r
1572 ///\r
1573 /// Individual bit fields\r
1574 ///\r
1575 struct {\r
1576 ///\r
1577 /// [Bits 3:0] Power Policy Preference: 0 indicates preference to highest\r
1578 /// performance. 15 indicates preference to maximize energy saving.\r
1579 ///\r
1580 UINT32 PowerPolicyPreference:4;\r
1581 UINT32 Reserved1:28;\r
1582 UINT32 Reserved2:32;\r
1583 } Bits;\r
1584 ///\r
1585 /// All bit fields as a 32-bit value\r
1586 ///\r
1587 UINT32 Uint32;\r
1588 ///\r
1589 /// All bit fields as a 64-bit value\r
1590 ///\r
1591 UINT64 Uint64;\r
1592} MSR_IA32_ENERGY_PERF_BIAS_REGISTER;\r
1593\r
1594\r
1595/**\r
1596 Package Thermal Status Information (RO) Contains status information about\r
1597 the package's thermal sensor. See Section 14.8, "Package Level Thermal\r
1598 Management.". If CPUID.06H: EAX[6] = 1.\r
1599\r
1600 @param ECX MSR_IA32_PACKAGE_THERM_STATUS (0x000001B1)\r
1601 @param EAX Lower 32-bits of MSR value.\r
1602 Described by the type MSR_IA32_PACKAGE_THERM_STATUS_REGISTER.\r
1603 @param EDX Upper 32-bits of MSR value.\r
1604 Described by the type MSR_IA32_PACKAGE_THERM_STATUS_REGISTER.\r
1605\r
1606 <b>Example usage</b>\r
1607 @code\r
1608 MSR_IA32_PACKAGE_THERM_STATUS_REGISTER Msr;\r
1609\r
1610 Msr.Uint64 = AsmReadMsr64 (MSR_IA32_PACKAGE_THERM_STATUS);\r
1611 @endcode\r
7de98828 1612 @note MSR_IA32_PACKAGE_THERM_STATUS is defined as IA32_PACKAGE_THERM_STATUS in SDM.\r
04c980a6
MK
1613**/\r
1614#define MSR_IA32_PACKAGE_THERM_STATUS 0x000001B1\r
1615\r
1616/**\r
1617 MSR information returned for MSR index #MSR_IA32_PACKAGE_THERM_STATUS\r
1618**/\r
1619typedef union {\r
1620 ///\r
1621 /// Individual bit fields\r
1622 ///\r
1623 struct {\r
1624 ///\r
1625 /// [Bit 0] Pkg Thermal Status (RO):.\r
1626 ///\r
1627 UINT32 ThermalStatus:1;\r
1628 ///\r
1629 /// [Bit 1] Pkg Thermal Status Log (R/W):.\r
1630 ///\r
1631 UINT32 ThermalStatusLog:1;\r
1632 ///\r
1633 /// [Bit 2] Pkg PROCHOT # event (RO).\r
1634 ///\r
1635 UINT32 PROCHOT_Event:1;\r
1636 ///\r
1637 /// [Bit 3] Pkg PROCHOT # log (R/WC0).\r
1638 ///\r
1639 UINT32 PROCHOT_Log:1;\r
1640 ///\r
1641 /// [Bit 4] Pkg Critical Temperature Status (RO).\r
1642 ///\r
1643 UINT32 CriticalTempStatus:1;\r
1644 ///\r
1645 /// [Bit 5] Pkg Critical Temperature Status log (R/WC0).\r
1646 ///\r
1647 UINT32 CriticalTempStatusLog:1;\r
1648 ///\r
1649 /// [Bit 6] Pkg Thermal Threshold #1 Status (RO).\r
1650 ///\r
1651 UINT32 ThermalThreshold1Status:1;\r
1652 ///\r
1653 /// [Bit 7] Pkg Thermal Threshold #1 log (R/WC0).\r
1654 ///\r
1655 UINT32 ThermalThreshold1Log:1;\r
1656 ///\r
1657 /// [Bit 8] Pkg Thermal Threshold #2 Status (RO).\r
1658 ///\r
1659 UINT32 ThermalThreshold2Status:1;\r
1660 ///\r
1661 /// [Bit 9] Pkg Thermal Threshold #1 log (R/WC0).\r
1662 ///\r
1663 UINT32 ThermalThreshold2Log:1;\r
1664 ///\r
1665 /// [Bit 10] Pkg Power Limitation Status (RO).\r
1666 ///\r
1667 UINT32 PowerLimitStatus:1;\r
1668 ///\r
1669 /// [Bit 11] Pkg Power Limitation log (R/WC0).\r
1670 ///\r
1671 UINT32 PowerLimitLog:1;\r
1672 UINT32 Reserved1:4;\r
1673 ///\r
1674 /// [Bits 22:16] Pkg Digital Readout (RO).\r
1675 ///\r
1676 UINT32 DigitalReadout:7;\r
1677 UINT32 Reserved2:9;\r
1678 UINT32 Reserved3:32;\r
1679 } Bits;\r
1680 ///\r
1681 /// All bit fields as a 32-bit value\r
1682 ///\r
1683 UINT32 Uint32;\r
1684 ///\r
1685 /// All bit fields as a 64-bit value\r
1686 ///\r
1687 UINT64 Uint64;\r
1688} MSR_IA32_PACKAGE_THERM_STATUS_REGISTER;\r
1689\r
1690\r
1691/**\r
1692 Pkg Thermal Interrupt Control (R/W) Enables and disables the generation of\r
1693 an interrupt on temperature transitions detected with the package's thermal\r
1694 sensor. See Section 14.8, "Package Level Thermal Management.". If CPUID.06H:\r
1695 EAX[6] = 1.\r
1696\r
1697 @param ECX MSR_IA32_PACKAGE_THERM_INTERRUPT (0x000001B2)\r
1698 @param EAX Lower 32-bits of MSR value.\r
1699 Described by the type MSR_IA32_PACKAGE_THERM_INTERRUPT_REGISTER.\r
1700 @param EDX Upper 32-bits of MSR value.\r
1701 Described by the type MSR_IA32_PACKAGE_THERM_INTERRUPT_REGISTER.\r
1702\r
1703 <b>Example usage</b>\r
1704 @code\r
1705 MSR_IA32_PACKAGE_THERM_INTERRUPT_REGISTER Msr;\r
1706\r
1707 Msr.Uint64 = AsmReadMsr64 (MSR_IA32_PACKAGE_THERM_INTERRUPT);\r
1708 AsmWriteMsr64 (MSR_IA32_PACKAGE_THERM_INTERRUPT, Msr.Uint64);\r
1709 @endcode\r
7de98828 1710 @note MSR_IA32_PACKAGE_THERM_INTERRUPT is defined as IA32_PACKAGE_THERM_INTERRUPT in SDM.\r
04c980a6
MK
1711**/\r
1712#define MSR_IA32_PACKAGE_THERM_INTERRUPT 0x000001B2\r
1713\r
1714/**\r
1715 MSR information returned for MSR index #MSR_IA32_PACKAGE_THERM_INTERRUPT\r
1716**/\r
1717typedef union {\r
1718 ///\r
1719 /// Individual bit fields\r
1720 ///\r
1721 struct {\r
1722 ///\r
1723 /// [Bit 0] Pkg High-Temperature Interrupt Enable.\r
1724 ///\r
1725 UINT32 HighTempEnable:1;\r
1726 ///\r
1727 /// [Bit 1] Pkg Low-Temperature Interrupt Enable.\r
1728 ///\r
1729 UINT32 LowTempEnable:1;\r
1730 ///\r
1731 /// [Bit 2] Pkg PROCHOT# Interrupt Enable.\r
1732 ///\r
1733 UINT32 PROCHOT_Enable:1;\r
1734 UINT32 Reserved1:1;\r
1735 ///\r
1736 /// [Bit 4] Pkg Overheat Interrupt Enable.\r
1737 ///\r
1738 UINT32 OverheatEnable:1;\r
1739 UINT32 Reserved2:3;\r
1740 ///\r
1741 /// [Bits 14:8] Pkg Threshold #1 Value.\r
1742 ///\r
1743 UINT32 Threshold1:7;\r
1744 ///\r
1745 /// [Bit 15] Pkg Threshold #1 Interrupt Enable.\r
1746 ///\r
1747 UINT32 Threshold1Enable:1;\r
1748 ///\r
1749 /// [Bits 22:16] Pkg Threshold #2 Value.\r
1750 ///\r
1751 UINT32 Threshold2:7;\r
1752 ///\r
1753 /// [Bit 23] Pkg Threshold #2 Interrupt Enable.\r
1754 ///\r
1755 UINT32 Threshold2Enable:1;\r
1756 ///\r
1757 /// [Bit 24] Pkg Power Limit Notification Enable.\r
1758 ///\r
1759 UINT32 PowerLimitNotificationEnable:1;\r
1760 UINT32 Reserved3:7;\r
1761 UINT32 Reserved4:32;\r
1762 } Bits;\r
1763 ///\r
1764 /// All bit fields as a 32-bit value\r
1765 ///\r
1766 UINT32 Uint32;\r
1767 ///\r
1768 /// All bit fields as a 64-bit value\r
1769 ///\r
1770 UINT64 Uint64;\r
1771} MSR_IA32_PACKAGE_THERM_INTERRUPT_REGISTER;\r
1772\r
1773\r
1774/**\r
1775 Trace/Profile Resource Control (R/W). Introduced at Display Family / Display\r
1776 Model 06_0EH.\r
1777\r
1778 @param ECX MSR_IA32_DEBUGCTL (0x000001D9)\r
1779 @param EAX Lower 32-bits of MSR value.\r
1780 Described by the type MSR_IA32_DEBUGCTL_REGISTER.\r
1781 @param EDX Upper 32-bits of MSR value.\r
1782 Described by the type MSR_IA32_DEBUGCTL_REGISTER.\r
1783\r
1784 <b>Example usage</b>\r
1785 @code\r
1786 MSR_IA32_DEBUGCTL_REGISTER Msr;\r
1787\r
1788 Msr.Uint64 = AsmReadMsr64 (MSR_IA32_DEBUGCTL);\r
1789 AsmWriteMsr64 (MSR_IA32_DEBUGCTL, Msr.Uint64);\r
1790 @endcode\r
7de98828 1791 @note MSR_IA32_DEBUGCTL is defined as IA32_DEBUGCTL in SDM.\r
04c980a6
MK
1792**/\r
1793#define MSR_IA32_DEBUGCTL 0x000001D9\r
1794\r
1795/**\r
1796 MSR information returned for MSR index #MSR_IA32_DEBUGCTL\r
1797**/\r
1798typedef union {\r
1799 ///\r
1800 /// Individual bit fields\r
1801 ///\r
1802 struct {\r
1803 ///\r
1804 /// [Bit 0] LBR: Setting this bit to 1 enables the processor to record a\r
1805 /// running trace of the most recent branches taken by the processor in\r
1806 /// the LBR stack. Introduced at Display Family / Display Model 06_01H.\r
1807 ///\r
1808 UINT32 LBR:1;\r
1809 ///\r
1810 /// [Bit 1] BTF: Setting this bit to 1 enables the processor to treat\r
1811 /// EFLAGS.TF as single-step on branches instead of single-step on\r
1812 /// instructions. Introduced at Display Family / Display Model 06_01H.\r
1813 ///\r
1814 UINT32 BTF:1;\r
1815 UINT32 Reserved1:4;\r
1816 ///\r
1817 /// [Bit 6] TR: Setting this bit to 1 enables branch trace messages to be\r
1818 /// sent. Introduced at Display Family / Display Model 06_0EH.\r
1819 ///\r
1820 UINT32 TR:1;\r
1821 ///\r
1822 /// [Bit 7] BTS: Setting this bit enables branch trace messages (BTMs) to\r
1823 /// be logged in a BTS buffer. Introduced at Display Family / Display\r
1824 /// Model 06_0EH.\r
1825 ///\r
1826 UINT32 BTS:1;\r
1827 ///\r
1828 /// [Bit 8] BTINT: When clear, BTMs are logged in a BTS buffer in circular\r
1829 /// fashion. When this bit is set, an interrupt is generated by the BTS\r
1830 /// facility when the BTS buffer is full. Introduced at Display Family /\r
1831 /// Display Model 06_0EH.\r
1832 ///\r
1833 UINT32 BTINT:1;\r
1834 ///\r
1835 /// [Bit 9] BTS_OFF_OS: When set, BTS or BTM is skipped if CPL = 0.\r
1836 /// Introduced at Display Family / Display Model 06_0FH.\r
1837 ///\r
1838 UINT32 BTS_OFF_OS:1;\r
1839 ///\r
1840 /// [Bit 10] BTS_OFF_USR: When set, BTS or BTM is skipped if CPL > 0.\r
1841 /// Introduced at Display Family / Display Model 06_0FH.\r
1842 ///\r
1843 UINT32 BTS_OFF_USR:1;\r
1844 ///\r
1845 /// [Bit 11] FREEZE_LBRS_ON_PMI: When set, the LBR stack is frozen on a\r
1846 /// PMI request. If CPUID.01H: ECX[15] = 1 && CPUID.0AH: EAX[7:0] > 1.\r
1847 ///\r
1848 UINT32 FREEZE_LBRS_ON_PMI:1;\r
1849 ///\r
1850 /// [Bit 12] FREEZE_PERFMON_ON_PMI: When set, each ENABLE bit of the\r
1851 /// global counter control MSR are frozen (address 38FH) on a PMI request.\r
1852 /// If CPUID.01H: ECX[15] = 1 && CPUID.0AH: EAX[7:0] > 1.\r
1853 ///\r
1854 UINT32 FREEZE_PERFMON_ON_PMI:1;\r
1855 ///\r
1856 /// [Bit 13] ENABLE_UNCORE_PMI: When set, enables the logical processor to\r
1857 /// receive and generate PMI on behalf of the uncore. Introduced at\r
1858 /// Display Family / Display Model 06_1AH.\r
1859 ///\r
1860 UINT32 ENABLE_UNCORE_PMI:1;\r
1861 ///\r
1862 /// [Bit 14] FREEZE_WHILE_SMM: When set, freezes perfmon and trace\r
1863 /// messages while in SMM. If IA32_PERF_CAPABILITIES[ 12] = 1.\r
1864 ///\r
1865 UINT32 FREEZE_WHILE_SMM:1;\r
1866 ///\r
1867 /// [Bit 15] RTM_DEBUG: When set, enables DR7 debug bit on XBEGIN. If\r
1868 /// (CPUID.(EAX=07H, ECX=0):EBX[11] = 1).\r
1869 ///\r
1870 UINT32 RTM_DEBUG:1;\r
1871 UINT32 Reserved2:16;\r
1872 UINT32 Reserved3:32;\r
1873 } Bits;\r
1874 ///\r
1875 /// All bit fields as a 32-bit value\r
1876 ///\r
1877 UINT32 Uint32;\r
1878 ///\r
1879 /// All bit fields as a 64-bit value\r
1880 ///\r
1881 UINT64 Uint64;\r
1882} MSR_IA32_DEBUGCTL_REGISTER;\r
1883\r
1884\r
1885/**\r
1886 SMRR Base Address (Writeable only in SMM) Base address of SMM memory range.\r
1887 If IA32_MTRRCAP.SMRR[11] = 1.\r
1888\r
1889 @param ECX MSR_IA32_SMRR_PHYSBASE (0x000001F2)\r
1890 @param EAX Lower 32-bits of MSR value.\r
1891 Described by the type MSR_IA32_SMRR_PHYSBASE_REGISTER.\r
1892 @param EDX Upper 32-bits of MSR value.\r
1893 Described by the type MSR_IA32_SMRR_PHYSBASE_REGISTER.\r
1894\r
1895 <b>Example usage</b>\r
1896 @code\r
1897 MSR_IA32_SMRR_PHYSBASE_REGISTER Msr;\r
1898\r
1899 Msr.Uint64 = AsmReadMsr64 (MSR_IA32_SMRR_PHYSBASE);\r
1900 AsmWriteMsr64 (MSR_IA32_SMRR_PHYSBASE, Msr.Uint64);\r
1901 @endcode\r
7de98828 1902 @note MSR_IA32_SMRR_PHYSBASE is defined as IA32_SMRR_PHYSBASE in SDM.\r
04c980a6
MK
1903**/\r
1904#define MSR_IA32_SMRR_PHYSBASE 0x000001F2\r
1905\r
1906/**\r
1907 MSR information returned for MSR index #MSR_IA32_SMRR_PHYSBASE\r
1908**/\r
1909typedef union {\r
1910 ///\r
1911 /// Individual bit fields\r
1912 ///\r
1913 struct {\r
1914 ///\r
1915 /// [Bits 7:0] Type. Specifies memory type of the range.\r
1916 ///\r
1917 UINT32 Type:8;\r
1918 UINT32 Reserved1:4;\r
1919 ///\r
1920 /// [Bits 31:12] PhysBase. SMRR physical Base Address.\r
1921 ///\r
1922 UINT32 PhysBase:20;\r
1923 UINT32 Reserved2:32;\r
1924 } Bits;\r
1925 ///\r
1926 /// All bit fields as a 32-bit value\r
1927 ///\r
1928 UINT32 Uint32;\r
1929 ///\r
1930 /// All bit fields as a 64-bit value\r
1931 ///\r
1932 UINT64 Uint64;\r
1933} MSR_IA32_SMRR_PHYSBASE_REGISTER;\r
1934\r
1935\r
1936/**\r
1937 SMRR Range Mask. (Writeable only in SMM) Range Mask of SMM memory range. If\r
1938 IA32_MTRRCAP[SMRR] = 1.\r
1939\r
1940 @param ECX MSR_IA32_SMRR_PHYSMASK (0x000001F3)\r
1941 @param EAX Lower 32-bits of MSR value.\r
1942 Described by the type MSR_IA32_SMRR_PHYSMASK_REGISTER.\r
1943 @param EDX Upper 32-bits of MSR value.\r
1944 Described by the type MSR_IA32_SMRR_PHYSMASK_REGISTER.\r
1945\r
1946 <b>Example usage</b>\r
1947 @code\r
1948 MSR_IA32_SMRR_PHYSMASK_REGISTER Msr;\r
1949\r
1950 Msr.Uint64 = AsmReadMsr64 (MSR_IA32_SMRR_PHYSMASK);\r
1951 AsmWriteMsr64 (MSR_IA32_SMRR_PHYSMASK, Msr.Uint64);\r
1952 @endcode\r
7de98828 1953 @note MSR_IA32_SMRR_PHYSMASK is defined as IA32_SMRR_PHYSMASK in SDM.\r
04c980a6
MK
1954**/\r
1955#define MSR_IA32_SMRR_PHYSMASK 0x000001F3\r
1956\r
1957/**\r
1958 MSR information returned for MSR index #MSR_IA32_SMRR_PHYSMASK\r
1959**/\r
1960typedef union {\r
1961 ///\r
1962 /// Individual bit fields\r
1963 ///\r
1964 struct {\r
1965 UINT32 Reserved1:11;\r
1966 ///\r
1967 /// [Bit 11] Valid Enable range mask.\r
1968 ///\r
1969 UINT32 Valid:1;\r
1970 ///\r
1971 /// [Bits 31:12] PhysMask SMRR address range mask.\r
1972 ///\r
1973 UINT32 PhysMask:20;\r
1974 UINT32 Reserved2:32;\r
1975 } Bits;\r
1976 ///\r
1977 /// All bit fields as a 32-bit value\r
1978 ///\r
1979 UINT32 Uint32;\r
1980 ///\r
1981 /// All bit fields as a 64-bit value\r
1982 ///\r
1983 UINT64 Uint64;\r
1984} MSR_IA32_SMRR_PHYSMASK_REGISTER;\r
1985\r
1986\r
1987/**\r
1988 DCA Capability (R). If CPUID.01H: ECX[18] = 1.\r
1989\r
1990 @param ECX MSR_IA32_PLATFORM_DCA_CAP (0x000001F8)\r
1991 @param EAX Lower 32-bits of MSR value.\r
1992 @param EDX Upper 32-bits of MSR value.\r
1993\r
1994 <b>Example usage</b>\r
1995 @code\r
1996 UINT64 Msr;\r
1997\r
1998 Msr = AsmReadMsr64 (MSR_IA32_PLATFORM_DCA_CAP);\r
1999 @endcode\r
7de98828 2000 @note MSR_IA32_PLATFORM_DCA_CAP is defined as IA32_PLATFORM_DCA_CAP in SDM.\r
04c980a6
MK
2001**/\r
2002#define MSR_IA32_PLATFORM_DCA_CAP 0x000001F8\r
2003\r
2004\r
2005/**\r
2006 If set, CPU supports Prefetch-Hint type. If CPUID.01H: ECX[18] = 1.\r
2007\r
2008 @param ECX MSR_IA32_CPU_DCA_CAP (0x000001F9)\r
2009 @param EAX Lower 32-bits of MSR value.\r
2010 @param EDX Upper 32-bits of MSR value.\r
2011\r
2012 <b>Example usage</b>\r
2013 @code\r
2014 UINT64 Msr;\r
2015\r
2016 Msr = AsmReadMsr64 (MSR_IA32_CPU_DCA_CAP);\r
2017 AsmWriteMsr64 (MSR_IA32_CPU_DCA_CAP, Msr);\r
2018 @endcode\r
7de98828 2019 @note MSR_IA32_CPU_DCA_CAP is defined as IA32_CPU_DCA_CAP in SDM.\r
04c980a6
MK
2020**/\r
2021#define MSR_IA32_CPU_DCA_CAP 0x000001F9\r
2022\r
2023\r
2024/**\r
2025 DCA type 0 Status and Control register. If CPUID.01H: ECX[18] = 1.\r
2026\r
2027 @param ECX MSR_IA32_DCA_0_CAP (0x000001FA)\r
2028 @param EAX Lower 32-bits of MSR value.\r
2029 Described by the type MSR_IA32_DCA_0_CAP_REGISTER.\r
2030 @param EDX Upper 32-bits of MSR value.\r
2031 Described by the type MSR_IA32_DCA_0_CAP_REGISTER.\r
2032\r
2033 <b>Example usage</b>\r
2034 @code\r
2035 MSR_IA32_DCA_0_CAP_REGISTER Msr;\r
2036\r
2037 Msr.Uint64 = AsmReadMsr64 (MSR_IA32_DCA_0_CAP);\r
2038 AsmWriteMsr64 (MSR_IA32_DCA_0_CAP, Msr.Uint64);\r
2039 @endcode\r
7de98828 2040 @note MSR_IA32_DCA_0_CAP is defined as IA32_DCA_0_CAP in SDM.\r
04c980a6
MK
2041**/\r
2042#define MSR_IA32_DCA_0_CAP 0x000001FA\r
2043\r
2044/**\r
2045 MSR information returned for MSR index #MSR_IA32_DCA_0_CAP\r
2046**/\r
2047typedef union {\r
2048 ///\r
2049 /// Individual bit fields\r
2050 ///\r
2051 struct {\r
2052 ///\r
2053 /// [Bit 0] DCA_ACTIVE: Set by HW when DCA is fuseenabled and no\r
2054 /// defeatures are set.\r
2055 ///\r
2056 UINT32 DCA_ACTIVE:1;\r
2057 ///\r
2058 /// [Bits 2:1] TRANSACTION.\r
2059 ///\r
2060 UINT32 TRANSACTION:2;\r
2061 ///\r
2062 /// [Bits 6:3] DCA_TYPE.\r
2063 ///\r
2064 UINT32 DCA_TYPE:4;\r
2065 ///\r
2066 /// [Bits 10:7] DCA_QUEUE_SIZE.\r
2067 ///\r
2068 UINT32 DCA_QUEUE_SIZE:4;\r
2069 UINT32 Reserved1:2;\r
2070 ///\r
2071 /// [Bits 16:13] DCA_DELAY: Writes will update the register but have no HW\r
2072 /// side-effect.\r
2073 ///\r
2074 UINT32 DCA_DELAY:4;\r
2075 UINT32 Reserved2:7;\r
2076 ///\r
2077 /// [Bit 24] SW_BLOCK: SW can request DCA block by setting this bit.\r
2078 ///\r
2079 UINT32 SW_BLOCK:1;\r
2080 UINT32 Reserved3:1;\r
2081 ///\r
2082 /// [Bit 26] HW_BLOCK: Set when DCA is blocked by HW (e.g. CR0.CD = 1).\r
2083 ///\r
2084 UINT32 HW_BLOCK:1;\r
2085 UINT32 Reserved4:5;\r
2086 UINT32 Reserved5:32;\r
2087 } Bits;\r
2088 ///\r
2089 /// All bit fields as a 32-bit value\r
2090 ///\r
2091 UINT32 Uint32;\r
2092 ///\r
2093 /// All bit fields as a 64-bit value\r
2094 ///\r
2095 UINT64 Uint64;\r
2096} MSR_IA32_DCA_0_CAP_REGISTER;\r
2097\r
2098\r
2099/**\r
2100 MTRRphysBasen. See Section 11.11.2.3, "Variable Range MTRRs".\r
2101 If CPUID.01H: EDX.MTRR[12] = 1 and IA32_MTRRCAP[7:0] > n.\r
2102\r
2103 @param ECX MSR_IA32_MTRR_PHYSBASEn\r
2104 @param EAX Lower 32-bits of MSR value.\r
2105 Described by the type MSR_IA32_MTRR_PHYSBASE_REGISTER.\r
2106 @param EDX Upper 32-bits of MSR value.\r
2107 Described by the type MSR_IA32_MTRR_PHYSBASE_REGISTER.\r
2108\r
2109 <b>Example usage</b>\r
2110 @code\r
2111 MSR_IA32_MTRR_PHYSBASE_REGISTER Msr;\r
2112\r
2113 Msr.Uint64 = AsmReadMsr64 (MSR_IA32_MTRR_PHYSBASE0);\r
2114 AsmWriteMsr64 (MSR_IA32_MTRR_PHYSBASE0, Msr.Uint64);\r
2115 @endcode\r
7de98828
JF
2116 @note MSR_IA32_MTRR_PHYSBASE0 is defined as IA32_MTRR_PHYSBASE0 in SDM.\r
2117 MSR_IA32_MTRR_PHYSBASE1 is defined as IA32_MTRR_PHYSBASE1 in SDM.\r
2118 MSR_IA32_MTRR_PHYSBASE2 is defined as IA32_MTRR_PHYSBASE2 in SDM.\r
2119 MSR_IA32_MTRR_PHYSBASE3 is defined as IA32_MTRR_PHYSBASE3 in SDM.\r
2120 MSR_IA32_MTRR_PHYSBASE4 is defined as IA32_MTRR_PHYSBASE4 in SDM.\r
2121 MSR_IA32_MTRR_PHYSBASE5 is defined as IA32_MTRR_PHYSBASE5 in SDM.\r
2122 MSR_IA32_MTRR_PHYSBASE6 is defined as IA32_MTRR_PHYSBASE6 in SDM.\r
2123 MSR_IA32_MTRR_PHYSBASE7 is defined as IA32_MTRR_PHYSBASE7 in SDM.\r
2124 MSR_IA32_MTRR_PHYSBASE8 is defined as IA32_MTRR_PHYSBASE8 in SDM.\r
2125 MSR_IA32_MTRR_PHYSBASE9 is defined as IA32_MTRR_PHYSBASE9 in SDM.\r
04c980a6
MK
2126 @{\r
2127**/\r
2128#define MSR_IA32_MTRR_PHYSBASE0 0x00000200\r
2129#define MSR_IA32_MTRR_PHYSBASE1 0x00000202\r
2130#define MSR_IA32_MTRR_PHYSBASE2 0x00000204\r
2131#define MSR_IA32_MTRR_PHYSBASE3 0x00000206\r
2132#define MSR_IA32_MTRR_PHYSBASE4 0x00000208\r
2133#define MSR_IA32_MTRR_PHYSBASE5 0x0000020A\r
2134#define MSR_IA32_MTRR_PHYSBASE6 0x0000020C\r
2135#define MSR_IA32_MTRR_PHYSBASE7 0x0000020E\r
2136#define MSR_IA32_MTRR_PHYSBASE8 0x00000210\r
2137#define MSR_IA32_MTRR_PHYSBASE9 0x00000212\r
2138/// @}\r
2139\r
2140/**\r
2141 MSR information returned for MSR indexes #MSR_IA32_MTRR_PHYSBASE0 to\r
2142 #MSR_IA32_MTRR_PHYSBASE9\r
2143**/\r
2144typedef union {\r
2145 ///\r
2146 /// Individual bit fields\r
2147 ///\r
2148 struct {\r
2149 ///\r
2150 /// [Bits 7:0] Type. Specifies memory type of the range.\r
2151 ///\r
2152 UINT32 Type:8;\r
2153 UINT32 Reserved1:4;\r
2154 ///\r
2155 /// [Bits 31:12] PhysBase. MTRR physical Base Address.\r
2156 ///\r
2157 UINT32 PhysBase:20;\r
2158 ///\r
2159 /// [Bits MAXPHYSADDR:32] PhysBase. Upper bits of MTRR physical Base Address.\r
2160 /// MAXPHYADDR: The bit position indicated by MAXPHYADDR depends on the\r
2161 /// maximum physical address range supported by the processor. It is\r
2162 /// reported by CPUID leaf function 80000008H. If CPUID does not support\r
2163 /// leaf 80000008H, the processor supports 36-bit physical address size,\r
2164 /// then bit PhysMask consists of bits 35:12, and bits 63:36 are reserved.\r
2165 ///\r
2166 UINT32 PhysBaseHi:32;\r
2167 } Bits;\r
2168 ///\r
2169 /// All bit fields as a 64-bit value\r
2170 ///\r
2171 UINT64 Uint64;\r
2172} MSR_IA32_MTRR_PHYSBASE_REGISTER;\r
2173\r
2174\r
2175/**\r
2176 MTRRphysMaskn. See Section 11.11.2.3, "Variable Range MTRRs".\r
2177 If CPUID.01H: EDX.MTRR[12] = 1 and IA32_MTRRCAP[7:0] > n.\r
2178\r
2179 @param ECX MSR_IA32_MTRR_PHYSMASKn\r
2180 @param EAX Lower 32-bits of MSR value.\r
2181 Described by the type MSR_IA32_MTRR_PHYSMASK_REGISTER.\r
2182 @param EDX Upper 32-bits of MSR value.\r
2183 Described by the type MSR_IA32_MTRR_PHYSMASK_REGISTER.\r
2184\r
2185 <b>Example usage</b>\r
2186 @code\r
2187 MSR_IA32_MTRR_PHYSMASK_REGISTER Msr;\r
2188\r
2189 Msr.Uint64 = AsmReadMsr64 (MSR_IA32_MTRR_PHYSMASK0);\r
2190 AsmWriteMsr64 (MSR_IA32_MTRR_PHYSMASK0, Msr.Uint64);\r
2191 @endcode\r
7de98828
JF
2192 @note MSR_IA32_MTRR_PHYSMASK0 is defined as IA32_MTRR_PHYSMASK0 in SDM.\r
2193 MSR_IA32_MTRR_PHYSMASK1 is defined as IA32_MTRR_PHYSMASK1 in SDM.\r
2194 MSR_IA32_MTRR_PHYSMASK2 is defined as IA32_MTRR_PHYSMASK2 in SDM.\r
2195 MSR_IA32_MTRR_PHYSMASK3 is defined as IA32_MTRR_PHYSMASK3 in SDM.\r
2196 MSR_IA32_MTRR_PHYSMASK4 is defined as IA32_MTRR_PHYSMASK4 in SDM.\r
2197 MSR_IA32_MTRR_PHYSMASK5 is defined as IA32_MTRR_PHYSMASK5 in SDM.\r
2198 MSR_IA32_MTRR_PHYSMASK6 is defined as IA32_MTRR_PHYSMASK6 in SDM.\r
2199 MSR_IA32_MTRR_PHYSMASK7 is defined as IA32_MTRR_PHYSMASK7 in SDM.\r
2200 MSR_IA32_MTRR_PHYSMASK8 is defined as IA32_MTRR_PHYSMASK8 in SDM.\r
2201 MSR_IA32_MTRR_PHYSMASK9 is defined as IA32_MTRR_PHYSMASK9 in SDM.\r
04c980a6
MK
2202 @{\r
2203**/\r
2204#define MSR_IA32_MTRR_PHYSMASK0 0x00000201\r
2205#define MSR_IA32_MTRR_PHYSMASK1 0x00000203\r
2206#define MSR_IA32_MTRR_PHYSMASK2 0x00000205\r
2207#define MSR_IA32_MTRR_PHYSMASK3 0x00000207\r
2208#define MSR_IA32_MTRR_PHYSMASK4 0x00000209\r
2209#define MSR_IA32_MTRR_PHYSMASK5 0x0000020B\r
2210#define MSR_IA32_MTRR_PHYSMASK6 0x0000020D\r
2211#define MSR_IA32_MTRR_PHYSMASK7 0x0000020F\r
2212#define MSR_IA32_MTRR_PHYSMASK8 0x00000211\r
2213#define MSR_IA32_MTRR_PHYSMASK9 0x00000213\r
2214/// @}\r
2215\r
2216/**\r
2217 MSR information returned for MSR indexes #MSR_IA32_MTRR_PHYSMASK0 to\r
2218 #MSR_IA32_MTRR_PHYSMASK9\r
2219**/\r
2220typedef union {\r
2221 ///\r
2222 /// Individual bit fields\r
2223 ///\r
2224 struct {\r
2225 UINT32 Reserved1:11;\r
2226 ///\r
2227 /// [Bit 11] Valid Enable range mask.\r
2228 ///\r
490b048b 2229 UINT32 V:1;\r
04c980a6
MK
2230 ///\r
2231 /// [Bits 31:12] PhysMask. MTRR address range mask.\r
2232 ///\r
2233 UINT32 PhysMask:20;\r
2234 ///\r
2235 /// [Bits MAXPHYSADDR:32] PhysMask. Upper bits of MTRR address range mask.\r
2236 /// MAXPHYADDR: The bit position indicated by MAXPHYADDR depends on the\r
2237 /// maximum physical address range supported by the processor. It is\r
2238 /// reported by CPUID leaf function 80000008H. If CPUID does not support\r
2239 /// leaf 80000008H, the processor supports 36-bit physical address size,\r
2240 /// then bit PhysMask consists of bits 35:12, and bits 63:36 are reserved.\r
2241 ///\r
2242 UINT32 PhysMaskHi:32;\r
2243 } Bits;\r
2244 ///\r
2245 /// All bit fields as a 64-bit value\r
2246 ///\r
2247 UINT64 Uint64;\r
2248} MSR_IA32_MTRR_PHYSMASK_REGISTER;\r
2249\r
2250\r
2251/**\r
2252 MTRRfix64K_00000. If CPUID.01H: EDX.MTRR[12] =1.\r
2253\r
2254 @param ECX MSR_IA32_MTRR_FIX64K_00000 (0x00000250)\r
2255 @param EAX Lower 32-bits of MSR value.\r
2256 @param EDX Upper 32-bits of MSR value.\r
2257\r
2258 <b>Example usage</b>\r
2259 @code\r
2260 UINT64 Msr;\r
2261\r
2262 Msr = AsmReadMsr64 (MSR_IA32_MTRR_FIX64K_00000);\r
2263 AsmWriteMsr64 (MSR_IA32_MTRR_FIX64K_00000, Msr);\r
2264 @endcode\r
7de98828 2265 @note MSR_IA32_MTRR_FIX64K_00000 is defined as IA32_MTRR_FIX64K_00000 in SDM.\r
04c980a6
MK
2266**/\r
2267#define MSR_IA32_MTRR_FIX64K_00000 0x00000250\r
2268\r
2269\r
2270/**\r
2271 MTRRfix16K_80000. If CPUID.01H: EDX.MTRR[12] =1.\r
2272\r
2273 @param ECX MSR_IA32_MTRR_FIX16K_80000 (0x00000258)\r
2274 @param EAX Lower 32-bits of MSR value.\r
2275 @param EDX Upper 32-bits of MSR value.\r
2276\r
2277 <b>Example usage</b>\r
2278 @code\r
2279 UINT64 Msr;\r
2280\r
2281 Msr = AsmReadMsr64 (MSR_IA32_MTRR_FIX16K_80000);\r
2282 AsmWriteMsr64 (MSR_IA32_MTRR_FIX16K_80000, Msr);\r
2283 @endcode\r
7de98828 2284 @note MSR_IA32_MTRR_FIX16K_80000 is defined as IA32_MTRR_FIX16K_80000 in SDM.\r
04c980a6
MK
2285**/\r
2286#define MSR_IA32_MTRR_FIX16K_80000 0x00000258\r
2287\r
2288\r
2289/**\r
2290 MTRRfix16K_A0000. If CPUID.01H: EDX.MTRR[12] =1.\r
2291\r
2292 @param ECX MSR_IA32_MTRR_FIX16K_A0000 (0x00000259)\r
2293 @param EAX Lower 32-bits of MSR value.\r
2294 @param EDX Upper 32-bits of MSR value.\r
2295\r
2296 <b>Example usage</b>\r
2297 @code\r
2298 UINT64 Msr;\r
2299\r
2300 Msr = AsmReadMsr64 (MSR_IA32_MTRR_FIX16K_A0000);\r
2301 AsmWriteMsr64 (MSR_IA32_MTRR_FIX16K_A0000, Msr);\r
2302 @endcode\r
7de98828 2303 @note MSR_IA32_MTRR_FIX16K_A0000 is defined as IA32_MTRR_FIX16K_A0000 in SDM.\r
04c980a6
MK
2304**/\r
2305#define MSR_IA32_MTRR_FIX16K_A0000 0x00000259\r
2306\r
2307\r
2308/**\r
2309 See Section 11.11.2.2, "Fixed Range MTRRs.". If CPUID.01H: EDX.MTRR[12] =1.\r
2310\r
2311 @param ECX MSR_IA32_MTRR_FIX4K_C0000 (0x00000268)\r
2312 @param EAX Lower 32-bits of MSR value.\r
2313 @param EDX Upper 32-bits of MSR value.\r
2314\r
2315 <b>Example usage</b>\r
2316 @code\r
2317 UINT64 Msr;\r
2318\r
2319 Msr = AsmReadMsr64 (MSR_IA32_MTRR_FIX4K_C0000);\r
2320 AsmWriteMsr64 (MSR_IA32_MTRR_FIX4K_C0000, Msr);\r
2321 @endcode\r
7de98828 2322 @note MSR_IA32_MTRR_FIX4K_C0000 is defined as IA32_MTRR_FIX4K_C0000 in SDM.\r
04c980a6
MK
2323**/\r
2324#define MSR_IA32_MTRR_FIX4K_C0000 0x00000268\r
2325\r
2326\r
2327/**\r
2328 MTRRfix4K_C8000. If CPUID.01H: EDX.MTRR[12] =1.\r
2329\r
2330 @param ECX MSR_IA32_MTRR_FIX4K_C8000 (0x00000269)\r
2331 @param EAX Lower 32-bits of MSR value.\r
2332 @param EDX Upper 32-bits of MSR value.\r
2333\r
2334 <b>Example usage</b>\r
2335 @code\r
2336 UINT64 Msr;\r
2337\r
2338 Msr = AsmReadMsr64 (MSR_IA32_MTRR_FIX4K_C8000);\r
2339 AsmWriteMsr64 (MSR_IA32_MTRR_FIX4K_C8000, Msr);\r
2340 @endcode\r
7de98828 2341 @note MSR_IA32_MTRR_FIX4K_C8000 is defined as IA32_MTRR_FIX4K_C8000 in SDM.\r
04c980a6
MK
2342**/\r
2343#define MSR_IA32_MTRR_FIX4K_C8000 0x00000269\r
2344\r
2345\r
2346/**\r
2347 MTRRfix4K_D0000. If CPUID.01H: EDX.MTRR[12] =1.\r
2348\r
2349 @param ECX MSR_IA32_MTRR_FIX4K_D0000 (0x0000026A)\r
2350 @param EAX Lower 32-bits of MSR value.\r
2351 @param EDX Upper 32-bits of MSR value.\r
2352\r
2353 <b>Example usage</b>\r
2354 @code\r
2355 UINT64 Msr;\r
2356\r
2357 Msr = AsmReadMsr64 (MSR_IA32_MTRR_FIX4K_D0000);\r
2358 AsmWriteMsr64 (MSR_IA32_MTRR_FIX4K_D0000, Msr);\r
2359 @endcode\r
7de98828 2360 @note MSR_IA32_MTRR_FIX4K_D0000 is defined as IA32_MTRR_FIX4K_D0000 in SDM.\r
04c980a6
MK
2361**/\r
2362#define MSR_IA32_MTRR_FIX4K_D0000 0x0000026A\r
2363\r
2364\r
2365/**\r
2366 MTRRfix4K_D8000. If CPUID.01H: EDX.MTRR[12] =1.\r
2367\r
2368 @param ECX MSR_IA32_MTRR_FIX4K_D8000 (0x0000026B)\r
2369 @param EAX Lower 32-bits of MSR value.\r
2370 @param EDX Upper 32-bits of MSR value.\r
2371\r
2372 <b>Example usage</b>\r
2373 @code\r
2374 UINT64 Msr;\r
2375\r
2376 Msr = AsmReadMsr64 (MSR_IA32_MTRR_FIX4K_D8000);\r
2377 AsmWriteMsr64 (MSR_IA32_MTRR_FIX4K_D8000, Msr);\r
2378 @endcode\r
7de98828 2379 @note MSR_IA32_MTRR_FIX4K_D8000 is defined as IA32_MTRR_FIX4K_D8000 in SDM.\r
04c980a6
MK
2380**/\r
2381#define MSR_IA32_MTRR_FIX4K_D8000 0x0000026B\r
2382\r
2383\r
2384/**\r
2385 MTRRfix4K_E0000. If CPUID.01H: EDX.MTRR[12] =1.\r
2386\r
2387 @param ECX MSR_IA32_MTRR_FIX4K_E0000 (0x0000026C)\r
2388 @param EAX Lower 32-bits of MSR value.\r
2389 @param EDX Upper 32-bits of MSR value.\r
2390\r
2391 <b>Example usage</b>\r
2392 @code\r
2393 UINT64 Msr;\r
2394\r
2395 Msr = AsmReadMsr64 (MSR_IA32_MTRR_FIX4K_E0000);\r
2396 AsmWriteMsr64 (MSR_IA32_MTRR_FIX4K_E0000, Msr);\r
2397 @endcode\r
7de98828 2398 @note MSR_IA32_MTRR_FIX4K_E0000 is defined as IA32_MTRR_FIX4K_E0000 in SDM.\r
04c980a6
MK
2399**/\r
2400#define MSR_IA32_MTRR_FIX4K_E0000 0x0000026C\r
2401\r
2402\r
2403/**\r
2404 MTRRfix4K_E8000. If CPUID.01H: EDX.MTRR[12] =1.\r
2405\r
2406 @param ECX MSR_IA32_MTRR_FIX4K_E8000 (0x0000026D)\r
2407 @param EAX Lower 32-bits of MSR value.\r
2408 @param EDX Upper 32-bits of MSR value.\r
2409\r
2410 <b>Example usage</b>\r
2411 @code\r
2412 UINT64 Msr;\r
2413\r
2414 Msr = AsmReadMsr64 (MSR_IA32_MTRR_FIX4K_E8000);\r
2415 AsmWriteMsr64 (MSR_IA32_MTRR_FIX4K_E8000, Msr);\r
2416 @endcode\r
7de98828 2417 @note MSR_IA32_MTRR_FIX4K_E8000 is defined as IA32_MTRR_FIX4K_E8000 in SDM.\r
04c980a6
MK
2418**/\r
2419#define MSR_IA32_MTRR_FIX4K_E8000 0x0000026D\r
2420\r
2421\r
2422/**\r
2423 MTRRfix4K_F0000. If CPUID.01H: EDX.MTRR[12] =1.\r
2424\r
2425 @param ECX MSR_IA32_MTRR_FIX4K_F0000 (0x0000026E)\r
2426 @param EAX Lower 32-bits of MSR value.\r
2427 @param EDX Upper 32-bits of MSR value.\r
2428\r
2429 <b>Example usage</b>\r
2430 @code\r
2431 UINT64 Msr;\r
2432\r
2433 Msr = AsmReadMsr64 (MSR_IA32_MTRR_FIX4K_F0000);\r
2434 AsmWriteMsr64 (MSR_IA32_MTRR_FIX4K_F0000, Msr);\r
2435 @endcode\r
7de98828 2436 @note MSR_IA32_MTRR_FIX4K_F0000 is defined as IA32_MTRR_FIX4K_F0000 in SDM.\r
04c980a6
MK
2437**/\r
2438#define MSR_IA32_MTRR_FIX4K_F0000 0x0000026E\r
2439\r
2440\r
2441/**\r
2442 MTRRfix4K_F8000. If CPUID.01H: EDX.MTRR[12] =1.\r
2443\r
2444 @param ECX MSR_IA32_MTRR_FIX4K_F8000 (0x0000026F)\r
2445 @param EAX Lower 32-bits of MSR value.\r
2446 @param EDX Upper 32-bits of MSR value.\r
2447\r
2448 <b>Example usage</b>\r
2449 @code\r
2450 UINT64 Msr;\r
2451\r
2452 Msr = AsmReadMsr64 (MSR_IA32_MTRR_FIX4K_F8000);\r
2453 AsmWriteMsr64 (MSR_IA32_MTRR_FIX4K_F8000, Msr);\r
2454 @endcode\r
7de98828 2455 @note MSR_IA32_MTRR_FIX4K_F8000 is defined as IA32_MTRR_FIX4K_F8000 in SDM.\r
04c980a6
MK
2456**/\r
2457#define MSR_IA32_MTRR_FIX4K_F8000 0x0000026F\r
2458\r
2459\r
2460/**\r
2461 IA32_PAT (R/W). If CPUID.01H: EDX.MTRR[16] =1.\r
2462\r
2463 @param ECX MSR_IA32_PAT (0x00000277)\r
2464 @param EAX Lower 32-bits of MSR value.\r
2465 Described by the type MSR_IA32_PAT_REGISTER.\r
2466 @param EDX Upper 32-bits of MSR value.\r
2467 Described by the type MSR_IA32_PAT_REGISTER.\r
2468\r
2469 <b>Example usage</b>\r
2470 @code\r
2471 MSR_IA32_PAT_REGISTER Msr;\r
2472\r
2473 Msr.Uint64 = AsmReadMsr64 (MSR_IA32_PAT);\r
2474 AsmWriteMsr64 (MSR_IA32_PAT, Msr.Uint64);\r
2475 @endcode\r
7de98828 2476 @note MSR_IA32_PAT is defined as IA32_PAT in SDM.\r
04c980a6
MK
2477**/\r
2478#define MSR_IA32_PAT 0x00000277\r
2479\r
2480/**\r
2481 MSR information returned for MSR index #MSR_IA32_PAT\r
2482**/\r
2483typedef union {\r
2484 ///\r
2485 /// Individual bit fields\r
2486 ///\r
2487 struct {\r
2488 ///\r
2489 /// [Bits 2:0] PA0.\r
2490 ///\r
2491 UINT32 PA0:3;\r
2492 UINT32 Reserved1:5;\r
2493 ///\r
2494 /// [Bits 10:8] PA1.\r
2495 ///\r
2496 UINT32 PA1:3;\r
2497 UINT32 Reserved2:5;\r
2498 ///\r
2499 /// [Bits 18:16] PA2.\r
2500 ///\r
2501 UINT32 PA2:3;\r
2502 UINT32 Reserved3:5;\r
2503 ///\r
2504 /// [Bits 26:24] PA3.\r
2505 ///\r
2506 UINT32 PA3:3;\r
2507 UINT32 Reserved4:5;\r
2508 ///\r
2509 /// [Bits 34:32] PA4.\r
2510 ///\r
2511 UINT32 PA4:3;\r
2512 UINT32 Reserved5:5;\r
2513 ///\r
2514 /// [Bits 42:40] PA5.\r
2515 ///\r
2516 UINT32 PA5:3;\r
2517 UINT32 Reserved6:5;\r
2518 ///\r
2519 /// [Bits 50:48] PA6.\r
2520 ///\r
2521 UINT32 PA6:3;\r
2522 UINT32 Reserved7:5;\r
2523 ///\r
2524 /// [Bits 58:56] PA7.\r
2525 ///\r
2526 UINT32 PA7:3;\r
2527 UINT32 Reserved8:5;\r
2528 } Bits;\r
2529 ///\r
2530 /// All bit fields as a 64-bit value\r
2531 ///\r
2532 UINT64 Uint64;\r
2533} MSR_IA32_PAT_REGISTER;\r
2534\r
2535\r
2536/**\r
2537 Provides the programming interface to use corrected MC error signaling\r
2538 capability (R/W). If IA32_MCG_CAP[10] = 1 && IA32_MCG_CAP[7:0] > n.\r
2539\r
2540 @param ECX MSR_IA32_MCn_CTL2\r
2541 @param EAX Lower 32-bits of MSR value.\r
2542 Described by the type MSR_IA32_MC_CTL2_REGISTER.\r
2543 @param EDX Upper 32-bits of MSR value.\r
2544 Described by the type MSR_IA32_MC_CTL2_REGISTER.\r
2545\r
2546 <b>Example usage</b>\r
2547 @code\r
2548 MSR_IA32_MC_CTL2_REGISTER Msr;\r
2549\r
2550 Msr.Uint64 = AsmReadMsr64 (MSR_IA32_MC0_CTL2);\r
2551 AsmWriteMsr64 (MSR_IA32_MC0_CTL2, Msr.Uint64);\r
2552 @endcode\r
7de98828
JF
2553 @note MSR_IA32_MC0_CTL2 is defined as IA32_MC0_CTL2 in SDM.\r
2554 MSR_IA32_MC1_CTL2 is defined as IA32_MC1_CTL2 in SDM.\r
2555 MSR_IA32_MC2_CTL2 is defined as IA32_MC2_CTL2 in SDM.\r
2556 MSR_IA32_MC3_CTL2 is defined as IA32_MC3_CTL2 in SDM.\r
2557 MSR_IA32_MC4_CTL2 is defined as IA32_MC4_CTL2 in SDM.\r
2558 MSR_IA32_MC5_CTL2 is defined as IA32_MC5_CTL2 in SDM.\r
2559 MSR_IA32_MC6_CTL2 is defined as IA32_MC6_CTL2 in SDM.\r
2560 MSR_IA32_MC7_CTL2 is defined as IA32_MC7_CTL2 in SDM.\r
2561 MSR_IA32_MC8_CTL2 is defined as IA32_MC8_CTL2 in SDM.\r
2562 MSR_IA32_MC9_CTL2 is defined as IA32_MC9_CTL2 in SDM.\r
2563 MSR_IA32_MC10_CTL2 is defined as IA32_MC10_CTL2 in SDM.\r
2564 MSR_IA32_MC11_CTL2 is defined as IA32_MC11_CTL2 in SDM.\r
2565 MSR_IA32_MC12_CTL2 is defined as IA32_MC12_CTL2 in SDM.\r
2566 MSR_IA32_MC13_CTL2 is defined as IA32_MC13_CTL2 in SDM.\r
2567 MSR_IA32_MC14_CTL2 is defined as IA32_MC14_CTL2 in SDM.\r
2568 MSR_IA32_MC15_CTL2 is defined as IA32_MC15_CTL2 in SDM.\r
2569 MSR_IA32_MC16_CTL2 is defined as IA32_MC16_CTL2 in SDM.\r
2570 MSR_IA32_MC17_CTL2 is defined as IA32_MC17_CTL2 in SDM.\r
2571 MSR_IA32_MC18_CTL2 is defined as IA32_MC18_CTL2 in SDM.\r
2572 MSR_IA32_MC19_CTL2 is defined as IA32_MC19_CTL2 in SDM.\r
2573 MSR_IA32_MC20_CTL2 is defined as IA32_MC20_CTL2 in SDM.\r
2574 MSR_IA32_MC21_CTL2 is defined as IA32_MC21_CTL2 in SDM.\r
2575 MSR_IA32_MC22_CTL2 is defined as IA32_MC22_CTL2 in SDM.\r
2576 MSR_IA32_MC23_CTL2 is defined as IA32_MC23_CTL2 in SDM.\r
2577 MSR_IA32_MC24_CTL2 is defined as IA32_MC24_CTL2 in SDM.\r
2578 MSR_IA32_MC25_CTL2 is defined as IA32_MC25_CTL2 in SDM.\r
2579 MSR_IA32_MC26_CTL2 is defined as IA32_MC26_CTL2 in SDM.\r
2580 MSR_IA32_MC27_CTL2 is defined as IA32_MC27_CTL2 in SDM.\r
2581 MSR_IA32_MC28_CTL2 is defined as IA32_MC28_CTL2 in SDM.\r
2582 MSR_IA32_MC29_CTL2 is defined as IA32_MC29_CTL2 in SDM.\r
2583 MSR_IA32_MC30_CTL2 is defined as IA32_MC30_CTL2 in SDM.\r
2584 MSR_IA32_MC31_CTL2 is defined as IA32_MC31_CTL2 in SDM.\r
04c980a6
MK
2585 @{\r
2586**/\r
2587#define MSR_IA32_MC0_CTL2 0x00000280\r
2588#define MSR_IA32_MC1_CTL2 0x00000281\r
2589#define MSR_IA32_MC2_CTL2 0x00000282\r
2590#define MSR_IA32_MC3_CTL2 0x00000283\r
2591#define MSR_IA32_MC4_CTL2 0x00000284\r
2592#define MSR_IA32_MC5_CTL2 0x00000285\r
2593#define MSR_IA32_MC6_CTL2 0x00000286\r
2594#define MSR_IA32_MC7_CTL2 0x00000287\r
2595#define MSR_IA32_MC8_CTL2 0x00000288\r
2596#define MSR_IA32_MC9_CTL2 0x00000289\r
2597#define MSR_IA32_MC10_CTL2 0x0000028A\r
2598#define MSR_IA32_MC11_CTL2 0x0000028B\r
2599#define MSR_IA32_MC12_CTL2 0x0000028C\r
2600#define MSR_IA32_MC13_CTL2 0x0000028D\r
2601#define MSR_IA32_MC14_CTL2 0x0000028E\r
2602#define MSR_IA32_MC15_CTL2 0x0000028F\r
2603#define MSR_IA32_MC16_CTL2 0x00000290\r
2604#define MSR_IA32_MC17_CTL2 0x00000291\r
2605#define MSR_IA32_MC18_CTL2 0x00000292\r
2606#define MSR_IA32_MC19_CTL2 0x00000293\r
2607#define MSR_IA32_MC20_CTL2 0x00000294\r
2608#define MSR_IA32_MC21_CTL2 0x00000295\r
2609#define MSR_IA32_MC22_CTL2 0x00000296\r
2610#define MSR_IA32_MC23_CTL2 0x00000297\r
2611#define MSR_IA32_MC24_CTL2 0x00000298\r
2612#define MSR_IA32_MC25_CTL2 0x00000299\r
2613#define MSR_IA32_MC26_CTL2 0x0000029A\r
2614#define MSR_IA32_MC27_CTL2 0x0000029B\r
2615#define MSR_IA32_MC28_CTL2 0x0000029C\r
2616#define MSR_IA32_MC29_CTL2 0x0000029D\r
2617#define MSR_IA32_MC30_CTL2 0x0000029E\r
2618#define MSR_IA32_MC31_CTL2 0x0000029F\r
2619/// @}\r
2620\r
2621/**\r
2622 MSR information returned for MSR indexes #MSR_IA32_MC0_CTL2\r
2623 to #MSR_IA32_MC31_CTL2\r
2624**/\r
2625typedef union {\r
2626 ///\r
2627 /// Individual bit fields\r
2628 ///\r
2629 struct {\r
2630 ///\r
2631 /// [Bits 14:0] Corrected error count threshold.\r
2632 ///\r
2633 UINT32 CorrectedErrorCountThreshold:15;\r
2634 UINT32 Reserved1:15;\r
2635 ///\r
2636 /// [Bit 30] CMCI_EN.\r
2637 ///\r
2638 UINT32 CMCI_EN:1;\r
2639 UINT32 Reserved2:1;\r
2640 UINT32 Reserved3:32;\r
2641 } Bits;\r
2642 ///\r
2643 /// All bit fields as a 32-bit value\r
2644 ///\r
2645 UINT32 Uint32;\r
2646 ///\r
2647 /// All bit fields as a 64-bit value\r
2648 ///\r
2649 UINT64 Uint64;\r
2650} MSR_IA32_MC_CTL2_REGISTER;\r
2651\r
2652\r
2653/**\r
2654 MTRRdefType (R/W). If CPUID.01H: EDX.MTRR[12] =1.\r
2655\r
2656 @param ECX MSR_IA32_MTRR_DEF_TYPE (0x000002FF)\r
2657 @param EAX Lower 32-bits of MSR value.\r
2658 Described by the type MSR_IA32_MTRR_DEF_TYPE_REGISTER.\r
2659 @param EDX Upper 32-bits of MSR value.\r
2660 Described by the type MSR_IA32_MTRR_DEF_TYPE_REGISTER.\r
2661\r
2662 <b>Example usage</b>\r
2663 @code\r
2664 MSR_IA32_MTRR_DEF_TYPE_REGISTER Msr;\r
2665\r
2666 Msr.Uint64 = AsmReadMsr64 (MSR_IA32_MTRR_DEF_TYPE);\r
2667 AsmWriteMsr64 (MSR_IA32_MTRR_DEF_TYPE, Msr.Uint64);\r
2668 @endcode\r
7de98828 2669 @note MSR_IA32_MTRR_DEF_TYPE is defined as IA32_MTRR_DEF_TYPE in SDM.\r
04c980a6
MK
2670**/\r
2671#define MSR_IA32_MTRR_DEF_TYPE 0x000002FF\r
2672\r
2673/**\r
2674 MSR information returned for MSR index #MSR_IA32_MTRR_DEF_TYPE\r
2675**/\r
2676typedef union {\r
2677 ///\r
2678 /// Individual bit fields\r
2679 ///\r
2680 struct {\r
2681 ///\r
2682 /// [Bits 2:0] Default Memory Type.\r
2683 ///\r
2684 UINT32 Type:3;\r
2685 UINT32 Reserved1:7;\r
2686 ///\r
2687 /// [Bit 10] Fixed Range MTRR Enable.\r
2688 ///\r
2689 UINT32 FE:1;\r
2690 ///\r
2691 /// [Bit 11] MTRR Enable.\r
2692 ///\r
2693 UINT32 E:1;\r
2694 UINT32 Reserved2:20;\r
2695 UINT32 Reserved3:32;\r
2696 } Bits;\r
2697 ///\r
2698 /// All bit fields as a 32-bit value\r
2699 ///\r
2700 UINT32 Uint32;\r
2701 ///\r
2702 /// All bit fields as a 64-bit value\r
2703 ///\r
2704 UINT64 Uint64;\r
2705} MSR_IA32_MTRR_DEF_TYPE_REGISTER;\r
2706\r
2707\r
2708/**\r
2709 Fixed-Function Performance Counter 0 (R/W): Counts Instr_Retired.Any. If\r
2710 CPUID.0AH: EDX[4:0] > 0.\r
2711\r
2712 @param ECX MSR_IA32_FIXED_CTR0 (0x00000309)\r
2713 @param EAX Lower 32-bits of MSR value.\r
2714 @param EDX Upper 32-bits of MSR value.\r
2715\r
2716 <b>Example usage</b>\r
2717 @code\r
2718 UINT64 Msr;\r
2719\r
2720 Msr = AsmReadMsr64 (MSR_IA32_FIXED_CTR0);\r
2721 AsmWriteMsr64 (MSR_IA32_FIXED_CTR0, Msr);\r
2722 @endcode\r
7de98828 2723 @note MSR_IA32_FIXED_CTR0 is defined as IA32_FIXED_CTR0 in SDM.\r
04c980a6
MK
2724**/\r
2725#define MSR_IA32_FIXED_CTR0 0x00000309\r
2726\r
2727\r
2728/**\r
0f16be6d
HW
2729 Fixed-Function Performance Counter 1 (R/W): Counts CPU_CLK_Unhalted.Core. If\r
2730 CPUID.0AH: EDX[4:0] > 1.\r
04c980a6
MK
2731\r
2732 @param ECX MSR_IA32_FIXED_CTR1 (0x0000030A)\r
2733 @param EAX Lower 32-bits of MSR value.\r
2734 @param EDX Upper 32-bits of MSR value.\r
2735\r
2736 <b>Example usage</b>\r
2737 @code\r
2738 UINT64 Msr;\r
2739\r
2740 Msr = AsmReadMsr64 (MSR_IA32_FIXED_CTR1);\r
2741 AsmWriteMsr64 (MSR_IA32_FIXED_CTR1, Msr);\r
2742 @endcode\r
7de98828 2743 @note MSR_IA32_FIXED_CTR1 is defined as IA32_FIXED_CTR1 in SDM.\r
04c980a6
MK
2744**/\r
2745#define MSR_IA32_FIXED_CTR1 0x0000030A\r
2746\r
2747\r
2748/**\r
0f16be6d
HW
2749 Fixed-Function Performance Counter 2 (R/W): Counts CPU_CLK_Unhalted.Ref. If\r
2750 CPUID.0AH: EDX[4:0] > 2.\r
04c980a6
MK
2751\r
2752 @param ECX MSR_IA32_FIXED_CTR2 (0x0000030B)\r
2753 @param EAX Lower 32-bits of MSR value.\r
2754 @param EDX Upper 32-bits of MSR value.\r
2755\r
2756 <b>Example usage</b>\r
2757 @code\r
2758 UINT64 Msr;\r
2759\r
2760 Msr = AsmReadMsr64 (MSR_IA32_FIXED_CTR2);\r
2761 AsmWriteMsr64 (MSR_IA32_FIXED_CTR2, Msr);\r
2762 @endcode\r
7de98828 2763 @note MSR_IA32_FIXED_CTR2 is defined as IA32_FIXED_CTR2 in SDM.\r
04c980a6
MK
2764**/\r
2765#define MSR_IA32_FIXED_CTR2 0x0000030B\r
2766\r
2767\r
2768/**\r
2769 RO. If CPUID.01H: ECX[15] = 1.\r
2770\r
2771 @param ECX MSR_IA32_PERF_CAPABILITIES (0x00000345)\r
2772 @param EAX Lower 32-bits of MSR value.\r
2773 Described by the type MSR_IA32_PERF_CAPABILITIES_REGISTER.\r
2774 @param EDX Upper 32-bits of MSR value.\r
2775 Described by the type MSR_IA32_PERF_CAPABILITIES_REGISTER.\r
2776\r
2777 <b>Example usage</b>\r
2778 @code\r
2779 MSR_IA32_PERF_CAPABILITIES_REGISTER Msr;\r
2780\r
2781 Msr.Uint64 = AsmReadMsr64 (MSR_IA32_PERF_CAPABILITIES);\r
2782 AsmWriteMsr64 (MSR_IA32_PERF_CAPABILITIES, Msr.Uint64);\r
2783 @endcode\r
7de98828 2784 @note MSR_IA32_PERF_CAPABILITIES is defined as IA32_PERF_CAPABILITIES in SDM.\r
04c980a6
MK
2785**/\r
2786#define MSR_IA32_PERF_CAPABILITIES 0x00000345\r
2787\r
2788/**\r
2789 MSR information returned for MSR index #MSR_IA32_PERF_CAPABILITIES\r
2790**/\r
2791typedef union {\r
2792 ///\r
2793 /// Individual bit fields\r
2794 ///\r
2795 struct {\r
2796 ///\r
2797 /// [Bits 5:0] LBR format.\r
2798 ///\r
2799 UINT32 LBR_FMT:6;\r
2800 ///\r
2801 /// [Bit 6] PEBS Trap.\r
2802 ///\r
2803 UINT32 PEBS_TRAP:1;\r
2804 ///\r
2805 /// [Bit 7] PEBSSaveArchRegs.\r
2806 ///\r
2807 UINT32 PEBS_ARCH_REG:1;\r
2808 ///\r
2809 /// [Bits 11:8] PEBS Record Format.\r
2810 ///\r
2811 UINT32 PEBS_REC_FMT:4;\r
2812 ///\r
2813 /// [Bit 12] 1: Freeze while SMM is supported.\r
2814 ///\r
2815 UINT32 SMM_FREEZE:1;\r
2816 ///\r
2817 /// [Bit 13] 1: Full width of counter writable via IA32_A_PMCx.\r
2818 ///\r
2819 UINT32 FW_WRITE:1;\r
2820 UINT32 Reserved1:18;\r
2821 UINT32 Reserved2:32;\r
2822 } Bits;\r
2823 ///\r
2824 /// All bit fields as a 32-bit value\r
2825 ///\r
2826 UINT32 Uint32;\r
2827 ///\r
2828 /// All bit fields as a 64-bit value\r
2829 ///\r
2830 UINT64 Uint64;\r
2831} MSR_IA32_PERF_CAPABILITIES_REGISTER;\r
2832\r
2833\r
2834/**\r
2835 Fixed-Function Performance Counter Control (R/W) Counter increments while\r
2836 the results of ANDing respective enable bit in IA32_PERF_GLOBAL_CTRL with\r
2837 the corresponding OS or USR bits in this MSR is true. If CPUID.0AH: EAX[7:0]\r
2838 > 1.\r
2839\r
2840 @param ECX MSR_IA32_FIXED_CTR_CTRL (0x0000038D)\r
2841 @param EAX Lower 32-bits of MSR value.\r
2842 Described by the type MSR_IA32_FIXED_CTR_CTRL_REGISTER.\r
2843 @param EDX Upper 32-bits of MSR value.\r
2844 Described by the type MSR_IA32_FIXED_CTR_CTRL_REGISTER.\r
2845\r
2846 <b>Example usage</b>\r
2847 @code\r
2848 MSR_IA32_FIXED_CTR_CTRL_REGISTER Msr;\r
2849\r
2850 Msr.Uint64 = AsmReadMsr64 (MSR_IA32_FIXED_CTR_CTRL);\r
2851 AsmWriteMsr64 (MSR_IA32_FIXED_CTR_CTRL, Msr.Uint64);\r
2852 @endcode\r
7de98828 2853 @note MSR_IA32_FIXED_CTR_CTRL is defined as IA32_FIXED_CTR_CTRL in SDM.\r
04c980a6
MK
2854**/\r
2855#define MSR_IA32_FIXED_CTR_CTRL 0x0000038D\r
2856\r
2857/**\r
2858 MSR information returned for MSR index #MSR_IA32_FIXED_CTR_CTRL\r
2859**/\r
2860typedef union {\r
2861 ///\r
2862 /// Individual bit fields\r
2863 ///\r
2864 struct {\r
2865 ///\r
2866 /// [Bit 0] EN0_OS: Enable Fixed Counter 0 to count while CPL = 0.\r
2867 ///\r
2868 UINT32 EN0_OS:1;\r
2869 ///\r
2870 /// [Bit 1] EN0_Usr: Enable Fixed Counter 0 to count while CPL > 0.\r
2871 ///\r
2872 UINT32 EN0_Usr:1;\r
2873 ///\r
2874 /// [Bit 2] AnyThread: When set to 1, it enables counting the associated\r
2875 /// event conditions occurring across all logical processors sharing a\r
2876 /// processor core. When set to 0, the counter only increments the\r
2877 /// associated event conditions occurring in the logical processor which\r
2878 /// programmed the MSR. If CPUID.0AH: EAX[7:0] > 2.\r
2879 ///\r
2880 UINT32 AnyThread0:1;\r
2881 ///\r
2882 /// [Bit 3] EN0_PMI: Enable PMI when fixed counter 0 overflows.\r
2883 ///\r
2884 UINT32 EN0_PMI:1;\r
2885 ///\r
2886 /// [Bit 4] EN1_OS: Enable Fixed Counter 1 to count while CPL = 0.\r
2887 ///\r
2888 UINT32 EN1_OS:1;\r
2889 ///\r
2890 /// [Bit 5] EN1_Usr: Enable Fixed Counter 1 to count while CPL > 0.\r
2891 ///\r
2892 UINT32 EN1_Usr:1;\r
2893 ///\r
2894 /// [Bit 6] AnyThread: When set to 1, it enables counting the associated\r
2895 /// event conditions occurring across all logical processors sharing a\r
2896 /// processor core. When set to 0, the counter only increments the\r
2897 /// associated event conditions occurring in the logical processor which\r
2898 /// programmed the MSR. If CPUID.0AH: EAX[7:0] > 2.\r
2899 ///\r
2900 UINT32 AnyThread1:1;\r
2901 ///\r
2902 /// [Bit 7] EN1_PMI: Enable PMI when fixed counter 1 overflows.\r
2903 ///\r
2904 UINT32 EN1_PMI:1;\r
2905 ///\r
2906 /// [Bit 8] EN2_OS: Enable Fixed Counter 2 to count while CPL = 0.\r
2907 ///\r
2908 UINT32 EN2_OS:1;\r
2909 ///\r
2910 /// [Bit 9] EN2_Usr: Enable Fixed Counter 2 to count while CPL > 0.\r
2911 ///\r
2912 UINT32 EN2_Usr:1;\r
2913 ///\r
2914 /// [Bit 10] AnyThread: When set to 1, it enables counting the associated\r
2915 /// event conditions occurring across all logical processors sharing a\r
2916 /// processor core. When set to 0, the counter only increments the\r
2917 /// associated event conditions occurring in the logical processor which\r
2918 /// programmed the MSR. If CPUID.0AH: EAX[7:0] > 2.\r
2919 ///\r
2920 UINT32 AnyThread2:1;\r
2921 ///\r
2922 /// [Bit 11] EN2_PMI: Enable PMI when fixed counter 2 overflows.\r
2923 ///\r
2924 UINT32 EN2_PMI:1;\r
2925 UINT32 Reserved1:20;\r
2926 UINT32 Reserved2:32;\r
2927 } Bits;\r
2928 ///\r
2929 /// All bit fields as a 32-bit value\r
2930 ///\r
2931 UINT32 Uint32;\r
2932 ///\r
2933 /// All bit fields as a 64-bit value\r
2934 ///\r
2935 UINT64 Uint64;\r
2936} MSR_IA32_FIXED_CTR_CTRL_REGISTER;\r
2937\r
2938\r
2939/**\r
2940 Global Performance Counter Status (RO). If CPUID.0AH: EAX[7:0] > 0.\r
2941\r
2942 @param ECX MSR_IA32_PERF_GLOBAL_STATUS (0x0000038E)\r
2943 @param EAX Lower 32-bits of MSR value.\r
2944 Described by the type MSR_IA32_PERF_GLOBAL_STATUS_REGISTER.\r
2945 @param EDX Upper 32-bits of MSR value.\r
2946 Described by the type MSR_IA32_PERF_GLOBAL_STATUS_REGISTER.\r
2947\r
2948 <b>Example usage</b>\r
2949 @code\r
2950 MSR_IA32_PERF_GLOBAL_STATUS_REGISTER Msr;\r
2951\r
2952 Msr.Uint64 = AsmReadMsr64 (MSR_IA32_PERF_GLOBAL_STATUS);\r
2953 @endcode\r
7de98828 2954 @note MSR_IA32_PERF_GLOBAL_STATUS is defined as IA32_PERF_GLOBAL_STATUS in SDM.\r
04c980a6
MK
2955**/\r
2956#define MSR_IA32_PERF_GLOBAL_STATUS 0x0000038E\r
2957\r
2958/**\r
2959 MSR information returned for MSR index #MSR_IA32_PERF_GLOBAL_STATUS\r
2960**/\r
2961typedef union {\r
2962 ///\r
2963 /// Individual bit fields\r
2964 ///\r
2965 struct {\r
2966 ///\r
2967 /// [Bit 0] Ovf_PMC0: Overflow status of IA32_PMC0. If CPUID.0AH:\r
2968 /// EAX[15:8] > 0.\r
2969 ///\r
2970 UINT32 Ovf_PMC0:1;\r
2971 ///\r
2972 /// [Bit 1] Ovf_PMC1: Overflow status of IA32_PMC1. If CPUID.0AH:\r
2973 /// EAX[15:8] > 1.\r
2974 ///\r
2975 UINT32 Ovf_PMC1:1;\r
2976 ///\r
2977 /// [Bit 2] Ovf_PMC2: Overflow status of IA32_PMC2. If CPUID.0AH:\r
2978 /// EAX[15:8] > 2.\r
2979 ///\r
2980 UINT32 Ovf_PMC2:1;\r
2981 ///\r
2982 /// [Bit 3] Ovf_PMC3: Overflow status of IA32_PMC3. If CPUID.0AH:\r
2983 /// EAX[15:8] > 3.\r
2984 ///\r
2985 UINT32 Ovf_PMC3:1;\r
2986 UINT32 Reserved1:28;\r
2987 ///\r
2988 /// [Bit 32] Ovf_FixedCtr0: Overflow status of IA32_FIXED_CTR0. If\r
2989 /// CPUID.0AH: EAX[7:0] > 1.\r
2990 ///\r
2991 UINT32 Ovf_FixedCtr0:1;\r
2992 ///\r
2993 /// [Bit 33] Ovf_FixedCtr1: Overflow status of IA32_FIXED_CTR1. If\r
2994 /// CPUID.0AH: EAX[7:0] > 1.\r
2995 ///\r
2996 UINT32 Ovf_FixedCtr1:1;\r
2997 ///\r
2998 /// [Bit 34] Ovf_FixedCtr2: Overflow status of IA32_FIXED_CTR2. If\r
2999 /// CPUID.0AH: EAX[7:0] > 1.\r
3000 ///\r
3001 UINT32 Ovf_FixedCtr2:1;\r
3002 UINT32 Reserved2:20;\r
3003 ///\r
3004 /// [Bit 55] Trace_ToPA_PMI: A PMI occurred due to a ToPA entry memory\r
3005 /// buffer was completely filled. If (CPUID.(EAX=07H, ECX=0):EBX[25] = 1)\r
3006 /// && IA32_RTIT_CTL.ToPA = 1.\r
3007 ///\r
3008 UINT32 Trace_ToPA_PMI:1;\r
3009 UINT32 Reserved3:2;\r
3010 ///\r
3011 /// [Bit 58] LBR_Frz: LBRs are frozen due to -\r
3012 /// IA32_DEBUGCTL.FREEZE_LBR_ON_PMI=1, - The LBR stack overflowed. If\r
3013 /// CPUID.0AH: EAX[7:0] > 3.\r
3014 ///\r
3015 UINT32 LBR_Frz:1;\r
3016 ///\r
3017 /// [Bit 59] CTR_Frz: Performance counters in the core PMU are frozen due\r
3018 /// to - IA32_DEBUGCTL.FREEZE_PERFMON_ON_ PMI=1, - one or more core PMU\r
3019 /// counters overflowed. If CPUID.0AH: EAX[7:0] > 3.\r
3020 ///\r
3021 UINT32 CTR_Frz:1;\r
3022 ///\r
3023 /// [Bit 60] ASCI: Data in the performance counters in the core PMU may\r
3024 /// include contributions from the direct or indirect operation intel SGX\r
3025 /// to protect an enclave. If CPUID.(EAX=07H, ECX=0):EBX[2] = 1.\r
3026 ///\r
3027 UINT32 ASCI:1;\r
3028 ///\r
3029 /// [Bit 61] Ovf_Uncore: Uncore counter overflow status. If CPUID.0AH:\r
3030 /// EAX[7:0] > 2.\r
3031 ///\r
3032 UINT32 Ovf_Uncore:1;\r
3033 ///\r
3034 /// [Bit 62] OvfBuf: DS SAVE area Buffer overflow status. If CPUID.0AH:\r
3035 /// EAX[7:0] > 0.\r
3036 ///\r
3037 UINT32 OvfBuf:1;\r
3038 ///\r
3039 /// [Bit 63] CondChgd: status bits of this register has changed. If\r
3040 /// CPUID.0AH: EAX[7:0] > 0.\r
3041 ///\r
3042 UINT32 CondChgd:1;\r
3043 } Bits;\r
3044 ///\r
3045 /// All bit fields as a 64-bit value\r
3046 ///\r
3047 UINT64 Uint64;\r
3048} MSR_IA32_PERF_GLOBAL_STATUS_REGISTER;\r
3049\r
3050\r
3051/**\r
3052 Global Performance Counter Control (R/W) Counter increments while the result\r
3053 of ANDing respective enable bit in this MSR with the corresponding OS or USR\r
3054 bits in the general-purpose or fixed counter control MSR is true. If\r
3055 CPUID.0AH: EAX[7:0] > 0.\r
3056\r
3057 @param ECX MSR_IA32_PERF_GLOBAL_CTRL (0x0000038F)\r
3058 @param EAX Lower 32-bits of MSR value.\r
3059 Described by the type MSR_IA32_PERF_GLOBAL_CTRL_REGISTER.\r
3060 @param EDX Upper 32-bits of MSR value.\r
3061 Described by the type MSR_IA32_PERF_GLOBAL_CTRL_REGISTER.\r
3062\r
3063 <b>Example usage</b>\r
3064 @code\r
3065 MSR_IA32_PERF_GLOBAL_CTRL_REGISTER Msr;\r
3066\r
3067 Msr.Uint64 = AsmReadMsr64 (MSR_IA32_PERF_GLOBAL_CTRL);\r
3068 AsmWriteMsr64 (MSR_IA32_PERF_GLOBAL_CTRL, Msr.Uint64);\r
3069 @endcode\r
7de98828 3070 @note MSR_IA32_PERF_GLOBAL_CTRL is defined as IA32_PERF_GLOBAL_CTRL in SDM.\r
04c980a6
MK
3071**/\r
3072#define MSR_IA32_PERF_GLOBAL_CTRL 0x0000038F\r
3073\r
3074/**\r
3075 MSR information returned for MSR index #MSR_IA32_PERF_GLOBAL_CTRL\r
3076**/\r
3077typedef union {\r
3078 ///\r
3079 /// Individual bit fields\r
3080///\r
3081 struct {\r
3082 ///\r
3083 /// [Bits 31:0] EN_PMCn. If CPUID.0AH: EAX[15:8] > n.\r
3084 /// Enable bitmask. Only the first n-1 bits are valid.\r
3085 /// Bits n..31 are reserved.\r
3086 ///\r
3087 UINT32 EN_PMCn:32;\r
3088 ///\r
3089 /// [Bits 63:32] EN_FIXED_CTRn. If CPUID.0AH: EDX[4:0] > n.\r
3090 /// Enable bitmask. Only the first n-1 bits are valid.\r
3091 /// Bits 31:n are reserved.\r
3092 ///\r
3093 UINT32 EN_FIXED_CTRn:32;\r
3094 } Bits;\r
3095 ///\r
3096 /// All bit fields as a 64-bit value\r
3097 ///\r
3098 UINT64 Uint64;\r
3099} MSR_IA32_PERF_GLOBAL_CTRL_REGISTER;\r
3100\r
3101\r
3102/**\r
3103 Global Performance Counter Overflow Control (R/W). If CPUID.0AH: EAX[7:0] >\r
3104 0 && CPUID.0AH: EAX[7:0] <= 3.\r
3105\r
3106 @param ECX MSR_IA32_PERF_GLOBAL_OVF_CTRL (0x00000390)\r
3107 @param EAX Lower 32-bits of MSR value.\r
3108 Described by the type MSR_IA32_PERF_GLOBAL_OVF_CTRL_REGISTER.\r
3109 @param EDX Upper 32-bits of MSR value.\r
3110 Described by the type MSR_IA32_PERF_GLOBAL_OVF_CTRL_REGISTER.\r
3111\r
3112 <b>Example usage</b>\r
3113 @code\r
3114 MSR_IA32_PERF_GLOBAL_OVF_CTRL_REGISTER Msr;\r
3115\r
3116 Msr.Uint64 = AsmReadMsr64 (MSR_IA32_PERF_GLOBAL_OVF_CTRL);\r
3117 AsmWriteMsr64 (MSR_IA32_PERF_GLOBAL_OVF_CTRL, Msr.Uint64);\r
3118 @endcode\r
7de98828 3119 @note MSR_IA32_PERF_GLOBAL_OVF_CTRL is defined as IA32_PERF_GLOBAL_OVF_CTRL in SDM.\r
04c980a6
MK
3120**/\r
3121#define MSR_IA32_PERF_GLOBAL_OVF_CTRL 0x00000390\r
3122\r
3123/**\r
3124 MSR information returned for MSR index #MSR_IA32_PERF_GLOBAL_OVF_CTRL\r
3125**/\r
3126typedef union {\r
3127 ///\r
3128 /// Individual bit fields\r
3129 ///\r
3130 struct {\r
3131 ///\r
3132 /// [Bits 31:0] Set 1 to Clear Ovf_PMC0 bit. If CPUID.0AH: EAX[15:8] > n.\r
3133 /// Clear bitmask. Only the first n-1 bits are valid.\r
3134 /// Bits 31:n are reserved.\r
3135 ///\r
3136 UINT32 Ovf_PMCn:32;\r
3137 ///\r
3138 /// [Bits 54:32] Set 1 to Clear Ovf_FIXED_CTR0 bit.\r
3139 /// If CPUID.0AH: EDX[4:0] > n.\r
3140 /// Clear bitmask. Only the first n-1 bits are valid.\r
3141 /// Bits 22:n are reserved.\r
3142 ///\r
3143 UINT32 Ovf_FIXED_CTRn:23;\r
3144 ///\r
3145 /// [Bit 55] Set 1 to Clear Trace_ToPA_PMI bit. If (CPUID.(EAX=07H,\r
3146 /// ECX=0):EBX[25] = 1) && IA32_RTIT_CTL.ToPA = 1.\r
3147 ///\r
3148 UINT32 Trace_ToPA_PMI:1;\r
3149 UINT32 Reserved2:5;\r
3150 ///\r
3151 /// [Bit 61] Set 1 to Clear Ovf_Uncore bit. Introduced at Display Family /\r
3152 /// Display Model 06_2EH.\r
3153 ///\r
3154 UINT32 Ovf_Uncore:1;\r
3155 ///\r
3156 /// [Bit 62] Set 1 to Clear OvfBuf: bit. If CPUID.0AH: EAX[7:0] > 0.\r
3157 ///\r
3158 UINT32 OvfBuf:1;\r
3159 ///\r
3160 /// [Bit 63] Set to 1to clear CondChgd: bit. If CPUID.0AH: EAX[7:0] > 0.\r
3161 ///\r
3162 UINT32 CondChgd:1;\r
3163 } Bits;\r
3164 ///\r
3165 /// All bit fields as a 64-bit value\r
3166 ///\r
3167 UINT64 Uint64;\r
3168} MSR_IA32_PERF_GLOBAL_OVF_CTRL_REGISTER;\r
3169\r
3170\r
3171/**\r
3172 Global Performance Counter Overflow Reset Control (R/W). If CPUID.0AH:\r
3173 EAX[7:0] > 3.\r
3174\r
3175 @param ECX MSR_IA32_PERF_GLOBAL_STATUS_RESET (0x00000390)\r
3176 @param EAX Lower 32-bits of MSR value.\r
3177 Described by the type MSR_IA32_PERF_GLOBAL_STATUS_RESET_REGISTER.\r
3178 @param EDX Upper 32-bits of MSR value.\r
3179 Described by the type MSR_IA32_PERF_GLOBAL_STATUS_RESET_REGISTER.\r
3180\r
3181 <b>Example usage</b>\r
3182 @code\r
3183 MSR_IA32_PERF_GLOBAL_STATUS_RESET_REGISTER Msr;\r
3184\r
3185 Msr.Uint64 = AsmReadMsr64 (MSR_IA32_PERF_GLOBAL_STATUS_RESET);\r
3186 AsmWriteMsr64 (MSR_IA32_PERF_GLOBAL_STATUS_RESET, Msr.Uint64);\r
3187 @endcode\r
7de98828 3188 @note MSR_IA32_PERF_GLOBAL_STATUS_RESET is defined as IA32_PERF_GLOBAL_STATUS_RESET in SDM.\r
04c980a6
MK
3189**/\r
3190#define MSR_IA32_PERF_GLOBAL_STATUS_RESET 0x00000390\r
3191\r
3192/**\r
3193 MSR information returned for MSR index #MSR_IA32_PERF_GLOBAL_STATUS_RESET\r
3194**/\r
3195typedef union {\r
3196 ///\r
3197 /// Individual bit fields\r
3198 ///\r
3199 struct {\r
3200 ///\r
3201 /// [Bits 31:0] Set 1 to Clear Ovf_PMC0 bit. If CPUID.0AH: EAX[15:8] > n.\r
3202 /// Clear bitmask. Only the first n-1 bits are valid.\r
3203 /// Bits 31:n are reserved.\r
3204 ///\r
3205 UINT32 Ovf_PMCn:32;\r
3206 ///\r
3207 /// [Bits 54:32] Set 1 to Clear Ovf_FIXED_CTR0 bit.\r
3208 /// If CPUID.0AH: EDX[4:0] > n.\r
3209 /// Clear bitmask. Only the first n-1 bits are valid.\r
3210 /// Bits 22:n are reserved.\r
3211 ///\r
3212 UINT32 Ovf_FIXED_CTRn:23;\r
3213 ///\r
3214 /// [Bit 55] Set 1 to Clear Trace_ToPA_PMI bit. If (CPUID.(EAX=07H,\r
3215 /// ECX=0):EBX[25] = 1) && IA32_RTIT_CTL.ToPA[8] = 1.\r
3216 ///\r
3217 UINT32 Trace_ToPA_PMI:1;\r
3218 UINT32 Reserved2:2;\r
3219 ///\r
3220 /// [Bit 58] Set 1 to Clear LBR_Frz bit. If CPUID.0AH: EAX[7:0] > 3.\r
3221 ///\r
3222 UINT32 LBR_Frz:1;\r
3223 ///\r
3224 /// [Bit 59] Set 1 to Clear CTR_Frz bit. If CPUID.0AH: EAX[7:0] > 3.\r
3225 ///\r
3226 UINT32 CTR_Frz:1;\r
3227 ///\r
3228 /// [Bit 60] Set 1 to Clear ASCI bit. If CPUID.0AH: EAX[7:0] > 3.\r
3229 ///\r
3230 UINT32 ASCI:1;\r
3231 ///\r
3232 /// [Bit 61] Set 1 to Clear Ovf_Uncore bit. Introduced at Display Family /\r
3233 /// Display Model 06_2EH.\r
3234 ///\r
3235 UINT32 Ovf_Uncore:1;\r
3236 ///\r
3237 /// [Bit 62] Set 1 to Clear OvfBuf: bit. If CPUID.0AH: EAX[7:0] > 0.\r
3238 ///\r
3239 UINT32 OvfBuf:1;\r
3240 ///\r
3241 /// [Bit 63] Set to 1to clear CondChgd: bit. If CPUID.0AH: EAX[7:0] > 0.\r
3242 ///\r
3243 UINT32 CondChgd:1;\r
3244 } Bits;\r
3245 ///\r
3246 /// All bit fields as a 64-bit value\r
3247 ///\r
3248 UINT64 Uint64;\r
3249} MSR_IA32_PERF_GLOBAL_STATUS_RESET_REGISTER;\r
3250\r
3251\r
3252/**\r
3253 Global Performance Counter Overflow Set Control (R/W). If CPUID.0AH:\r
3254 EAX[7:0] > 3.\r
3255\r
3256 @param ECX MSR_IA32_PERF_GLOBAL_STATUS_SET (0x00000391)\r
3257 @param EAX Lower 32-bits of MSR value.\r
3258 Described by the type MSR_IA32_PERF_GLOBAL_STATUS_SET_REGISTER.\r
3259 @param EDX Upper 32-bits of MSR value.\r
3260 Described by the type MSR_IA32_PERF_GLOBAL_STATUS_SET_REGISTER.\r
3261\r
3262 <b>Example usage</b>\r
3263 @code\r
3264 MSR_IA32_PERF_GLOBAL_STATUS_SET_REGISTER Msr;\r
3265\r
3266 Msr.Uint64 = AsmReadMsr64 (MSR_IA32_PERF_GLOBAL_STATUS_SET);\r
3267 AsmWriteMsr64 (MSR_IA32_PERF_GLOBAL_STATUS_SET, Msr.Uint64);\r
3268 @endcode\r
7de98828 3269 @note MSR_IA32_PERF_GLOBAL_STATUS_SET is defined as IA32_PERF_GLOBAL_STATUS_SET in SDM.\r
04c980a6
MK
3270**/\r
3271#define MSR_IA32_PERF_GLOBAL_STATUS_SET 0x00000391\r
3272\r
3273/**\r
3274 MSR information returned for MSR index #MSR_IA32_PERF_GLOBAL_STATUS_SET\r
3275**/\r
3276typedef union {\r
3277 ///\r
3278 /// Individual bit fields\r
3279 ///\r
3280 struct {\r
3281 ///\r
3282 /// [Bits 31:0] Set 1 to cause Ovf_PMCn = 1. If CPUID.0AH: EAX[7:0] > n.\r
3283 /// Set bitmask. Only the first n-1 bits are valid.\r
3284 /// Bits 31:n are reserved.\r
3285 ///\r
3286 UINT32 Ovf_PMCn:32;\r
3287 ///\r
3288 /// [Bits 54:32] Set 1 to cause Ovf_FIXED_CTRn = 1.\r
3289 /// If CPUID.0AH: EAX[7:0] > n.\r
3290 /// Set bitmask. Only the first n-1 bits are valid.\r
3291 /// Bits 22:n are reserved.\r
3292 ///\r
3293 UINT32 Ovf_FIXED_CTRn:23;\r
3294 ///\r
3295 /// [Bit 55] Set 1 to cause Trace_ToPA_PMI = 1. If CPUID.0AH: EAX[7:0] > 3.\r
3296 ///\r
3297 UINT32 Trace_ToPA_PMI:1;\r
3298 UINT32 Reserved2:2;\r
3299 ///\r
3300 /// [Bit 58] Set 1 to cause LBR_Frz = 1. If CPUID.0AH: EAX[7:0] > 3.\r
3301 ///\r
3302 UINT32 LBR_Frz:1;\r
3303 ///\r
3304 /// [Bit 59] Set 1 to cause CTR_Frz = 1. If CPUID.0AH: EAX[7:0] > 3.\r
3305 ///\r
3306 UINT32 CTR_Frz:1;\r
3307 ///\r
3308 /// [Bit 60] Set 1 to cause ASCI = 1. If CPUID.0AH: EAX[7:0] > 3.\r
3309 ///\r
3310 UINT32 ASCI:1;\r
3311 ///\r
3312 /// [Bit 61] Set 1 to cause Ovf_Uncore = 1. If CPUID.0AH: EAX[7:0] > 3.\r
3313 ///\r
3314 UINT32 Ovf_Uncore:1;\r
3315 ///\r
3316 /// [Bit 62] Set 1 to cause OvfBuf = 1. If CPUID.0AH: EAX[7:0] > 3.\r
3317 ///\r
3318 UINT32 OvfBuf:1;\r
3319 UINT32 Reserved3:1;\r
3320 } Bits;\r
3321 ///\r
3322 /// All bit fields as a 64-bit value\r
3323 ///\r
3324 UINT64 Uint64;\r
3325} MSR_IA32_PERF_GLOBAL_STATUS_SET_REGISTER;\r
3326\r
3327\r
3328/**\r
3329 Indicator of core perfmon interface is in use (RO). If CPUID.0AH: EAX[7:0] >\r
3330 3.\r
3331\r
3332 @param ECX MSR_IA32_PERF_GLOBAL_INUSE (0x00000392)\r
3333 @param EAX Lower 32-bits of MSR value.\r
3334 Described by the type MSR_IA32_PERF_GLOBAL_INUSE_REGISTER.\r
3335 @param EDX Upper 32-bits of MSR value.\r
3336 Described by the type MSR_IA32_PERF_GLOBAL_INUSE_REGISTER.\r
3337\r
3338 <b>Example usage</b>\r
3339 @code\r
3340 MSR_IA32_PERF_GLOBAL_INUSE_REGISTER Msr;\r
3341\r
3342 Msr.Uint64 = AsmReadMsr64 (MSR_IA32_PERF_GLOBAL_INUSE);\r
3343 @endcode\r
7de98828 3344 @note MSR_IA32_PERF_GLOBAL_INUSE is defined as IA32_PERF_GLOBAL_INUSE in SDM.\r
04c980a6
MK
3345**/\r
3346#define MSR_IA32_PERF_GLOBAL_INUSE 0x00000392\r
3347\r
3348/**\r
3349 MSR information returned for MSR index #MSR_IA32_PERF_GLOBAL_INUSE\r
3350**/\r
3351typedef union {\r
3352 ///\r
3353 /// Individual bit fields\r
3354 ///\r
3355 struct {\r
3356 ///\r
3357 /// [Bits 31:0] IA32_PERFEVTSELn in use. If CPUID.0AH: EAX[7:0] > n.\r
3358 /// Status bitmask. Only the first n-1 bits are valid.\r
3359 /// Bits 31:n are reserved.\r
3360 ///\r
3361 UINT32 IA32_PERFEVTSELn:32;\r
3362 ///\r
3363 /// [Bits 62:32] IA32_FIXED_CTRn in use.\r
3364 /// If CPUID.0AH: EAX[7:0] > n.\r
3365 /// Status bitmask. Only the first n-1 bits are valid.\r
3366 /// Bits 30:n are reserved.\r
3367 ///\r
3368 UINT32 IA32_FIXED_CTRn:31;\r
3369 ///\r
3370 /// [Bit 63] PMI in use.\r
3371 ///\r
3372 UINT32 PMI:1;\r
3373 } Bits;\r
3374 ///\r
3375 /// All bit fields as a 64-bit value\r
3376 ///\r
3377 UINT64 Uint64;\r
3378} MSR_IA32_PERF_GLOBAL_INUSE_REGISTER;\r
3379\r
3380\r
3381/**\r
3382 PEBS Control (R/W).\r
3383\r
3384 @param ECX MSR_IA32_PEBS_ENABLE (0x000003F1)\r
3385 @param EAX Lower 32-bits of MSR value.\r
3386 Described by the type MSR_IA32_PEBS_ENABLE_REGISTER.\r
3387 @param EDX Upper 32-bits of MSR value.\r
3388 Described by the type MSR_IA32_PEBS_ENABLE_REGISTER.\r
3389\r
3390 <b>Example usage</b>\r
3391 @code\r
3392 MSR_IA32_PEBS_ENABLE_REGISTER Msr;\r
3393\r
3394 Msr.Uint64 = AsmReadMsr64 (MSR_IA32_PEBS_ENABLE);\r
3395 AsmWriteMsr64 (MSR_IA32_PEBS_ENABLE, Msr.Uint64);\r
3396 @endcode\r
7de98828 3397 @note MSR_IA32_PEBS_ENABLE is defined as IA32_PEBS_ENABLE in SDM.\r
04c980a6
MK
3398**/\r
3399#define MSR_IA32_PEBS_ENABLE 0x000003F1\r
3400\r
3401/**\r
3402 MSR information returned for MSR index #MSR_IA32_PEBS_ENABLE\r
3403**/\r
3404typedef union {\r
3405 ///\r
3406 /// Individual bit fields\r
3407 ///\r
3408 struct {\r
3409 ///\r
3410 /// [Bit 0] Enable PEBS on IA32_PMC0. Introduced at Display Family /\r
3411 /// Display Model 06_0FH.\r
3412 ///\r
3413 UINT32 Enable:1;\r
3414 ///\r
3415 /// [Bits 3:1] Reserved or Model specific.\r
3416 ///\r
3417 UINT32 Reserved1:3;\r
3418 UINT32 Reserved2:28;\r
3419 ///\r
3420 /// [Bits 35:32] Reserved or Model specific.\r
3421 ///\r
3422 UINT32 Reserved3:4;\r
3423 UINT32 Reserved4:28;\r
3424 } Bits;\r
3425 ///\r
3426 /// All bit fields as a 64-bit value\r
3427 ///\r
3428 UINT64 Uint64;\r
3429} MSR_IA32_PEBS_ENABLE_REGISTER;\r
3430\r
3431\r
3432/**\r
3433 MCn_CTL. If IA32_MCG_CAP.CNT > n.\r
3434\r
3435 @param ECX MSR_IA32_MCn_CTL\r
3436 @param EAX Lower 32-bits of MSR value.\r
3437 @param EDX Upper 32-bits of MSR value.\r
3438\r
3439 <b>Example usage</b>\r
3440 @code\r
3441 UINT64 Msr;\r
3442\r
3443 Msr = AsmReadMsr64 (MSR_IA32_MC0_CTL);\r
3444 AsmWriteMsr64 (MSR_IA32_MC0_CTL, Msr);\r
3445 @endcode\r
7de98828
JF
3446 @note MSR_IA32_MC0_CTL is defined as IA32_MC0_CTL in SDM.\r
3447 MSR_IA32_MC1_CTL is defined as IA32_MC1_CTL in SDM.\r
3448 MSR_IA32_MC2_CTL is defined as IA32_MC2_CTL in SDM.\r
3449 MSR_IA32_MC3_CTL is defined as IA32_MC3_CTL in SDM.\r
3450 MSR_IA32_MC4_CTL is defined as IA32_MC4_CTL in SDM.\r
3451 MSR_IA32_MC5_CTL is defined as IA32_MC5_CTL in SDM.\r
3452 MSR_IA32_MC6_CTL is defined as IA32_MC6_CTL in SDM.\r
3453 MSR_IA32_MC7_CTL is defined as IA32_MC7_CTL in SDM.\r
3454 MSR_IA32_MC8_CTL is defined as IA32_MC8_CTL in SDM.\r
3455 MSR_IA32_MC9_CTL is defined as IA32_MC9_CTL in SDM.\r
3456 MSR_IA32_MC10_CTL is defined as IA32_MC10_CTL in SDM.\r
3457 MSR_IA32_MC11_CTL is defined as IA32_MC11_CTL in SDM.\r
3458 MSR_IA32_MC12_CTL is defined as IA32_MC12_CTL in SDM.\r
3459 MSR_IA32_MC13_CTL is defined as IA32_MC13_CTL in SDM.\r
3460 MSR_IA32_MC14_CTL is defined as IA32_MC14_CTL in SDM.\r
3461 MSR_IA32_MC15_CTL is defined as IA32_MC15_CTL in SDM.\r
3462 MSR_IA32_MC16_CTL is defined as IA32_MC16_CTL in SDM.\r
3463 MSR_IA32_MC17_CTL is defined as IA32_MC17_CTL in SDM.\r
3464 MSR_IA32_MC18_CTL is defined as IA32_MC18_CTL in SDM.\r
3465 MSR_IA32_MC19_CTL is defined as IA32_MC19_CTL in SDM.\r
3466 MSR_IA32_MC20_CTL is defined as IA32_MC20_CTL in SDM.\r
3467 MSR_IA32_MC21_CTL is defined as IA32_MC21_CTL in SDM.\r
3468 MSR_IA32_MC22_CTL is defined as IA32_MC22_CTL in SDM.\r
3469 MSR_IA32_MC23_CTL is defined as IA32_MC23_CTL in SDM.\r
3470 MSR_IA32_MC24_CTL is defined as IA32_MC24_CTL in SDM.\r
3471 MSR_IA32_MC25_CTL is defined as IA32_MC25_CTL in SDM.\r
3472 MSR_IA32_MC26_CTL is defined as IA32_MC26_CTL in SDM.\r
3473 MSR_IA32_MC27_CTL is defined as IA32_MC27_CTL in SDM.\r
3474 MSR_IA32_MC28_CTL is defined as IA32_MC28_CTL in SDM.\r
04c980a6
MK
3475 @{\r
3476**/\r
3477#define MSR_IA32_MC0_CTL 0x00000400\r
3478#define MSR_IA32_MC1_CTL 0x00000404\r
3479#define MSR_IA32_MC2_CTL 0x00000408\r
3480#define MSR_IA32_MC3_CTL 0x0000040C\r
3481#define MSR_IA32_MC4_CTL 0x00000410\r
3482#define MSR_IA32_MC5_CTL 0x00000414\r
3483#define MSR_IA32_MC6_CTL 0x00000418\r
3484#define MSR_IA32_MC7_CTL 0x0000041C\r
3485#define MSR_IA32_MC8_CTL 0x00000420\r
3486#define MSR_IA32_MC9_CTL 0x00000424\r
3487#define MSR_IA32_MC10_CTL 0x00000428\r
3488#define MSR_IA32_MC11_CTL 0x0000042C\r
3489#define MSR_IA32_MC12_CTL 0x00000430\r
3490#define MSR_IA32_MC13_CTL 0x00000434\r
3491#define MSR_IA32_MC14_CTL 0x00000438\r
3492#define MSR_IA32_MC15_CTL 0x0000043C\r
3493#define MSR_IA32_MC16_CTL 0x00000440\r
3494#define MSR_IA32_MC17_CTL 0x00000444\r
3495#define MSR_IA32_MC18_CTL 0x00000448\r
3496#define MSR_IA32_MC19_CTL 0x0000044C\r
3497#define MSR_IA32_MC20_CTL 0x00000450\r
3498#define MSR_IA32_MC21_CTL 0x00000454\r
3499#define MSR_IA32_MC22_CTL 0x00000458\r
3500#define MSR_IA32_MC23_CTL 0x0000045C\r
3501#define MSR_IA32_MC24_CTL 0x00000460\r
3502#define MSR_IA32_MC25_CTL 0x00000464\r
3503#define MSR_IA32_MC26_CTL 0x00000468\r
3504#define MSR_IA32_MC27_CTL 0x0000046C\r
3505#define MSR_IA32_MC28_CTL 0x00000470\r
3506/// @}\r
3507\r
3508\r
3509/**\r
3510 MCn_STATUS. If IA32_MCG_CAP.CNT > n.\r
3511\r
3512 @param ECX MSR_IA32_MCn_STATUS\r
3513 @param EAX Lower 32-bits of MSR value.\r
3514 @param EDX Upper 32-bits of MSR value.\r
3515\r
3516 <b>Example usage</b>\r
3517 @code\r
3518 UINT64 Msr;\r
3519\r
3520 Msr = AsmReadMsr64 (MSR_IA32_MC0_STATUS);\r
3521 AsmWriteMsr64 (MSR_IA32_MC0_STATUS, Msr);\r
3522 @endcode\r
7de98828
JF
3523 @note MSR_IA32_MC0_STATUS is defined as IA32_MC0_STATUS in SDM.\r
3524 MSR_IA32_MC1_STATUS is defined as IA32_MC1_STATUS in SDM.\r
3525 MSR_IA32_MC2_STATUS is defined as IA32_MC2_STATUS in SDM.\r
3526 MSR_IA32_MC3_STATUS is defined as IA32_MC3_STATUS in SDM.\r
3527 MSR_IA32_MC4_STATUS is defined as IA32_MC4_STATUS in SDM.\r
3528 MSR_IA32_MC5_STATUS is defined as IA32_MC5_STATUS in SDM.\r
3529 MSR_IA32_MC6_STATUS is defined as IA32_MC6_STATUS in SDM.\r
3530 MSR_IA32_MC7_STATUS is defined as IA32_MC7_STATUS in SDM.\r
3531 MSR_IA32_MC8_STATUS is defined as IA32_MC8_STATUS in SDM.\r
3532 MSR_IA32_MC9_STATUS is defined as IA32_MC9_STATUS in SDM.\r
3533 MSR_IA32_MC10_STATUS is defined as IA32_MC10_STATUS in SDM.\r
3534 MSR_IA32_MC11_STATUS is defined as IA32_MC11_STATUS in SDM.\r
3535 MSR_IA32_MC12_STATUS is defined as IA32_MC12_STATUS in SDM.\r
3536 MSR_IA32_MC13_STATUS is defined as IA32_MC13_STATUS in SDM.\r
3537 MSR_IA32_MC14_STATUS is defined as IA32_MC14_STATUS in SDM.\r
3538 MSR_IA32_MC15_STATUS is defined as IA32_MC15_STATUS in SDM.\r
3539 MSR_IA32_MC16_STATUS is defined as IA32_MC16_STATUS in SDM.\r
3540 MSR_IA32_MC17_STATUS is defined as IA32_MC17_STATUS in SDM.\r
3541 MSR_IA32_MC18_STATUS is defined as IA32_MC18_STATUS in SDM.\r
3542 MSR_IA32_MC19_STATUS is defined as IA32_MC19_STATUS in SDM.\r
3543 MSR_IA32_MC20_STATUS is defined as IA32_MC20_STATUS in SDM.\r
3544 MSR_IA32_MC21_STATUS is defined as IA32_MC21_STATUS in SDM.\r
3545 MSR_IA32_MC22_STATUS is defined as IA32_MC22_STATUS in SDM.\r
3546 MSR_IA32_MC23_STATUS is defined as IA32_MC23_STATUS in SDM.\r
3547 MSR_IA32_MC24_STATUS is defined as IA32_MC24_STATUS in SDM.\r
3548 MSR_IA32_MC25_STATUS is defined as IA32_MC25_STATUS in SDM.\r
3549 MSR_IA32_MC26_STATUS is defined as IA32_MC26_STATUS in SDM.\r
3550 MSR_IA32_MC27_STATUS is defined as IA32_MC27_STATUS in SDM.\r
3551 MSR_IA32_MC28_STATUS is defined as IA32_MC28_STATUS in SDM.\r
04c980a6
MK
3552 @{\r
3553**/\r
3554#define MSR_IA32_MC0_STATUS 0x00000401\r
3555#define MSR_IA32_MC1_STATUS 0x00000405\r
3556#define MSR_IA32_MC2_STATUS 0x00000409\r
3557#define MSR_IA32_MC3_STATUS 0x0000040D\r
3558#define MSR_IA32_MC4_STATUS 0x00000411\r
3559#define MSR_IA32_MC5_STATUS 0x00000415\r
3560#define MSR_IA32_MC6_STATUS 0x00000419\r
3561#define MSR_IA32_MC7_STATUS 0x0000041D\r
3562#define MSR_IA32_MC8_STATUS 0x00000421\r
3563#define MSR_IA32_MC9_STATUS 0x00000425\r
3564#define MSR_IA32_MC10_STATUS 0x00000429\r
3565#define MSR_IA32_MC11_STATUS 0x0000042D\r
3566#define MSR_IA32_MC12_STATUS 0x00000431\r
3567#define MSR_IA32_MC13_STATUS 0x00000435\r
3568#define MSR_IA32_MC14_STATUS 0x00000439\r
3569#define MSR_IA32_MC15_STATUS 0x0000043D\r
3570#define MSR_IA32_MC16_STATUS 0x00000441\r
3571#define MSR_IA32_MC17_STATUS 0x00000445\r
3572#define MSR_IA32_MC18_STATUS 0x00000449\r
3573#define MSR_IA32_MC19_STATUS 0x0000044D\r
3574#define MSR_IA32_MC20_STATUS 0x00000451\r
3575#define MSR_IA32_MC21_STATUS 0x00000455\r
3576#define MSR_IA32_MC22_STATUS 0x00000459\r
3577#define MSR_IA32_MC23_STATUS 0x0000045D\r
3578#define MSR_IA32_MC24_STATUS 0x00000461\r
3579#define MSR_IA32_MC25_STATUS 0x00000465\r
3580#define MSR_IA32_MC26_STATUS 0x00000469\r
3581#define MSR_IA32_MC27_STATUS 0x0000046D\r
3582#define MSR_IA32_MC28_STATUS 0x00000471\r
3583/// @}\r
3584\r
3585\r
3586/**\r
3587 MCn_ADDR. If IA32_MCG_CAP.CNT > n.\r
3588\r
3589 @param ECX MSR_IA32_MCn_ADDR\r
3590 @param EAX Lower 32-bits of MSR value.\r
3591 @param EDX Upper 32-bits of MSR value.\r
3592\r
3593 <b>Example usage</b>\r
3594 @code\r
3595 UINT64 Msr;\r
3596\r
3597 Msr = AsmReadMsr64 (MSR_IA32_MC0_ADDR);\r
3598 AsmWriteMsr64 (MSR_IA32_MC0_ADDR, Msr);\r
3599 @endcode\r
7de98828
JF
3600 @note MSR_IA32_MC0_ADDR is defined as IA32_MC0_ADDR in SDM.\r
3601 MSR_IA32_MC1_ADDR is defined as IA32_MC1_ADDR in SDM.\r
3602 MSR_IA32_MC2_ADDR is defined as IA32_MC2_ADDR in SDM.\r
3603 MSR_IA32_MC3_ADDR is defined as IA32_MC3_ADDR in SDM.\r
3604 MSR_IA32_MC4_ADDR is defined as IA32_MC4_ADDR in SDM.\r
3605 MSR_IA32_MC5_ADDR is defined as IA32_MC5_ADDR in SDM.\r
3606 MSR_IA32_MC6_ADDR is defined as IA32_MC6_ADDR in SDM.\r
3607 MSR_IA32_MC7_ADDR is defined as IA32_MC7_ADDR in SDM.\r
3608 MSR_IA32_MC8_ADDR is defined as IA32_MC8_ADDR in SDM.\r
3609 MSR_IA32_MC9_ADDR is defined as IA32_MC9_ADDR in SDM.\r
3610 MSR_IA32_MC10_ADDR is defined as IA32_MC10_ADDR in SDM.\r
3611 MSR_IA32_MC11_ADDR is defined as IA32_MC11_ADDR in SDM.\r
3612 MSR_IA32_MC12_ADDR is defined as IA32_MC12_ADDR in SDM.\r
3613 MSR_IA32_MC13_ADDR is defined as IA32_MC13_ADDR in SDM.\r
3614 MSR_IA32_MC14_ADDR is defined as IA32_MC14_ADDR in SDM.\r
3615 MSR_IA32_MC15_ADDR is defined as IA32_MC15_ADDR in SDM.\r
3616 MSR_IA32_MC16_ADDR is defined as IA32_MC16_ADDR in SDM.\r
3617 MSR_IA32_MC17_ADDR is defined as IA32_MC17_ADDR in SDM.\r
3618 MSR_IA32_MC18_ADDR is defined as IA32_MC18_ADDR in SDM.\r
3619 MSR_IA32_MC19_ADDR is defined as IA32_MC19_ADDR in SDM.\r
3620 MSR_IA32_MC20_ADDR is defined as IA32_MC20_ADDR in SDM.\r
3621 MSR_IA32_MC21_ADDR is defined as IA32_MC21_ADDR in SDM.\r
3622 MSR_IA32_MC22_ADDR is defined as IA32_MC22_ADDR in SDM.\r
3623 MSR_IA32_MC23_ADDR is defined as IA32_MC23_ADDR in SDM.\r
3624 MSR_IA32_MC24_ADDR is defined as IA32_MC24_ADDR in SDM.\r
3625 MSR_IA32_MC25_ADDR is defined as IA32_MC25_ADDR in SDM.\r
3626 MSR_IA32_MC26_ADDR is defined as IA32_MC26_ADDR in SDM.\r
3627 MSR_IA32_MC27_ADDR is defined as IA32_MC27_ADDR in SDM.\r
3628 MSR_IA32_MC28_ADDR is defined as IA32_MC28_ADDR in SDM.\r
04c980a6
MK
3629 @{\r
3630**/\r
3631#define MSR_IA32_MC0_ADDR 0x00000402\r
3632#define MSR_IA32_MC1_ADDR 0x00000406\r
3633#define MSR_IA32_MC2_ADDR 0x0000040A\r
3634#define MSR_IA32_MC3_ADDR 0x0000040E\r
3635#define MSR_IA32_MC4_ADDR 0x00000412\r
3636#define MSR_IA32_MC5_ADDR 0x00000416\r
3637#define MSR_IA32_MC6_ADDR 0x0000041A\r
3638#define MSR_IA32_MC7_ADDR 0x0000041E\r
3639#define MSR_IA32_MC8_ADDR 0x00000422\r
3640#define MSR_IA32_MC9_ADDR 0x00000426\r
3641#define MSR_IA32_MC10_ADDR 0x0000042A\r
3642#define MSR_IA32_MC11_ADDR 0x0000042E\r
3643#define MSR_IA32_MC12_ADDR 0x00000432\r
3644#define MSR_IA32_MC13_ADDR 0x00000436\r
3645#define MSR_IA32_MC14_ADDR 0x0000043A\r
3646#define MSR_IA32_MC15_ADDR 0x0000043E\r
3647#define MSR_IA32_MC16_ADDR 0x00000442\r
3648#define MSR_IA32_MC17_ADDR 0x00000446\r
3649#define MSR_IA32_MC18_ADDR 0x0000044A\r
3650#define MSR_IA32_MC19_ADDR 0x0000044E\r
3651#define MSR_IA32_MC20_ADDR 0x00000452\r
3652#define MSR_IA32_MC21_ADDR 0x00000456\r
3653#define MSR_IA32_MC22_ADDR 0x0000045A\r
3654#define MSR_IA32_MC23_ADDR 0x0000045E\r
3655#define MSR_IA32_MC24_ADDR 0x00000462\r
3656#define MSR_IA32_MC25_ADDR 0x00000466\r
3657#define MSR_IA32_MC26_ADDR 0x0000046A\r
3658#define MSR_IA32_MC27_ADDR 0x0000046E\r
3659#define MSR_IA32_MC28_ADDR 0x00000472\r
3660/// @}\r
3661\r
3662\r
3663/**\r
3664 MCn_MISC. If IA32_MCG_CAP.CNT > n.\r
3665\r
3666 @param ECX MSR_IA32_MCn_MISC\r
3667 @param EAX Lower 32-bits of MSR value.\r
3668 @param EDX Upper 32-bits of MSR value.\r
3669\r
3670 <b>Example usage</b>\r
3671 @code\r
3672 UINT64 Msr;\r
3673\r
3674 Msr = AsmReadMsr64 (MSR_IA32_MC0_MISC);\r
3675 AsmWriteMsr64 (MSR_IA32_MC0_MISC, Msr);\r
3676 @endcode\r
7de98828
JF
3677 @note MSR_IA32_MC0_MISC is defined as IA32_MC0_MISC in SDM.\r
3678 MSR_IA32_MC1_MISC is defined as IA32_MC1_MISC in SDM.\r
3679 MSR_IA32_MC2_MISC is defined as IA32_MC2_MISC in SDM.\r
3680 MSR_IA32_MC3_MISC is defined as IA32_MC3_MISC in SDM.\r
3681 MSR_IA32_MC4_MISC is defined as IA32_MC4_MISC in SDM.\r
3682 MSR_IA32_MC5_MISC is defined as IA32_MC5_MISC in SDM.\r
3683 MSR_IA32_MC6_MISC is defined as IA32_MC6_MISC in SDM.\r
3684 MSR_IA32_MC7_MISC is defined as IA32_MC7_MISC in SDM.\r
3685 MSR_IA32_MC8_MISC is defined as IA32_MC8_MISC in SDM.\r
3686 MSR_IA32_MC9_MISC is defined as IA32_MC9_MISC in SDM.\r
3687 MSR_IA32_MC10_MISC is defined as IA32_MC10_MISC in SDM.\r
3688 MSR_IA32_MC11_MISC is defined as IA32_MC11_MISC in SDM.\r
3689 MSR_IA32_MC12_MISC is defined as IA32_MC12_MISC in SDM.\r
3690 MSR_IA32_MC13_MISC is defined as IA32_MC13_MISC in SDM.\r
3691 MSR_IA32_MC14_MISC is defined as IA32_MC14_MISC in SDM.\r
3692 MSR_IA32_MC15_MISC is defined as IA32_MC15_MISC in SDM.\r
3693 MSR_IA32_MC16_MISC is defined as IA32_MC16_MISC in SDM.\r
3694 MSR_IA32_MC17_MISC is defined as IA32_MC17_MISC in SDM.\r
3695 MSR_IA32_MC18_MISC is defined as IA32_MC18_MISC in SDM.\r
3696 MSR_IA32_MC19_MISC is defined as IA32_MC19_MISC in SDM.\r
3697 MSR_IA32_MC20_MISC is defined as IA32_MC20_MISC in SDM.\r
3698 MSR_IA32_MC21_MISC is defined as IA32_MC21_MISC in SDM.\r
3699 MSR_IA32_MC22_MISC is defined as IA32_MC22_MISC in SDM.\r
3700 MSR_IA32_MC23_MISC is defined as IA32_MC23_MISC in SDM.\r
3701 MSR_IA32_MC24_MISC is defined as IA32_MC24_MISC in SDM.\r
3702 MSR_IA32_MC25_MISC is defined as IA32_MC25_MISC in SDM.\r
3703 MSR_IA32_MC26_MISC is defined as IA32_MC26_MISC in SDM.\r
3704 MSR_IA32_MC27_MISC is defined as IA32_MC27_MISC in SDM.\r
3705 MSR_IA32_MC28_MISC is defined as IA32_MC28_MISC in SDM.\r
04c980a6
MK
3706 @{\r
3707**/\r
3708#define MSR_IA32_MC0_MISC 0x00000403\r
3709#define MSR_IA32_MC1_MISC 0x00000407\r
3710#define MSR_IA32_MC2_MISC 0x0000040B\r
3711#define MSR_IA32_MC3_MISC 0x0000040F\r
3712#define MSR_IA32_MC4_MISC 0x00000413\r
3713#define MSR_IA32_MC5_MISC 0x00000417\r
3714#define MSR_IA32_MC6_MISC 0x0000041B\r
3715#define MSR_IA32_MC7_MISC 0x0000041F\r
3716#define MSR_IA32_MC8_MISC 0x00000423\r
3717#define MSR_IA32_MC9_MISC 0x00000427\r
3718#define MSR_IA32_MC10_MISC 0x0000042B\r
3719#define MSR_IA32_MC11_MISC 0x0000042F\r
3720#define MSR_IA32_MC12_MISC 0x00000433\r
3721#define MSR_IA32_MC13_MISC 0x00000437\r
3722#define MSR_IA32_MC14_MISC 0x0000043B\r
3723#define MSR_IA32_MC15_MISC 0x0000043F\r
3724#define MSR_IA32_MC16_MISC 0x00000443\r
3725#define MSR_IA32_MC17_MISC 0x00000447\r
3726#define MSR_IA32_MC18_MISC 0x0000044B\r
3727#define MSR_IA32_MC19_MISC 0x0000044F\r
3728#define MSR_IA32_MC20_MISC 0x00000453\r
3729#define MSR_IA32_MC21_MISC 0x00000457\r
3730#define MSR_IA32_MC22_MISC 0x0000045B\r
3731#define MSR_IA32_MC23_MISC 0x0000045F\r
3732#define MSR_IA32_MC24_MISC 0x00000463\r
3733#define MSR_IA32_MC25_MISC 0x00000467\r
3734#define MSR_IA32_MC26_MISC 0x0000046B\r
3735#define MSR_IA32_MC27_MISC 0x0000046F\r
3736#define MSR_IA32_MC28_MISC 0x00000473\r
3737/// @}\r
3738\r
3739\r
3740/**\r
3741 Reporting Register of Basic VMX Capabilities (R/O) See Appendix A.1, "Basic\r
3742 VMX Information.". If CPUID.01H:ECX.[5] = 1.\r
3743\r
3744 @param ECX MSR_IA32_VMX_BASIC (0x00000480)\r
3745 @param EAX Lower 32-bits of MSR value.\r
3746 @param EDX Upper 32-bits of MSR value.\r
3747\r
3748 <b>Example usage</b>\r
3749 @code\r
831d287a 3750 MSR_IA32_VMX_BASIC_REGISTER Msr;\r
04c980a6 3751\r
831d287a 3752 Msr.Uint64 = AsmReadMsr64 (MSR_IA32_VMX_BASIC);\r
04c980a6 3753 @endcode\r
7de98828 3754 @note MSR_IA32_VMX_BASIC is defined as IA32_VMX_BASIC in SDM.\r
04c980a6
MK
3755**/\r
3756#define MSR_IA32_VMX_BASIC 0x00000480\r
3757\r
831d287a
MK
3758/**\r
3759 MSR information returned for MSR index #MSR_IA32_VMX_BASIC\r
3760**/\r
3761typedef union {\r
3762 ///\r
3763 /// Individual bit fields\r
3764 ///\r
3765 struct {\r
3766 ///\r
3767 /// [Bits 30:0] VMCS revision identifier used by the processor. Processors\r
3768 /// that use the same VMCS revision identifier use the same size for VMCS\r
3769 /// regions (see subsequent item on bits 44:32).\r
3770 ///\r
3771 /// @note Earlier versions of this manual specified that the VMCS revision\r
3772 /// identifier was a 32-bit field in bits 31:0 of this MSR. For all\r
3773 /// processors produced prior to this change, bit 31 of this MSR was read\r
3774 /// as 0.\r
3775 ///\r
3776 UINT32 VmcsRevisonId:31;\r
3777 UINT32 MustBeZero:1;\r
3778 ///\r
3779 /// [Bit 44:32] Reports the number of bytes that software should allocate\r
3780 /// for the VMXON region and any VMCS region. It is a value greater than\r
3781 /// 0 and at most 4096(bit 44 is set if and only if bits 43:32 are clear).\r
3782 ///\r
3783 UINT32 VmcsSize:13;\r
3784 UINT32 Reserved1:3;\r
3785 ///\r
3786 /// [Bit 48] Indicates the width of the physical addresses that may be used\r
3787 /// for the VMXON region, each VMCS, and data structures referenced by\r
3788 /// pointers in a VMCS (I/O bitmaps, virtual-APIC page, MSR areas for VMX\r
3789 /// transitions). If the bit is 0, these addresses are limited to the\r
3790 /// processor's physical-address width. If the bit is 1, these addresses\r
3791 /// are limited to 32 bits. This bit is always 0 for processors that\r
3792 /// support Intel 64 architecture.\r
3793 ///\r
3794 /// @note On processors that support Intel 64 architecture, the pointer\r
3795 /// must not set bits beyond the processor's physical address width.\r
3796 ///\r
3797 UINT32 VmcsAddressWidth:1;\r
3798 ///\r
3799 /// [Bit 49] If bit 49 is read as 1, the logical processor supports the\r
3800 /// dual-monitor treatment of system-management interrupts and\r
3801 /// system-management mode. See Section 34.15 for details of this treatment.\r
3802 ///\r
3803 UINT32 DualMonitor:1;\r
3804 ///\r
3805 /// [Bit 53:50] report the memory type that should be used for the VMCS,\r
3806 /// for data structures referenced by pointers in the VMCS (I/O bitmaps,\r
3807 /// virtual-APIC page, MSR areas for VMX transitions), and for the MSEG\r
3808 /// header. If software needs to access these data structures (e.g., to\r
3809 /// modify the contents of the MSR bitmaps), it can configure the paging\r
3810 /// structures to map them into the linear-address space. If it does so,\r
3811 /// it should establish mappings that use the memory type reported bits\r
3812 /// 53:50 in this MSR.\r
3813 ///\r
3814 /// As of this writing, all processors that support VMX operation indicate\r
3815 /// the write-back type.\r
3816 ///\r
3817 /// If software needs to access these data structures (e.g., to modify\r
3818 /// the contents of the MSR bitmaps), it can configure the paging\r
3819 /// structures to map them into the linear-address space. If it does so,\r
3820 /// it should establish mappings that use the memory type reported in this\r
3821 /// MSR.\r
3822 ///\r
3823 /// @note Alternatively, software may map any of these regions or\r
3824 /// structures with the UC memory type. (This may be necessary for the MSEG\r
3825 /// header.) Doing so is discouraged unless necessary as it will cause the\r
3826 /// performance of software accesses to those structures to suffer.\r
3827 ///\r
3828 ///\r
3829 UINT32 MemoryType:4;\r
3830 ///\r
0f16be6d
HW
3831 /// [Bit 54] If bit 54 is read as 1, the processor reports information in\r
3832 /// the VM-exit instruction-information field on VM exitsdue to execution\r
3833 /// of the INS and OUTS instructions (see Section 27.2.4). This reporting\r
3834 /// is done only if this bit is read as 1.\r
831d287a
MK
3835 ///\r
3836 UINT32 InsOutsReporting:1;\r
3837 ///\r
3838 /// [Bit 55] Bit 55 is read as 1 if any VMX controls that default to 1 may\r
3839 /// be cleared to 0. See Appendix A.2 for details. It also reports support\r
3840 /// for the VMX capability MSRs IA32_VMX_TRUE_PINBASED_CTLS,\r
3841 /// IA32_VMX_TRUE_PROCBASED_CTLS, IA32_VMX_TRUE_EXIT_CTLS, and\r
3842 /// IA32_VMX_TRUE_ENTRY_CTLS. See Appendix A.3.1, Appendix A.3.2,\r
3843 /// Appendix A.4, and Appendix A.5 for details.\r
3844 ///\r
3845 UINT32 VmxControls:1;\r
3846 UINT32 Reserved2:8;\r
3847 } Bits;\r
3848 ///\r
3849 /// All bit fields as a 64-bit value\r
3850 ///\r
3851 UINT64 Uint64;\r
3852} MSR_IA32_VMX_BASIC_REGISTER;\r
3853\r
3854///\r
3855/// @{ Define value for bit field MSR_IA32_VMX_BASIC_REGISTER.MemoryType\r
3856///\r
3857#define MSR_IA32_VMX_BASIC_REGISTER_MEMORY_TYPE_UNCACHEABLE 0x00\r
3858#define MSR_IA32_VMX_BASIC_REGISTER_MEMORY_TYPE_WRITE_BACK 0x06\r
3859///\r
3860/// @}\r
3861///\r
3862\r
04c980a6
MK
3863\r
3864/**\r
3865 Capability Reporting Register of Pinbased VM-execution Controls (R/O) See\r
3866 Appendix A.3.1, "Pin-Based VMExecution Controls.". If CPUID.01H:ECX.[5] = 1.\r
3867\r
3868 @param ECX MSR_IA32_VMX_PINBASED_CTLS (0x00000481)\r
3869 @param EAX Lower 32-bits of MSR value.\r
3870 @param EDX Upper 32-bits of MSR value.\r
3871\r
3872 <b>Example usage</b>\r
3873 @code\r
3874 UINT64 Msr;\r
3875\r
3876 Msr = AsmReadMsr64 (MSR_IA32_VMX_PINBASED_CTLS);\r
3877 @endcode\r
7de98828 3878 @note MSR_IA32_VMX_PINBASED_CTLS is defined as IA32_VMX_PINBASED_CTLS in SDM.\r
04c980a6
MK
3879**/\r
3880#define MSR_IA32_VMX_PINBASED_CTLS 0x00000481\r
3881\r
3882\r
3883/**\r
3884 Capability Reporting Register of Primary Processor-based VM-execution\r
3885 Controls (R/O) See Appendix A.3.2, "Primary Processor- Based VM-Execution\r
3886 Controls.". If CPUID.01H:ECX.[5] = 1.\r
3887\r
3888 @param ECX MSR_IA32_VMX_PROCBASED_CTLS (0x00000482)\r
3889 @param EAX Lower 32-bits of MSR value.\r
3890 @param EDX Upper 32-bits of MSR value.\r
3891\r
3892 <b>Example usage</b>\r
3893 @code\r
3894 UINT64 Msr;\r
3895\r
3896 Msr = AsmReadMsr64 (MSR_IA32_VMX_PROCBASED_CTLS);\r
3897 @endcode\r
7de98828 3898 @note MSR_IA32_VMX_PROCBASED_CTLS is defined as IA32_VMX_PROCBASED_CTLS in SDM.\r
04c980a6
MK
3899**/\r
3900#define MSR_IA32_VMX_PROCBASED_CTLS 0x00000482\r
3901\r
3902\r
3903/**\r
3904 Capability Reporting Register of VM-exit Controls (R/O) See Appendix A.4,\r
3905 "VM-Exit Controls.". If CPUID.01H:ECX.[5] = 1.\r
3906\r
3907 @param ECX MSR_IA32_VMX_EXIT_CTLS (0x00000483)\r
3908 @param EAX Lower 32-bits of MSR value.\r
3909 @param EDX Upper 32-bits of MSR value.\r
3910\r
3911 <b>Example usage</b>\r
3912 @code\r
3913 UINT64 Msr;\r
3914\r
3915 Msr = AsmReadMsr64 (MSR_IA32_VMX_EXIT_CTLS);\r
3916 @endcode\r
7de98828 3917 @note MSR_IA32_VMX_EXIT_CTLS is defined as IA32_VMX_EXIT_CTLS in SDM.\r
04c980a6
MK
3918**/\r
3919#define MSR_IA32_VMX_EXIT_CTLS 0x00000483\r
3920\r
3921\r
3922/**\r
3923 Capability Reporting Register of VMentry Controls (R/O) See Appendix A.5,\r
3924 "VM-Entry Controls.". If CPUID.01H:ECX.[5] = 1.\r
3925\r
3926 @param ECX MSR_IA32_VMX_ENTRY_CTLS (0x00000484)\r
3927 @param EAX Lower 32-bits of MSR value.\r
3928 @param EDX Upper 32-bits of MSR value.\r
3929\r
3930 <b>Example usage</b>\r
3931 @code\r
3932 UINT64 Msr;\r
3933\r
3934 Msr = AsmReadMsr64 (MSR_IA32_VMX_ENTRY_CTLS);\r
3935 @endcode\r
7de98828 3936 @note MSR_IA32_VMX_ENTRY_CTLS is defined as IA32_VMX_ENTRY_CTLS in SDM.\r
04c980a6
MK
3937**/\r
3938#define MSR_IA32_VMX_ENTRY_CTLS 0x00000484\r
3939\r
3940\r
3941/**\r
3942 Reporting Register of Miscellaneous VMX Capabilities (R/O) See Appendix A.6,\r
3943 "Miscellaneous Data.". If CPUID.01H:ECX.[5] = 1.\r
3944\r
3945 @param ECX MSR_IA32_VMX_MISC (0x00000485)\r
3946 @param EAX Lower 32-bits of MSR value.\r
3947 @param EDX Upper 32-bits of MSR value.\r
3948\r
3949 <b>Example usage</b>\r
3950 @code\r
831d287a 3951 IA32_VMX_MISC_REGISTER Msr;\r
04c980a6 3952\r
831d287a 3953 Msr.Uint64 = AsmReadMsr64 (MSR_IA32_VMX_MISC);\r
04c980a6 3954 @endcode\r
7de98828 3955 @note MSR_IA32_VMX_MISC is defined as IA32_VMX_MISC in SDM.\r
04c980a6
MK
3956**/\r
3957#define MSR_IA32_VMX_MISC 0x00000485\r
3958\r
831d287a
MK
3959/**\r
3960 MSR information returned for MSR index #IA32_VMX_MISC\r
3961**/\r
3962typedef union {\r
3963 ///\r
3964 /// Individual bit fields\r
3965 ///\r
3966 struct {\r
3967 ///\r
3968 /// [Bits 4:0] Reports a value X that specifies the relationship between the\r
3969 /// rate of the VMX-preemption timer and that of the timestamp counter (TSC).\r
3970 /// Specifically, the VMX-preemption timer (if it is active) counts down by\r
3971 /// 1 every time bit X in the TSC changes due to a TSC increment.\r
3972 ///\r
3973 UINT32 VmxTimerRatio:5;\r
3974 ///\r
3975 /// [Bit 5] If bit 5 is read as 1, VM exits store the value of IA32_EFER.LMA\r
3976 /// into the "IA-32e mode guest" VM-entry control;see Section 27.2 for more\r
3977 /// details. This bit is read as 1 on any logical processor that supports\r
3978 /// the 1-setting of the "unrestricted guest" VM-execution control.\r
3979 ///\r
3980 UINT32 VmExitEferLma:1;\r
3981 ///\r
3982 /// [Bit 6] reports (if set) the support for activity state 1 (HLT).\r
3983 ///\r
3984 UINT32 HltActivityStateSupported:1;\r
3985 ///\r
3986 /// [Bit 7] reports (if set) the support for activity state 2 (shutdown).\r
3987 ///\r
3988 UINT32 ShutdownActivityStateSupported:1;\r
3989 ///\r
3990 /// [Bit 8] reports (if set) the support for activity state 3 (wait-for-SIPI).\r
3991 ///\r
3992 UINT32 WaitForSipiActivityStateSupported:1;\r
0f16be6d
HW
3993 UINT32 Reserved1:5;\r
3994 ///\r
3995 /// [Bit 14] If read as 1, Intel(R) Processor Trace (Intel PT) can be used\r
3996 /// in VMX operation. If the processor supports Intel PT but does not allow\r
3997 /// it to be used in VMX operation, execution of VMXON clears\r
3998