]> git.proxmox.com Git - mirror_edk2.git/blame - UefiCpuPkg/Include/Register/Cpuid.h
UefiCpuPkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / UefiCpuPkg / Include / Register / Cpuid.h
CommitLineData
28a7ddf0 1/** @file\r
57d16ba1 2 CPUID leaf definitions.\r
28a7ddf0 3\r
57d16ba1
MK
4 Provides defines for CPUID leaf indexes. Data structures are provided for\r
5 registers returned by a CPUID leaf that contain one or more bit fields.\r
6 If a register returned is a single 32-bit value, then a data structure is\r
7 not provided for that register.\r
28a7ddf0 8\r
516e3397 9 Copyright (c) 2015 - 2019, Intel Corporation. All rights reserved.<BR>\r
0acd8697 10 SPDX-License-Identifier: BSD-2-Clause-Patent\r
57d16ba1
MK
11\r
12 @par Specification Reference:\r
13 Intel(R) 64 and IA-32 Architectures Software Developer's Manual, Volume 2A,\r
ee27f6ee 14 November 2018, CPUID instruction.\r
28a7ddf0
MK
15\r
16**/\r
17\r
18#ifndef __CPUID_H__\r
19#define __CPUID_H__\r
20\r
57d16ba1
MK
21/**\r
22 CPUID Signature Information\r
23\r
24 @param EAX CPUID_SIGNATURE (0x00)\r
25\r
26 @retval EAX Returns the highest value the CPUID instruction recognizes for\r
27 returning basic processor information. The value is returned is\r
28 processor specific.\r
29 @retval EBX First 4 characters of a vendor identification string.\r
30 @retval ECX Last 4 characters of a vendor identification string.\r
31 @retval EDX Middle 4 characters of a vendor identification string.\r
32\r
33 <b>Example usage</b>\r
34 @code\r
35 UINT32 Eax;\r
36 UINT32 Ebx;\r
37 UINT32 Ecx;\r
38 UINT32 Edx;\r
39\r
40 AsmCpuid (CPUID_SIGNATURE, &Eax, &Ebx, &Ecx, &Edx);\r
41 @endcode\r
42**/\r
43#define CPUID_SIGNATURE 0x00\r
44\r
45///\r
46/// @{ CPUID signature values returned by Intel processors\r
47///\r
48#define CPUID_SIGNATURE_GENUINE_INTEL_EBX SIGNATURE_32 ('G', 'e', 'n', 'u')\r
49#define CPUID_SIGNATURE_GENUINE_INTEL_EDX SIGNATURE_32 ('i', 'n', 'e', 'I')\r
50#define CPUID_SIGNATURE_GENUINE_INTEL_ECX SIGNATURE_32 ('n', 't', 'e', 'l')\r
51///\r
52/// @}\r
53///\r
54\r
55\r
56/**\r
57 CPUID Version Information\r
58\r
59 @param EAX CPUID_VERSION_INFO (0x01)\r
60\r
61 @retval EAX Returns Model, Family, Stepping Information described by the\r
62 type CPUID_VERSION_INFO_EAX.\r
63 @retval EBX Returns Brand, Cache Line Size, and Initial APIC ID described by\r
64 the type CPUID_VERSION_INFO_EBX.\r
65 @retval ECX CPU Feature Information described by the type\r
66 CPUID_VERSION_INFO_ECX.\r
67 @retval EDX CPU Feature Information described by the type\r
68 CPUID_VERSION_INFO_EDX.\r
69\r
70 <b>Example usage</b>\r
71 @code\r
72 CPUID_VERSION_INFO_EAX Eax;\r
73 CPUID_VERSION_INFO_EBX Ebx;\r
74 CPUID_VERSION_INFO_ECX Ecx;\r
75 CPUID_VERSION_INFO_EDX Edx;\r
76\r
77 AsmCpuid (CPUID_VERSION_INFO, &Eax.Uint32, &Ebx.Uint32, &Ecx.Uint32, &Edx.Uint32);\r
78 @endcode\r
79**/\r
80#define CPUID_VERSION_INFO 0x01\r
81\r
82/**\r
83 CPUID Version Information returned in EAX for CPUID leaf\r
84 #CPUID_VERSION_INFO.\r
85**/\r
86typedef union {\r
87 ///\r
88 /// Individual bit fields\r
89 ///\r
90 struct {\r
91 UINT32 SteppingId:4; ///< [Bits 3:0] Stepping ID\r
92 UINT32 Model:4; ///< [Bits 7:4] Model\r
93 UINT32 FamilyId:4; ///< [Bits 11:8] Family\r
94 UINT32 ProcessorType:2; ///< [Bits 13:12] Processor Type\r
95 UINT32 Reserved1:2; ///< [Bits 15:14] Reserved\r
96 UINT32 ExtendedModelId:4; ///< [Bits 19:16] Extended Model ID\r
97 UINT32 ExtendedFamilyId:8; ///< [Bits 27:20] Extended Family ID\r
98 UINT32 Reserved2:4; ///< Reserved\r
99 } Bits;\r
100 ///\r
101 /// All bit fields as a 32-bit value\r
102 ///\r
103 UINT32 Uint32;\r
104} CPUID_VERSION_INFO_EAX;\r
105\r
106///\r
107/// @{ Define value for bit field CPUID_VERSION_INFO_EAX.ProcessorType\r
108///\r
109#define CPUID_VERSION_INFO_EAX_PROCESSOR_TYPE_ORIGINAL_OEM_PROCESSOR 0x00\r
110#define CPUID_VERSION_INFO_EAX_PROCESSOR_TYPE_INTEL_OVERDRIVE_PROCESSOR 0x01\r
111#define CPUID_VERSION_INFO_EAX_PROCESSOR_TYPE_DUAL_PROCESSOR 0x02\r
112///\r
113/// @}\r
114///\r
115\r
116/**\r
117 CPUID Version Information returned in EBX for CPUID leaf\r
118 #CPUID_VERSION_INFO.\r
119**/\r
120typedef union {\r
121 ///\r
122 /// Individual bit fields\r
123 ///\r
124 struct {\r
125 ///\r
126 /// [Bits 7:0] Provides an entry into a brand string table that contains\r
127 /// brand strings for IA-32 processors.\r
128 ///\r
129 UINT32 BrandIndex:8;\r
130 ///\r
131 /// [Bits 15:8] Indicates the size of the cache line flushed by the CLFLUSH\r
132 /// and CLFLUSHOPT instructions in 8-byte increments. This field was\r
133 /// introduced in the Pentium 4 processor.\r
134 ///\r
135 UINT32 CacheLineSize:8;\r
136 ///\r
137 /// [Bits 23:16] Maximum number of addressable IDs for logical processors\r
138 /// in this physical package.\r
139 ///\r
140 /// @note\r
141 /// The nearest power-of-2 integer that is not smaller than EBX[23:16] is\r
142 /// the number of unique initial APICIDs reserved for addressing different\r
143 /// logical processors in a physical package. This field is only valid if\r
144 /// CPUID.1.EDX.HTT[bit 28]= 1.\r
145 ///\r
146 UINT32 MaximumAddressableIdsForLogicalProcessors:8;\r
147 ///\r
148 /// [Bits 31:24] The 8-bit ID that is assigned to the local APIC on the\r
149 /// processor during power up. This field was introduced in the Pentium 4\r
150 /// processor.\r
151 ///\r
152 UINT32 InitialLocalApicId:8;\r
153 } Bits;\r
154 ///\r
155 /// All bit fields as a 32-bit value\r
156 ///\r
157 UINT32 Uint32;\r
158} CPUID_VERSION_INFO_EBX;\r
159\r
160/**\r
161 CPUID Version Information returned in ECX for CPUID leaf\r
162 #CPUID_VERSION_INFO.\r
163**/\r
164typedef union {\r
165 ///\r
166 /// Individual bit fields\r
167 ///\r
168 struct {\r
169 ///\r
170 /// [Bit 0] Streaming SIMD Extensions 3 (SSE3). A value of 1 indicates the\r
171 /// processor supports this technology\r
172 ///\r
173 UINT32 SSE3:1;\r
174 ///\r
175 /// [Bit 1] A value of 1 indicates the processor supports the PCLMULQDQ\r
176 /// instruction. Carryless Multiplication\r
177 ///\r
178 UINT32 PCLMULQDQ:1;\r
179 ///\r
180 /// [Bit 2] 64-bit DS Area. A value of 1 indicates the processor supports\r
181 /// DS area using 64-bit layout.\r
182 ///\r
183 UINT32 DTES64:1;\r
184 ///\r
185 /// [Bit 3] MONITOR/MWAIT. A value of 1 indicates the processor supports\r
186 /// this feature.\r
187 ///\r
188 UINT32 MONITOR:1;\r
189 ///\r
190 /// [Bit 4] CPL Qualified Debug Store. A value of 1 indicates the processor\r
191 /// supports the extensions to the Debug Store feature to allow for branch\r
192 /// message storage qualified by CPL\r
193 ///\r
194 UINT32 DS_CPL:1;\r
195 ///\r
196 /// [Bit 5] Virtual Machine Extensions. A value of 1 indicates that the\r
197 /// processor supports this technology.\r
198 ///\r
199 UINT32 VMX:1;\r
200 ///\r
201 /// [Bit 6] Safer Mode Extensions. A value of 1 indicates that the processor\r
202 /// supports this technology\r
203 ///\r
204 UINT32 SMX:1;\r
205 ///\r
206 /// [Bit 7] Enhanced Intel SpeedStep(R) technology. A value of 1 indicates\r
207 /// that the processor supports this technology\r
208 ///\r
209 UINT32 EIST:1;\r
210 ///\r
211 /// [Bit 8] Thermal Monitor 2. A value of 1 indicates whether the processor\r
212 /// supports this technology\r
213 ///\r
214 UINT32 TM2:1;\r
215 ///\r
216 /// [Bit 9] A value of 1 indicates the presence of the Supplemental Streaming\r
217 /// SIMD Extensions 3 (SSSE3). A value of 0 indicates the instruction\r
218 /// extensions are not present in the processor.\r
219 ///\r
220 UINT32 SSSE3:1;\r
221 ///\r
222 /// [Bit 10] L1 Context ID. A value of 1 indicates the L1 data cache mode\r
223 /// can be set to either adaptive mode or shared mode. A value of 0 indicates\r
224 /// this feature is not supported. See definition of the IA32_MISC_ENABLE MSR\r
225 /// Bit 24 (L1 Data Cache Context Mode) for details\r
226 ///\r
227 UINT32 CNXT_ID:1;\r
228 ///\r
229 /// [Bit 11] A value of 1 indicates the processor supports IA32_DEBUG_INTERFACE\r
230 /// MSR for silicon debug\r
231 ///\r
232 UINT32 SDBG:1;\r
233 ///\r
234 /// [Bit 12] A value of 1 indicates the processor supports FMA (Fused Multiple\r
235 /// Add) extensions using YMM state.\r
236 ///\r
237 UINT32 FMA:1;\r
238 ///\r
239 /// [Bit 13] CMPXCHG16B Available. A value of 1 indicates that the feature\r
240 /// is available.\r
241 ///\r
242 UINT32 CMPXCHG16B:1;\r
243 ///\r
244 /// [Bit 14] xTPR Update Control. A value of 1 indicates that the processor\r
245 /// supports changing IA32_MISC_ENABLE[Bit 23].\r
246 ///\r
247 UINT32 xTPR_Update_Control:1;\r
248 ///\r
249 /// [Bit 15] Perfmon and Debug Capability: A value of 1 indicates the\r
250 /// processor supports the performance and debug feature indication MSR\r
251 /// IA32_PERF_CAPABILITIES.\r
252 ///\r
253 UINT32 PDCM:1;\r
254 UINT32 Reserved:1;\r
255 ///\r
256 /// [Bit 17] Process-context identifiers. A value of 1 indicates that the\r
257 /// processor supports PCIDs and that software may set CR4.PCIDE to 1.\r
258 ///\r
259 UINT32 PCID:1;\r
260 ///\r
261 /// [Bit 18] A value of 1 indicates the processor supports the ability to\r
262 /// prefetch data from a memory mapped device. Direct Cache Access.\r
263 ///\r
264 UINT32 DCA:1;\r
265 ///\r
266 /// [Bit 19] A value of 1 indicates that the processor supports SSE4.1.\r
267 ///\r
268 UINT32 SSE4_1:1;\r
269 ///\r
270 /// [Bit 20] A value of 1 indicates that the processor supports SSE4.2.\r
271 ///\r
272 UINT32 SSE4_2:1;\r
273 ///\r
274 /// [Bit 21] A value of 1 indicates that the processor supports x2APIC\r
275 /// feature.\r
276 ///\r
277 UINT32 x2APIC:1;\r
278 ///\r
279 /// [Bit 22] A value of 1 indicates that the processor supports MOVBE\r
280 /// instruction.\r
281 ///\r
282 UINT32 MOVBE:1;\r
283 ///\r
284 /// [Bit 23] A value of 1 indicates that the processor supports the POPCNT\r
285 /// instruction.\r
286 ///\r
287 UINT32 POPCNT:1;\r
288 ///\r
289 /// [Bit 24] A value of 1 indicates that the processor's local APIC timer\r
290 /// supports one-shot operation using a TSC deadline value.\r
291 ///\r
292 UINT32 TSC_Deadline:1;\r
293 ///\r
294 /// [Bit 25] A value of 1 indicates that the processor supports the AESNI\r
295 /// instruction extensions.\r
296 ///\r
297 UINT32 AESNI:1;\r
298 ///\r
299 /// [Bit 26] A value of 1 indicates that the processor supports the\r
300 /// XSAVE/XRSTOR processor extended states feature, the XSETBV/XGETBV\r
301 /// instructions, and XCR0.\r
302 ///\r
303 UINT32 XSAVE:1;\r
304 ///\r
305 /// [Bit 27] A value of 1 indicates that the OS has set CR4.OSXSAVE[Bit 18]\r
306 /// to enable XSETBV/XGETBV instructions to access XCR0 and to support\r
307 /// processor extended state management using XSAVE/XRSTOR.\r
308 ///\r
309 UINT32 OSXSAVE:1;\r
310 ///\r
311 /// [Bit 28] A value of 1 indicates the processor supports the AVX instruction\r
312 /// extensions.\r
313 ///\r
314 UINT32 AVX:1;\r
315 ///\r
316 /// [Bit 29] A value of 1 indicates that processor supports 16-bit\r
317 /// floating-point conversion instructions.\r
318 ///\r
319 UINT32 F16C:1;\r
320 ///\r
321 /// [Bit 30] A value of 1 indicates that processor supports RDRAND instruction.\r
322 ///\r
323 UINT32 RDRAND:1;\r
324 ///\r
325 /// [Bit 31] Always returns 0.\r
326 ///\r
327 UINT32 NotUsed:1;\r
328 } Bits;\r
329 ///\r
330 /// All bit fields as a 32-bit value\r
331 ///\r
332 UINT32 Uint32;\r
333} CPUID_VERSION_INFO_ECX;\r
334\r
335/**\r
336 CPUID Version Information returned in EDX for CPUID leaf\r
337 #CPUID_VERSION_INFO.\r
338**/\r
339typedef union {\r
340 ///\r
341 /// Individual bit fields\r
342 ///\r
343 struct {\r
344 ///\r
345 /// [Bit 0] Floating Point Unit On-Chip. The processor contains an x87 FPU.\r
346 ///\r
347 UINT32 FPU:1;\r
348 ///\r
349 /// [Bit 1] Virtual 8086 Mode Enhancements. Virtual 8086 mode enhancements,\r
350 /// including CR4.VME for controlling the feature, CR4.PVI for protected\r
351 /// mode virtual interrupts, software interrupt indirection, expansion of\r
352 /// the TSS with the software indirection bitmap, and EFLAGS.VIF and\r
353 /// EFLAGS.VIP flags.\r
354 ///\r
355 UINT32 VME:1;\r
356 ///\r
357 /// [Bit 2] Debugging Extensions. Support for I/O breakpoints, including\r
358 /// CR4.DE for controlling the feature, and optional trapping of accesses to\r
359 /// DR4 and DR5.\r
360 ///\r
361 UINT32 DE:1;\r
362 ///\r
363 /// [Bit 3] Page Size Extension. Large pages of size 4 MByte are supported,\r
364 /// including CR4.PSE for controlling the feature, the defined dirty bit in\r
365 /// PDE (Page Directory Entries), optional reserved bit trapping in CR3,\r
366 /// PDEs, and PTEs.\r
367 ///\r
368 UINT32 PSE:1;\r
369 ///\r
370 /// [Bit 4] Time Stamp Counter. The RDTSC instruction is supported,\r
371 /// including CR4.TSD for controlling privilege.\r
372 ///\r
373 UINT32 TSC:1;\r
374 ///\r
375 /// [Bit 5] Model Specific Registers RDMSR and WRMSR Instructions. The\r
376 /// RDMSR and WRMSR instructions are supported. Some of the MSRs are\r
377 /// implementation dependent.\r
378 ///\r
379 UINT32 MSR:1;\r
380 ///\r
381 /// [Bit 6] Physical Address Extension. Physical addresses greater than 32\r
382 /// bits are supported: extended page table entry formats, an extra level in\r
383 /// the page translation tables is defined, 2-MByte pages are supported\r
384 /// instead of 4 Mbyte pages if PAE bit is 1.\r
385 ///\r
386 UINT32 PAE:1;\r
387 ///\r
388 /// [Bit 7] Machine Check Exception. Exception 18 is defined for Machine\r
389 /// Checks, including CR4.MCE for controlling the feature. This feature does\r
390 /// not define the model-specific implementations of machine-check error\r
391 /// logging, reporting, and processor shutdowns. Machine Check exception\r
392 /// handlers may have to depend on processor version to do model specific\r
393 /// processing of the exception, or test for the presence of the Machine\r
394 /// Check feature.\r
395 ///\r
396 UINT32 MCE:1;\r
397 ///\r
398 /// [Bit 8] CMPXCHG8B Instruction. The compare-and-exchange 8 bytes(64 bits)\r
399 /// instruction is supported (implicitly locked and atomic).\r
400 ///\r
401 UINT32 CX8:1;\r
402 ///\r
403 /// [Bit 9] APIC On-Chip. The processor contains an Advanced Programmable\r
404 /// Interrupt Controller (APIC), responding to memory mapped commands in the\r
405 /// physical address range FFFE0000H to FFFE0FFFH (by default - some\r
406 /// processors permit the APIC to be relocated).\r
407 ///\r
408 UINT32 APIC:1;\r
409 UINT32 Reserved1:1;\r
410 ///\r
411 /// [Bit 11] SYSENTER and SYSEXIT Instructions. The SYSENTER and SYSEXIT\r
412 /// and associated MSRs are supported.\r
413 ///\r
414 UINT32 SEP:1;\r
415 ///\r
416 /// [Bit 12] Memory Type Range Registers. MTRRs are supported. The MTRRcap\r
417 /// MSR contains feature bits that describe what memory types are supported,\r
418 /// how many variable MTRRs are supported, and whether fixed MTRRs are\r
419 /// supported.\r
420 ///\r
421 UINT32 MTRR:1;\r
422 ///\r
423 /// [Bit 13] Page Global Bit. The global bit is supported in paging-structure\r
424 /// entries that map a page, indicating TLB entries that are common to\r
425 /// different processes and need not be flushed. The CR4.PGE bit controls\r
426 /// this feature.\r
427 ///\r
428 UINT32 PGE:1;\r
429 ///\r
14806d7b
HW
430 /// [Bit 14] Machine Check Architecture. A value of 1 indicates the Machine\r
431 /// Check Architecture of reporting machine errors is supported. The MCG_CAP\r
432 /// MSR contains feature bits describing how many banks of error reporting\r
433 /// MSRs are supported.\r
57d16ba1
MK
434 ///\r
435 UINT32 MCA:1;\r
436 ///\r
437 /// [Bit 15] Conditional Move Instructions. The conditional move instruction\r
438 /// CMOV is supported. In addition, if x87 FPU is present as indicated by the\r
439 /// CPUID.FPU feature bit, then the FCOMI and FCMOV instructions are supported.\r
440 ///\r
441 UINT32 CMOV:1;\r
442 ///\r
443 /// [Bit 16] Page Attribute Table. Page Attribute Table is supported. This\r
444 /// feature augments the Memory Type Range Registers (MTRRs), allowing an\r
445 /// operating system to specify attributes of memory accessed through a\r
446 /// linear address on a 4KB granularity.\r
447 ///\r
448 UINT32 PAT:1;\r
449 ///\r
450 /// [Bit 17] 36-Bit Page Size Extension. 4-MByte pages addressing physical\r
451 /// memory beyond 4 GBytes are supported with 32-bit paging. This feature\r
452 /// indicates that upper bits of the physical address of a 4-MByte page are\r
453 /// encoded in bits 20:13 of the page-directory entry. Such physical\r
454 /// addresses are limited by MAXPHYADDR and may be up to 40 bits in size.\r
455 ///\r
456 UINT32 PSE_36:1;\r
457 ///\r
458 /// [Bit 18] Processor Serial Number. The processor supports the 96-bit\r
459 /// processor identification number feature and the feature is enabled.\r
460 ///\r
461 UINT32 PSN:1;\r
462 ///\r
463 /// [Bit 19] CLFLUSH Instruction. CLFLUSH Instruction is supported.\r
464 ///\r
465 UINT32 CLFSH:1;\r
466 UINT32 Reserved2:1;\r
467 ///\r
468 /// [Bit 21] Debug Store. The processor supports the ability to write debug\r
469 /// information into a memory resident buffer. This feature is used by the\r
470 /// branch trace store (BTS) and precise event-based sampling (PEBS)\r
471 /// facilities.\r
472 ///\r
473 UINT32 DS:1;\r
474 ///\r
475 /// [Bit 22] Thermal Monitor and Software Controlled Clock Facilities. The\r
476 /// processor implements internal MSRs that allow processor temperature to\r
477 /// be monitored and processor performance to be modulated in predefined\r
478 /// duty cycles under software control.\r
479 ///\r
480 UINT32 ACPI:1;\r
481 ///\r
482 /// [Bit 23] Intel MMX Technology. The processor supports the Intel MMX\r
483 /// technology.\r
484 ///\r
485 UINT32 MMX:1;\r
486 ///\r
487 /// [Bit 24] FXSAVE and FXRSTOR Instructions. The FXSAVE and FXRSTOR\r
488 /// instructions are supported for fast save and restore of the floating\r
489 /// point context. Presence of this bit also indicates that CR4.OSFXSR is\r
490 /// available for an operating system to indicate that it supports the\r
491 /// FXSAVE and FXRSTOR instructions.\r
492 ///\r
493 UINT32 FXSR:1;\r
494 ///\r
495 /// [Bit 25] SSE. The processor supports the SSE extensions.\r
496 ///\r
497 UINT32 SSE:1;\r
498 ///\r
499 /// [Bit 26] SSE2. The processor supports the SSE2 extensions.\r
500 ///\r
501 UINT32 SSE2:1;\r
502 ///\r
503 /// [Bit 27] Self Snoop. The processor supports the management of\r
504 /// conflicting memory types by performing a snoop of its own cache\r
505 /// structure for transactions issued to the bus.\r
506 ///\r
507 UINT32 SS:1;\r
508 ///\r
509 /// [Bit 28] Max APIC IDs reserved field is Valid. A value of 0 for HTT\r
510 /// indicates there is only a single logical processor in the package and\r
511 /// software should assume only a single APIC ID is reserved. A value of 1\r
512 /// for HTT indicates the value in CPUID.1.EBX[23:16] (the Maximum number of\r
513 /// addressable IDs for logical processors in this package) is valid for the\r
514 /// package.\r
515 ///\r
516 UINT32 HTT:1;\r
517 ///\r
518 /// [Bit 29] Thermal Monitor. The processor implements the thermal monitor\r
519 /// automatic thermal control circuitry (TCC).\r
520 ///\r
521 UINT32 TM:1;\r
522 UINT32 Reserved3:1;\r
523 ///\r
524 /// [Bit 31] Pending Break Enable. The processor supports the use of the\r
525 /// FERR#/PBE# pin when the processor is in the stop-clock state (STPCLK# is\r
526 /// asserted) to signal the processor that an interrupt is pending and that\r
527 /// the processor should return to normal operation to handle the interrupt.\r
528 /// Bit 10 (PBE enable) in the IA32_MISC_ENABLE MSR enables this capability.\r
529 ///\r
530 UINT32 PBE:1;\r
531 } Bits;\r
532 ///\r
533 /// All bit fields as a 32-bit value\r
534 ///\r
535 UINT32 Uint32;\r
536} CPUID_VERSION_INFO_EDX;\r
537\r
538\r
539/**\r
540 CPUID Cache and TLB Information\r
541\r
542 @param EAX CPUID_CACHE_INFO (0x02)\r
543\r
544 @retval EAX Cache and TLB Information described by the type\r
545 CPUID_CACHE_INFO_CACHE_TLB.\r
546 CPUID_CACHE_INFO_CACHE_TLB.CacheDescriptor[0] always returns\r
547 0x01 and must be ignored. Only valid if\r
548 CPUID_CACHE_INFO_CACHE_TLB.Bits.NotValid is clear.\r
549 @retval EBX Cache and TLB Information described by the type\r
550 CPUID_CACHE_INFO_CACHE_TLB. Only valid if\r
551 CPUID_CACHE_INFO_CACHE_TLB.Bits.NotValid is clear.\r
552 @retval ECX Cache and TLB Information described by the type\r
553 CPUID_CACHE_INFO_CACHE_TLB. Only valid if\r
554 CPUID_CACHE_INFO_CACHE_TLB.Bits.NotValid is clear.\r
555 @retval EDX Cache and TLB Information described by the type\r
556 CPUID_CACHE_INFO_CACHE_TLB. Only valid if\r
557 CPUID_CACHE_INFO_CACHE_TLB.Bits.NotValid is clear.\r
558\r
559 <b>Example usage</b>\r
560 @code\r
561 CPUID_CACHE_INFO_CACHE_TLB Eax;\r
562 CPUID_CACHE_INFO_CACHE_TLB Ebx;\r
563 CPUID_CACHE_INFO_CACHE_TLB Ecx;\r
564 CPUID_CACHE_INFO_CACHE_TLB Edx;\r
565\r
566 AsmCpuid (CPUID_CACHE_INFO, &Eax.Uint32, &Ebx.Uint32, &Ecx.Uint32, &Edx.Uint32);\r
567 @endcode\r
568\r
569 <b>Cache Descriptor values</b>\r
570 <table>\r
571 <tr><th>Value </th><th> Type </th><th> Description </th></tr>\r
572 <tr><td> 0x00 </td><td> General </td><td> Null descriptor, this byte contains no information</td></tr>\r
573 <tr><td> 0x01 </td><td> TLB </td><td> Instruction TLB: 4 KByte pages, 4-way set associative, 32 entries</td></tr>\r
574 <tr><td> 0x02 </td><td> TLB </td><td> Instruction TLB: 4 MByte pages, fully associative, 2 entries</td></tr>\r
575 <tr><td> 0x03 </td><td> TLB </td><td> Data TLB: 4 KByte pages, 4-way set associative, 64 entries</td></tr>\r
576 <tr><td> 0x04 </td><td> TLB </td><td> Data TLB: 4 MByte pages, 4-way set associative, 8 entries</td></tr>\r
577 <tr><td> 0x05 </td><td> TLB </td><td> Data TLB1: 4 MByte pages, 4-way set associative, 32 entries</td></tr>\r
578 <tr><td> 0x06 </td><td> Cache </td><td> 1st-level instruction cache: 8 KBytes, 4-way set associative,\r
579 32 byte line size</td></tr>\r
580 <tr><td> 0x08 </td><td> Cache </td><td> 1st-level instruction cache: 16 KBytes, 4-way set associative,\r
581 32 byte line size</td></tr>\r
582 <tr><td> 0x09 </td><td> Cache </td><td> 1st-level instruction cache: 32KBytes, 4-way set associative,\r
583 64 byte line size</td></tr>\r
584 <tr><td> 0x0A </td><td> Cache </td><td> 1st-level data cache: 8 KBytes, 2-way set associative, 32 byte line size</td></tr>\r
585 <tr><td> 0x0B </td><td> TLB </td><td> Instruction TLB: 4 MByte pages, 4-way set associative, 4 entries</td></tr>\r
586 <tr><td> 0x0C </td><td> Cache </td><td> 1st-level data cache: 16 KBytes, 4-way set associative, 32 byte line size</td></tr>\r
587 <tr><td> 0x0D </td><td> Cache </td><td> 1st-level data cache: 16 KBytes, 4-way set associative, 64 byte line size</td></tr>\r
588 <tr><td> 0x0E </td><td> Cache </td><td> 1st-level data cache: 24 KBytes, 6-way set associative, 64 byte line size</td></tr>\r
589 <tr><td> 0x1D </td><td> Cache </td><td> 2nd-level cache: 128 KBytes, 2-way set associative, 64 byte line size</td></tr>\r
590 <tr><td> 0x21 </td><td> Cache </td><td> 2nd-level cache: 256 KBytes, 8-way set associative, 64 byte line size</td></tr>\r
591 <tr><td> 0x22 </td><td> Cache </td><td> 3rd-level cache: 512 KBytes, 4-way set associative, 64 byte line size,\r
592 2 lines per sector</td></tr>\r
593 <tr><td> 0x23 </td><td> Cache </td><td> 3rd-level cache: 1 MBytes, 8-way set associative, 64 byte line size,\r
594 2 lines per sector</td></tr>\r
595 <tr><td> 0x24 </td><td> Cache </td><td> 2nd-level cache: 1 MBytes, 16-way set associative, 64 byte line size</td></tr>\r
596 <tr><td> 0x25 </td><td> Cache </td><td> 3rd-level cache: 2 MBytes, 8-way set associative, 64 byte line size,\r
597 2 lines per sector</td></tr>\r
598 <tr><td> 0x29 </td><td> Cache </td><td> 3rd-level cache: 4 MBytes, 8-way set associative, 64 byte line size,\r
599 2 lines per sector</td></tr>\r
600 <tr><td> 0x2C </td><td> Cache </td><td> 1st-level data cache: 32 KBytes, 8-way set associative,\r
601 64 byte line size</td></tr>\r
602 <tr><td> 0x30 </td><td> Cache </td><td> 1st-level instruction cache: 32 KBytes, 8-way set associative,\r
603 64 byte line size</td></tr>\r
604 <tr><td> 0x40 </td><td> Cache </td><td> No 2nd-level cache or, if processor contains a valid 2nd-level cache,\r
605 no 3rd-level cache</td></tr>\r
606 <tr><td> 0x41 </td><td> Cache </td><td> 2nd-level cache: 128 KBytes, 4-way set associative, 32 byte line size</td></tr>\r
607 <tr><td> 0x42 </td><td> Cache </td><td> 2nd-level cache: 256 KBytes, 4-way set associative, 32 byte line size</td></tr>\r
608 <tr><td> 0x43 </td><td> Cache </td><td> 2nd-level cache: 512 KBytes, 4-way set associative, 32 byte line size</td></tr>\r
609 <tr><td> 0x44 </td><td> Cache </td><td> 2nd-level cache: 1 MByte, 4-way set associative, 32 byte line size</td></tr>\r
610 <tr><td> 0x45 </td><td> Cache </td><td> 2nd-level cache: 2 MByte, 4-way set associative, 32 byte line size</td></tr>\r
611 <tr><td> 0x46 </td><td> Cache </td><td> 3rd-level cache: 4 MByte, 4-way set associative, 64 byte line size</td></tr>\r
612 <tr><td> 0x47 </td><td> Cache </td><td> 3rd-level cache: 8 MByte, 8-way set associative, 64 byte line size</td></tr>\r
613 <tr><td> 0x48 </td><td> Cache </td><td> 2nd-level cache: 3MByte, 12-way set associative, 64 byte line size</td></tr>\r
614 <tr><td> 0x49 </td><td> Cache </td><td> 3rd-level cache: 4MB, 16-way set associative, 64-byte line size\r
615 (Intel Xeon processor MP, Family 0FH, Model 06H)<BR>\r
616 2nd-level cache: 4 MByte, 16-way set associative, 64 byte line size</td></tr>\r
617 <tr><td> 0x4A </td><td> Cache </td><td> 3rd-level cache: 6MByte, 12-way set associative, 64 byte line size</td></tr>\r
618 <tr><td> 0x4B </td><td> Cache </td><td> 3rd-level cache: 8MByte, 16-way set associative, 64 byte line size</td></tr>\r
619 <tr><td> 0x4C </td><td> Cache </td><td> 3rd-level cache: 12MByte, 12-way set associative, 64 byte line size</td></tr>\r
620 <tr><td> 0x4D </td><td> Cache </td><td> 3rd-level cache: 16MByte, 16-way set associative, 64 byte line size</td></tr>\r
621 <tr><td> 0x4E </td><td> Cache </td><td> 2nd-level cache: 6MByte, 24-way set associative, 64 byte line size</td></tr>\r
622 <tr><td> 0x4F </td><td> TLB </td><td> Instruction TLB: 4 KByte pages, 32 entries</td></tr>\r
623 <tr><td> 0x50 </td><td> TLB </td><td> Instruction TLB: 4 KByte and 2-MByte or 4-MByte pages, 64 entries</td></tr>\r
624 <tr><td> 0x51 </td><td> TLB </td><td> Instruction TLB: 4 KByte and 2-MByte or 4-MByte pages, 128 entries</td></tr>\r
625 <tr><td> 0x52 </td><td> TLB </td><td> Instruction TLB: 4 KByte and 2-MByte or 4-MByte pages, 256 entries</td></tr>\r
626 <tr><td> 0x55 </td><td> TLB </td><td> Instruction TLB: 2-MByte or 4-MByte pages, fully associative, 7 entries</td></tr>\r
627 <tr><td> 0x56 </td><td> TLB </td><td> Data TLB0: 4 MByte pages, 4-way set associative, 16 entries</td></tr>\r
628 <tr><td> 0x57 </td><td> TLB </td><td> Data TLB0: 4 KByte pages, 4-way associative, 16 entries</td></tr>\r
629 <tr><td> 0x59 </td><td> TLB </td><td> Data TLB0: 4 KByte pages, fully associative, 16 entries</td></tr>\r
14806d7b 630 <tr><td> 0x5A </td><td> TLB </td><td> Data TLB0: 2 MByte or 4 MByte pages, 4-way set associative, 32 entries</td></tr>\r
57d16ba1
MK
631 <tr><td> 0x5B </td><td> TLB </td><td> Data TLB: 4 KByte and 4 MByte pages, 64 entries</td></tr>\r
632 <tr><td> 0x5C </td><td> TLB </td><td> Data TLB: 4 KByte and 4 MByte pages,128 entries</td></tr>\r
633 <tr><td> 0x5D </td><td> TLB </td><td> Data TLB: 4 KByte and 4 MByte pages,256 entries</td></tr>\r
634 <tr><td> 0x60 </td><td> Cache </td><td> 1st-level data cache: 16 KByte, 8-way set associative, 64 byte line size</td></tr>\r
635 <tr><td> 0x61 </td><td> TLB </td><td> Instruction TLB: 4 KByte pages, fully associative, 48 entries</td></tr>\r
14806d7b
HW
636 <tr><td> 0x63 </td><td> TLB </td><td> Data TLB: 2 MByte or 4 MByte pages, 4-way set associative,\r
637 32 entries and a separate array with 1 GByte pages, 4-way set associative,\r
638 4 entries</td></tr>\r
639 <tr><td> 0x64 </td><td> TLB </td><td> Data TLB: 4 KByte pages, 4-way set associative, 512 entries</td></tr>\r
57d16ba1
MK
640 <tr><td> 0x66 </td><td> Cache </td><td> 1st-level data cache: 8 KByte, 4-way set associative, 64 byte line size</td></tr>\r
641 <tr><td> 0x67 </td><td> Cache </td><td> 1st-level data cache: 16 KByte, 4-way set associative, 64 byte line size</td></tr>\r
642 <tr><td> 0x68 </td><td> Cache </td><td> 1st-level data cache: 32 KByte, 4-way set associative, 64 byte line size</td></tr>\r
643 <tr><td> 0x6A </td><td> Cache </td><td> uTLB: 4 KByte pages, 8-way set associative, 64 entries</td></tr>\r
644 <tr><td> 0x6B </td><td> Cache </td><td> DTLB: 4 KByte pages, 8-way set associative, 256 entries</td></tr>\r
645 <tr><td> 0x6C </td><td> Cache </td><td> DTLB: 2M/4M pages, 8-way set associative, 128 entries</td></tr>\r
646 <tr><td> 0x6D </td><td> Cache </td><td> DTLB: 1 GByte pages, fully associative, 16 entries</td></tr>\r
647 <tr><td> 0x70 </td><td> Cache </td><td> Trace cache: 12 K-uop, 8-way set associative</td></tr>\r
648 <tr><td> 0x71 </td><td> Cache </td><td> Trace cache: 16 K-uop, 8-way set associative</td></tr>\r
649 <tr><td> 0x72 </td><td> Cache </td><td> Trace cache: 32 K-uop, 8-way set associative</td></tr>\r
650 <tr><td> 0x76 </td><td> TLB </td><td> Instruction TLB: 2M/4M pages, fully associative, 8 entries</td></tr>\r
651 <tr><td> 0x78 </td><td> Cache </td><td> 2nd-level cache: 1 MByte, 4-way set associative, 64byte line size</td></tr>\r
652 <tr><td> 0x79 </td><td> Cache </td><td> 2nd-level cache: 128 KByte, 8-way set associative, 64 byte line size,\r
653 2 lines per sector</td></tr>\r
654 <tr><td> 0x7A </td><td> Cache </td><td> 2nd-level cache: 256 KByte, 8-way set associative, 64 byte line size,\r
655 2 lines per sector</td></tr>\r
656 <tr><td> 0x7B </td><td> Cache </td><td> 2nd-level cache: 512 KByte, 8-way set associative, 64 byte line size,\r
657 2 lines per sector</td></tr>\r
658 <tr><td> 0x7C </td><td> Cache </td><td> 2nd-level cache: 1 MByte, 8-way set associative, 64 byte line size,\r
659 2 lines per sector</td></tr>\r
660 <tr><td> 0x7D </td><td> Cache </td><td> 2nd-level cache: 2 MByte, 8-way set associative, 64byte line size</td></tr>\r
661 <tr><td> 0x7F </td><td> Cache </td><td> 2nd-level cache: 512 KByte, 2-way set associative, 64-byte line size</td></tr>\r
662 <tr><td> 0x80 </td><td> Cache </td><td> 2nd-level cache: 512 KByte, 8-way set associative, 64-byte line size</td></tr>\r
663 <tr><td> 0x82 </td><td> Cache </td><td> 2nd-level cache: 256 KByte, 8-way set associative, 32 byte line size</td></tr>\r
664 <tr><td> 0x83 </td><td> Cache </td><td> 2nd-level cache: 512 KByte, 8-way set associative, 32 byte line size</td></tr>\r
665 <tr><td> 0x84 </td><td> Cache </td><td> 2nd-level cache: 1 MByte, 8-way set associative, 32 byte line size</td></tr>\r
666 <tr><td> 0x85 </td><td> Cache </td><td> 2nd-level cache: 2 MByte, 8-way set associative, 32 byte line size</td></tr>\r
667 <tr><td> 0x86 </td><td> Cache </td><td> 2nd-level cache: 512 KByte, 4-way set associative, 64 byte line size</td></tr>\r
668 <tr><td> 0x87 </td><td> Cache </td><td> 2nd-level cache: 1 MByte, 8-way set associative, 64 byte line size</td></tr>\r
669 <tr><td> 0xA0 </td><td> DTLB </td><td> DTLB: 4k pages, fully associative, 32 entries</td></tr>\r
670 <tr><td> 0xB0 </td><td> TLB </td><td> Instruction TLB: 4 KByte pages, 4-way set associative, 128 entries</td></tr>\r
671 <tr><td> 0xB1 </td><td> TLB </td><td> Instruction TLB: 2M pages, 4-way, 8 entries or 4M pages, 4-way, 4 entries</td></tr>\r
672 <tr><td> 0xB2 </td><td> TLB </td><td> Instruction TLB: 4KByte pages, 4-way set associative, 64 entries</td></tr>\r
673 <tr><td> 0xB3 </td><td> TLB </td><td> Data TLB: 4 KByte pages, 4-way set associative, 128 entries</td></tr>\r
674 <tr><td> 0xB4 </td><td> TLB </td><td> Data TLB1: 4 KByte pages, 4-way associative, 256 entries</td></tr>\r
675 <tr><td> 0xB5 </td><td> TLB </td><td> Instruction TLB: 4KByte pages, 8-way set associative, 64 entries</td></tr>\r
676 <tr><td> 0xB6 </td><td> TLB </td><td> Instruction TLB: 4KByte pages, 8-way set associative,\r
677 128 entries</td></tr>\r
678 <tr><td> 0xBA </td><td> TLB </td><td> Data TLB1: 4 KByte pages, 4-way associative, 64 entries</td></tr>\r
679 <tr><td> 0xC0 </td><td> TLB </td><td> Data TLB: 4 KByte and 4 MByte pages, 4-way associative, 8 entries</td></tr>\r
680 <tr><td> 0xC1 </td><td> STLB </td><td> Shared 2nd-Level TLB: 4 KByte/2MByte pages, 8-way associative,\r
681 1024 entries</td></tr>\r
682 <tr><td> 0xC2 </td><td> DTLB </td><td> DTLB: 4 KByte/2 MByte pages, 4-way associative, 16 entries</td></tr>\r
683 <tr><td> 0xC3 </td><td> STLB </td><td> Shared 2nd-Level TLB: 4 KByte /2 MByte pages, 6-way associative,\r
684 1536 entries. Also 1GBbyte pages, 4-way, 16 entries.</td></tr>\r
14806d7b 685 <tr><td> 0xC4 </td><td> DTLB </td><td> DTLB: 2M/4M Byte pages, 4-way associative, 32 entries</td></tr>\r
57d16ba1
MK
686 <tr><td> 0xCA </td><td> STLB </td><td> Shared 2nd-Level TLB: 4 KByte pages, 4-way associative, 512 entries</td></tr>\r
687 <tr><td> 0xD0 </td><td> Cache </td><td> 3rd-level cache: 512 KByte, 4-way set associative, 64 byte line size</td></tr>\r
688 <tr><td> 0xD1 </td><td> Cache </td><td> 3rd-level cache: 1 MByte, 4-way set associative, 64 byte line size</td></tr>\r
689 <tr><td> 0xD2 </td><td> Cache </td><td> 3rd-level cache: 2 MByte, 4-way set associative, 64 byte line size</td></tr>\r
690 <tr><td> 0xD6 </td><td> Cache </td><td> 3rd-level cache: 1 MByte, 8-way set associative, 64 byte line size</td></tr>\r
691 <tr><td> 0xD7 </td><td> Cache </td><td> 3rd-level cache: 2 MByte, 8-way set associative, 64 byte line size</td></tr>\r
692 <tr><td> 0xD8 </td><td> Cache </td><td> 3rd-level cache: 4 MByte, 8-way set associative, 64 byte line size</td></tr>\r
693 <tr><td> 0xDC </td><td> Cache </td><td> 3rd-level cache: 1.5 MByte, 12-way set associative, 64 byte line size</td></tr>\r
694 <tr><td> 0xDD </td><td> Cache </td><td> 3rd-level cache: 3 MByte, 12-way set associative, 64 byte line size</td></tr>\r
695 <tr><td> 0xDE </td><td> Cache </td><td> 3rd-level cache: 6 MByte, 12-way set associative, 64 byte line size</td></tr>\r
696 <tr><td> 0xE2 </td><td> Cache </td><td> 3rd-level cache: 2 MByte, 16-way set associative, 64 byte line size</td></tr>\r
697 <tr><td> 0xE3 </td><td> Cache </td><td> 3rd-level cache: 4 MByte, 16-way set associative, 64 byte line size</td></tr>\r
698 <tr><td> 0xE4 </td><td> Cache </td><td> 3rd-level cache: 8 MByte, 16-way set associative, 64 byte line size</td></tr>\r
699 <tr><td> 0xEA </td><td> Cache </td><td> 3rd-level cache: 12MByte, 24-way set associative, 64 byte line size</td></tr>\r
700 <tr><td> 0xEB </td><td> Cache </td><td> 3rd-level cache: 18MByte, 24-way set associative, 64 byte line size</td></tr>\r
701 <tr><td> 0xEC </td><td> Cache </td><td> 3rd-level cache: 24MByte, 24-way set associative, 64 byte line size</td></tr>\r
702 <tr><td> 0xF0 </td><td> Prefetch</td><td> 64-Byte prefetching</td></tr>\r
703 <tr><td> 0xF1 </td><td> Prefetch</td><td> 128-Byte prefetching</td></tr>\r
ee27f6ee
ED
704 <tr><td> 0xFE </td><td> General </td><td> CPUID leaf 2 does not report TLB descriptor information; use CPUID\r
705 leaf 18H to query TLB and other address translation parameters.</td></tr>\r
57d16ba1
MK
706 <tr><td> 0xFF </td><td> General </td><td> CPUID leaf 2 does not report cache descriptor information,\r
707 use CPUID leaf 4 to query cache parameters</td></tr>\r
708 </table>\r
709**/\r
710#define CPUID_CACHE_INFO 0x02\r
711\r
712/**\r
713 CPUID Cache and TLB Information returned in EAX, EBX, ECX, and EDX for CPUID\r
714 leaf #CPUID_CACHE_INFO.\r
715**/\r
716typedef union {\r
717 ///\r
718 /// Individual bit fields\r
719 ///\r
720 struct {\r
721 UINT32 Reserved:31;\r
722 ///\r
723 /// [Bit 31] If 0, then the cache descriptor bytes in the register are valid.\r
724 /// if 1, then none of the cache descriptor bytes in the register are valid.\r
725 ///\r
726 UINT32 NotValid:1;\r
727 } Bits;\r
728 ///\r
729 /// Array of Cache and TLB descriptor bytes\r
730 ///\r
731 UINT8 CacheDescriptor[4];\r
732 ///\r
733 /// All bit fields as a 32-bit value\r
734 ///\r
735 UINT32 Uint32;\r
736} CPUID_CACHE_INFO_CACHE_TLB;\r
737\r
738\r
739/**\r
740 CPUID Processor Serial Number\r
741\r
742 Processor serial number (PSN) is not supported in the Pentium 4 processor\r
743 or later. On all models, use the PSN flag (returned using CPUID) to check\r
744 for PSN support before accessing the feature.\r
745\r
746 @param EAX CPUID_SERIAL_NUMBER (0x03)\r
747\r
748 @retval EAX Reserved.\r
749 @retval EBX Reserved.\r
750 @retval ECX Bits 31:0 of 96 bit processor serial number. (Available in\r
751 Pentium III processor only; otherwise, the value in this\r
752 register is reserved.)\r
753 @retval EDX Bits 63:32 of 96 bit processor serial number. (Available in\r
754 Pentium III processor only; otherwise, the value in this\r
755 register is reserved.)\r
756\r
757 <b>Example usage</b>\r
758 @code\r
759 UINT32 Ecx;\r
760 UINT32 Edx;\r
761\r
762 AsmCpuid (CPUID_SERIAL_NUMBER, NULL, NULL, &Ecx, &Edx);\r
763 @endcode\r
764**/\r
765#define CPUID_SERIAL_NUMBER 0x03\r
766\r
767\r
768/**\r
769 CPUID Cache Parameters\r
770\r
771 @param EAX CPUID_CACHE_PARAMS (0x04)\r
772 @param ECX Cache Level. Valid values start at 0. Software can enumerate\r
773 the deterministic cache parameters for each level of the cache\r
774 hierarchy starting with an index value of 0, until the\r
775 parameters report the value associated with the CacheType\r
776 field in CPUID_CACHE_PARAMS_EAX is 0.\r
777\r
778 @retval EAX Returns cache type information described by the type\r
779 CPUID_CACHE_PARAMS_EAX.\r
780 @retval EBX Returns cache line and associativity information described by\r
781 the type CPUID_CACHE_PARAMS_EBX.\r
782 @retval ECX Returns the number of sets in the cache.\r
783 @retval EDX Returns cache WINVD/INVD behavior described by the type\r
784 CPUID_CACHE_PARAMS_EDX.\r
785\r
786 <b>Example usage</b>\r
787 @code\r
788 UINT32 CacheLevel;\r
789 CPUID_CACHE_PARAMS_EAX Eax;\r
790 CPUID_CACHE_PARAMS_EBX Ebx;\r
791 UINT32 Ecx;\r
792 CPUID_CACHE_PARAMS_EDX Edx;\r
793\r
794 CacheLevel = 0;\r
795 do {\r
796 AsmCpuidEx (\r
797 CPUID_CACHE_PARAMS, CacheLevel,\r
798 &Eax.Uint32, &Ebx.Uint32, &Ecx, &Edx.Uint32\r
799 );\r
800 CacheLevel++;\r
801 } while (Eax.Bits.CacheType != CPUID_CACHE_PARAMS_CACHE_TYPE_NULL);\r
802 @endcode\r
803**/\r
804#define CPUID_CACHE_PARAMS 0x04\r
805\r
806/**\r
807 CPUID Cache Parameters Information returned in EAX for CPUID leaf\r
808 #CPUID_CACHE_PARAMS.\r
809**/\r
810typedef union {\r
811 ///\r
812 /// Individual bit fields\r
813 ///\r
814 struct {\r
815 ///\r
816 /// [Bits 4:0] Cache type field. If #CPUID_CACHE_PARAMS_CACHE_TYPE_NULL,\r
817 /// then there is no information for the requested cache level.\r
818 ///\r
819 UINT32 CacheType:5;\r
820 ///\r
821 /// [Bits 7:5] Cache level (Starts at 1).\r
822 ///\r
823 UINT32 CacheLevel:3;\r
824 ///\r
825 /// [Bit 8] Self Initializing cache level (does not need SW initialization).\r
826 ///\r
827 UINT32 SelfInitializingCache:1;\r
828 ///\r
829 /// [Bit 9] Fully Associative cache.\r
830 ///\r
831 UINT32 FullyAssociativeCache:1;\r
832 ///\r
833 /// [Bits 13:10] Reserved.\r
834 ///\r
835 UINT32 Reserved:4;\r
836 ///\r
837 /// [Bits 25:14] Maximum number of addressable IDs for logical processors\r
838 /// sharing this cache.\r
839 ///\r
840 /// Add one to the return value to get the result.\r
841 /// The nearest power-of-2 integer that is not smaller than (1 + EAX[25:14])\r
842 /// is the number of unique initial APIC IDs reserved for addressing\r
843 /// different logical processors sharing this cache.\r
844 ///\r
845 UINT32 MaximumAddressableIdsForLogicalProcessors:12;\r
846 ///\r
847 /// [Bits 31:26] Maximum number of addressable IDs for processor cores in\r
848 /// the physical package.\r
849 ///\r
850 /// The nearest power-of-2 integer that is not smaller than (1 + EAX[31:26])\r
851 /// is the number of unique Core_IDs reserved for addressing different\r
852 /// processor cores in a physical package. Core ID is a subset of bits of\r
853 /// the initial APIC ID.\r
854 /// The returned value is constant for valid initial values in ECX. Valid\r
855 /// ECX values start from 0.\r
856 ///\r
857 UINT32 MaximumAddressableIdsForProcessorCores:6;\r
858 } Bits;\r
859 ///\r
860 /// All bit fields as a 32-bit value\r
861 ///\r
862 UINT32 Uint32;\r
863} CPUID_CACHE_PARAMS_EAX;\r
864\r
865///\r
866/// @{ Define value for bit field CPUID_CACHE_PARAMS_EAX.CacheType\r
867///\r
868#define CPUID_CACHE_PARAMS_CACHE_TYPE_NULL 0x00\r
869#define CPUID_CACHE_PARAMS_CACHE_TYPE_DATA 0x01\r
870#define CPUID_CACHE_PARAMS_CACHE_TYPE_INSTRUCTION 0x02\r
871#define CPUID_CACHE_PARAMS_CACHE_TYPE_UNIFIED 0x03\r
872///\r
873/// @}\r
874///\r
875\r
876/**\r
877 CPUID Cache Parameters Information returned in EBX for CPUID leaf\r
878 #CPUID_CACHE_PARAMS.\r
879**/\r
880typedef union {\r
881 ///\r
882 /// Individual bit fields\r
883 ///\r
884 struct {\r
885 ///\r
886 /// [Bits 11:0] System Coherency Line Size. Add one to the return value to\r
887 /// get the result.\r
888 ///\r
889 UINT32 LineSize:12;\r
890 ///\r
891 /// [Bits 21:12] Physical Line Partitions. Add one to the return value to\r
892 /// get the result.\r
893 ///\r
894 UINT32 LinePartitions:10;\r
895 ///\r
896 /// [Bits 31:22] Ways of associativity. Add one to the return value to get\r
897 /// the result.\r
898 ///\r
899 UINT32 Ways:10;\r
900 } Bits;\r
901 ///\r
902 /// All bit fields as a 32-bit value\r
903 ///\r
904 UINT32 Uint32;\r
905} CPUID_CACHE_PARAMS_EBX;\r
906\r
907/**\r
908 CPUID Cache Parameters Information returned in EDX for CPUID leaf\r
909 #CPUID_CACHE_PARAMS.\r
910**/\r
911typedef union {\r
912 ///\r
913 /// Individual bit fields\r
914 ///\r
915 struct {\r
916 ///\r
917 /// [Bit 0] Write-Back Invalidate/Invalidate.\r
918 /// 0 = WBINVD/INVD from threads sharing this cache acts upon lower level\r
919 /// caches for threads sharing this cache.\r
920 /// 1 = WBINVD/INVD is not guaranteed to act upon lower level caches of\r
921 /// non-originating threads sharing this cache.\r
922 ///\r
923 UINT32 Invalidate:1;\r
924 ///\r
925 /// [Bit 1] Cache Inclusiveness.\r
926 /// 0 = Cache is not inclusive of lower cache levels.\r
927 /// 1 = Cache is inclusive of lower cache levels.\r
928 ///\r
929 UINT32 CacheInclusiveness:1;\r
930 ///\r
931 /// [Bit 2] Complex Cache Indexing.\r
932 /// 0 = Direct mapped cache.\r
933 /// 1 = A complex function is used to index the cache, potentially using all\r
934 /// address bits.\r
935 ///\r
936 UINT32 ComplexCacheIndexing:1;\r
937 UINT32 Reserved:29;\r
938 } Bits;\r
939 ///\r
940 /// All bit fields as a 32-bit value\r
941 ///\r
942 UINT32 Uint32;\r
943} CPUID_CACHE_PARAMS_EDX;\r
944\r
945\r
946/**\r
947 CPUID MONITOR/MWAIT Information\r
948\r
949 @param EAX CPUID_MONITOR_MWAIT (0x05)\r
950\r
951 @retval EAX Smallest monitor-line size in bytes described by the type\r
952 CPUID_MONITOR_MWAIT_EAX.\r
953 @retval EBX Largest monitor-line size in bytes described by the type\r
954 CPUID_MONITOR_MWAIT_EBX.\r
955 @retval ECX Enumeration of Monitor-Mwait extensions support described by\r
956 the type CPUID_MONITOR_MWAIT_ECX.\r
957 @retval EDX Sub C-states supported described by the type\r
958 CPUID_MONITOR_MWAIT_EDX.\r
959\r
960 <b>Example usage</b>\r
961 @code\r
962 CPUID_MONITOR_MWAIT_EAX Eax;\r
963 CPUID_MONITOR_MWAIT_EBX Ebx;\r
964 CPUID_MONITOR_MWAIT_ECX Ecx;\r
965 CPUID_MONITOR_MWAIT_EDX Edx;\r
966\r
967 AsmCpuid (CPUID_MONITOR_MWAIT, &Eax.Uint32, &Ebx.Uint32, &Ecx.Uint32, &Edx.Uint32);\r
968 @endcode\r
969**/\r
970#define CPUID_MONITOR_MWAIT 0x05\r
971\r
972/**\r
973 CPUID MONITOR/MWAIT Information returned in EAX for CPUID leaf\r
974 #CPUID_MONITOR_MWAIT.\r
975**/\r
976typedef union {\r
977 ///\r
978 /// Individual bit fields\r
979 ///\r
980 struct {\r
981 ///\r
982 /// [Bits 15:0] Smallest monitor-line size in bytes (default is processor's\r
983 /// monitor granularity).\r
984 ///\r
985 UINT32 SmallestMonitorLineSize:16;\r
986 UINT32 Reserved:16;\r
987 } Bits;\r
988 ///\r
989 /// All bit fields as a 32-bit value\r
990 ///\r
991 UINT32 Uint32;\r
992} CPUID_MONITOR_MWAIT_EAX;\r
993\r
994/**\r
995 CPUID MONITOR/MWAIT Information returned in EBX for CPUID leaf\r
996 #CPUID_MONITOR_MWAIT.\r
997**/\r
998typedef union {\r
999 ///\r
1000 /// Individual bit fields\r
1001 ///\r
1002 struct {\r
1003 ///\r
1004 /// [Bits 15:0] Largest monitor-line size in bytes (default is processor's\r
1005 /// monitor granularity).\r
1006 ///\r
1007 UINT32 LargestMonitorLineSize:16;\r
1008 UINT32 Reserved:16;\r
1009 } Bits;\r
1010 ///\r
1011 /// All bit fields as a 32-bit value\r
1012 ///\r
1013 UINT32 Uint32;\r
1014} CPUID_MONITOR_MWAIT_EBX;\r
1015\r
1016/**\r
1017 CPUID MONITOR/MWAIT Information returned in ECX for CPUID leaf\r
1018 #CPUID_MONITOR_MWAIT.\r
1019**/\r
1020typedef union {\r
1021 ///\r
1022 /// Individual bit fields\r
1023 ///\r
1024 struct {\r
1025 ///\r
1026 /// [Bit 0] If 0, then only EAX and EBX are valid. If 1, then EAX, EBX, ECX,\r
1027 /// and EDX are valid.\r
1028 ///\r
1029 UINT32 ExtensionsSupported:1;\r
1030 ///\r
1031 /// [Bit 1] Supports treating interrupts as break-event for MWAIT, even when\r
1032 /// interrupts disabled.\r
1033 ///\r
1034 UINT32 InterruptAsBreak:1;\r
1035 UINT32 Reserved:30;\r
1036 } Bits;\r
1037 ///\r
1038 /// All bit fields as a 32-bit value\r
1039 ///\r
1040 UINT32 Uint32;\r
1041} CPUID_MONITOR_MWAIT_ECX;\r
1042\r
1043/**\r
1044 CPUID MONITOR/MWAIT Information returned in EDX for CPUID leaf\r
1045 #CPUID_MONITOR_MWAIT.\r
1046\r
1047 @note\r
1048 The definition of C0 through C7 states for MWAIT extension are\r
1049 processor-specific C-states, not ACPI C-states.\r
1050**/\r
1051typedef union {\r
1052 ///\r
1053 /// Individual bit fields\r
1054 ///\r
1055 struct {\r
1056 ///\r
1057 /// [Bits 3:0] Number of C0 sub C-states supported using MWAIT.\r
1058 ///\r
1059 UINT32 C0States:4;\r
1060 ///\r
1061 /// [Bits 7:4] Number of C1 sub C-states supported using MWAIT.\r
1062 ///\r
1063 UINT32 C1States:4;\r
1064 ///\r
1065 /// [Bits 11:8] Number of C2 sub C-states supported using MWAIT.\r
1066 ///\r
1067 UINT32 C2States:4;\r
1068 ///\r
1069 /// [Bits 15:12] Number of C3 sub C-states supported using MWAIT.\r
1070 ///\r
1071 UINT32 C3States:4;\r
1072 ///\r
1073 /// [Bits 19:16] Number of C4 sub C-states supported using MWAIT.\r
1074 ///\r
1075 UINT32 C4States:4;\r
1076 ///\r
1077 /// [Bits 23:20] Number of C5 sub C-states supported using MWAIT.\r
1078 ///\r
1079 UINT32 C5States:4;\r
1080 ///\r
1081 /// [Bits 27:24] Number of C6 sub C-states supported using MWAIT.\r
1082 ///\r
1083 UINT32 C6States:4;\r
1084 ///\r
1085 /// [Bits 31:28] Number of C7 sub C-states supported using MWAIT.\r
1086 ///\r
1087 UINT32 C7States:4;\r
1088 } Bits;\r
1089 ///\r
1090 /// All bit fields as a 32-bit value\r
1091 ///\r
1092 UINT32 Uint32;\r
1093} CPUID_MONITOR_MWAIT_EDX;\r
1094\r
1095\r
1096/**\r
1097 CPUID Thermal and Power Management\r
1098\r
1099 @param EAX CPUID_THERMAL_POWER_MANAGEMENT (0x06)\r
1100\r
1101 @retval EAX Thermal and power management features described by the type\r
1102 CPUID_THERMAL_POWER_MANAGEMENT_EAX.\r
1103 @retval EBX Number of Interrupt Thresholds in Digital Thermal Sensor\r
1104 described by the type CPUID_THERMAL_POWER_MANAGEMENT_EBX.\r
1105 @retval ECX Performance features described by the type\r
1106 CPUID_THERMAL_POWER_MANAGEMENT_ECX.\r
1107 @retval EDX Reserved.\r
1108\r
1109 <b>Example usage</b>\r
1110 @code\r
1111 CPUID_THERMAL_POWER_MANAGEMENT_EAX Eax;\r
1112 CPUID_THERMAL_POWER_MANAGEMENT_EBX Ebx;\r
1113 CPUID_THERMAL_POWER_MANAGEMENT_ECX Ecx;\r
1114\r
1115 AsmCpuid (CPUID_THERMAL_POWER_MANAGEMENT, &Eax.Uint32, &Ebx.Uint32, &Ecx.Uint32, NULL);\r
1116 @endcode\r
1117**/\r
1118#define CPUID_THERMAL_POWER_MANAGEMENT 0x06\r
1119\r
1120/**\r
1121 CPUID Thermal and Power Management Information returned in EAX for CPUID leaf\r
1122 #CPUID_THERMAL_POWER_MANAGEMENT.\r
1123**/\r
1124typedef union {\r
1125 ///\r
1126 /// Individual bit fields\r
1127 ///\r
1128 struct {\r
1129 ///\r
1130 /// [Bit 0] Digital temperature sensor is supported if set.\r
1131 ///\r
1132 UINT32 DigitalTemperatureSensor:1;\r
1133 ///\r
1134 /// [Bit 1] Intel Turbo Boost Technology Available (see IA32_MISC_ENABLE[38]).\r
1135 ///\r
1136 UINT32 TurboBoostTechnology:1;\r
1137 ///\r
1138 /// [Bit 2] APIC-Timer-always-running feature is supported if set.\r
1139 ///\r
1140 UINT32 ARAT:1;\r
1141 UINT32 Reserved1:1;\r
1142 ///\r
1143 /// [Bit 4] Power limit notification controls are supported if set.\r
1144 ///\r
1145 UINT32 PLN:1;\r
1146 ///\r
1147 /// [Bit 5] Clock modulation duty cycle extension is supported if set.\r
1148 ///\r
1149 UINT32 ECMD:1;\r
1150 ///\r
1151 /// [Bit 6] Package thermal management is supported if set.\r
1152 ///\r
1153 UINT32 PTM:1;\r
1154 ///\r
1155 /// [Bit 7] HWP base registers (IA32_PM_ENABLE[Bit 0], IA32_HWP_CAPABILITIES,\r
1156 /// IA32_HWP_REQUEST, IA32_HWP_STATUS) are supported if set.\r
1157 ///\r
1158 UINT32 HWP:1;\r
1159 ///\r
1160 /// [Bit 8] IA32_HWP_INTERRUPT MSR is supported if set.\r
1161 ///\r
1162 UINT32 HWP_Notification:1;\r
1163 ///\r
1164 /// [Bit 9] IA32_HWP_REQUEST[Bits 41:32] is supported if set.\r
1165 ///\r
1166 UINT32 HWP_Activity_Window:1;\r
1167 ///\r
1168 /// [Bit 10] IA32_HWP_REQUEST[Bits 31:24] is supported if set.\r
1169 ///\r
1170 UINT32 HWP_Energy_Performance_Preference:1;\r
1171 ///\r
1172 /// [Bit 11] IA32_HWP_REQUEST_PKG MSR is supported if set.\r
1173 ///\r
1174 UINT32 HWP_Package_Level_Request:1;\r
1175 UINT32 Reserved2:1;\r
1176 ///\r
1177 /// [Bit 13] HDC base registers IA32_PKG_HDC_CTL, IA32_PM_CTL1,\r
1178 /// IA32_THREAD_STALL MSRs are supported if set.\r
1179 ///\r
1180 UINT32 HDC:1;\r
ee27f6ee
ED
1181 ///\r
1182 /// [Bit 14] Intel Turbo Boost Max Technology 3.0 available.\r
1183 ///\r
1184 UINT32 TurboBoostMaxTechnology30:1;\r
1185 ///\r
1186 /// [Bit 15] HWP Capabilities.\r
1187 /// Highest Performance change is supported if set.\r
1188 ///\r
1189 UINT32 HWPCapabilities:1;\r
1190 ///\r
1191 /// [Bit 16] HWP PECI override is supported if set.\r
1192 ///\r
1193 UINT32 HWPPECIOverride:1;\r
1194 ///\r
1195 /// [Bit 17] Flexible HWP is supported if set.\r
1196 ///\r
1197 UINT32 FlexibleHWP:1;\r
1198 ///\r
1199 /// [Bit 18] Fast access mode for the IA32_HWP_REQUEST MSR is supported if set.\r
1200 ///\r
1201 UINT32 FastAccessMode:1;\r
1202 UINT32 Reserved4:1;\r
1203 ///\r
1204 /// [Bit 20] Ignoring Idle Logical Processor HWP request is supported if set.\r
1205 ///\r
1206 UINT32 IgnoringIdleLogicalProcessorHWPRequest:1;\r
1207 UINT32 Reserved5:11;\r
57d16ba1
MK
1208 } Bits;\r
1209 ///\r
1210 /// All bit fields as a 32-bit value\r
1211 ///\r
1212 UINT32 Uint32;\r
1213} CPUID_THERMAL_POWER_MANAGEMENT_EAX;\r
1214\r
1215/**\r
1216 CPUID Thermal and Power Management Information returned in EBX for CPUID leaf\r
1217 #CPUID_THERMAL_POWER_MANAGEMENT.\r
1218**/\r
1219typedef union {\r
1220 ///\r
1221 /// Individual bit fields\r
1222 ///\r
1223 struct {\r
1224 ///\r
1225 /// {Bits 3:0] Number of Interrupt Thresholds in Digital Thermal Sensor.\r
1226 ///\r
1227 UINT32 InterruptThresholds:4;\r
1228 UINT32 Reserved:28;\r
1229 } Bits;\r
1230 ///\r
1231 /// All bit fields as a 32-bit value\r
1232 ///\r
1233 UINT32 Uint32;\r
1234} CPUID_THERMAL_POWER_MANAGEMENT_EBX;\r
1235\r
1236/**\r
1237 CPUID Thermal and Power Management Information returned in ECX for CPUID leaf\r
1238 #CPUID_THERMAL_POWER_MANAGEMENT.\r
1239**/\r
1240typedef union {\r
1241 ///\r
1242 /// Individual bit fields\r
1243 ///\r
1244 struct {\r
1245 ///\r
1246 /// [Bit 0] Hardware Coordination Feedback Capability (Presence of IA32_MPERF\r
1247 /// and IA32_APERF). The capability to provide a measure of delivered\r
1248 /// processor performance (since last reset of the counters), as a percentage\r
1249 /// of the expected processor performance when running at the TSC frequency.\r
1250 ///\r
1251 UINT32 HardwareCoordinationFeedback:1;\r
1252 UINT32 Reserved1:2;\r
1253 ///\r
1254 /// [Bit 3] If this bit is set, then the processor supports performance-energy\r
1255 /// bias preference and the architectural MSR called IA32_ENERGY_PERF_BIAS\r
1256 /// (1B0H).\r
1257 ///\r
1258 UINT32 PerformanceEnergyBias:1;\r
1259 UINT32 Reserved2:28;\r
1260 } Bits;\r
1261 ///\r
1262 /// All bit fields as a 32-bit value\r
1263 ///\r
1264 UINT32 Uint32;\r
1265} CPUID_THERMAL_POWER_MANAGEMENT_ECX;\r
1266\r
1267\r
1268/**\r
1269 CPUID Structured Extended Feature Flags Enumeration\r
1270\r
1271 @param EAX CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS (0x07)\r
1272 @param ECX CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS_SUB_LEAF_INFO (0x00).\r
1273\r
1274 @note\r
1275 If ECX contains an invalid sub-leaf index, EAX/EBX/ECX/EDX return 0. Sub-leaf\r
1276 index n is invalid if n exceeds the value that sub-leaf 0 returns in EAX.\r
1277\r
1278 @retval EAX The maximum input value for ECX to retrieve sub-leaf information.\r
1279 @retval EBX Structured Extended Feature Flags described by the type\r
1280 CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS_EBX.\r
1281 @retval EBX Structured Extended Feature Flags described by the type\r
1282 CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS_ECX.\r
1283 @retval EDX Reserved.\r
1284\r
1285 <b>Example usage</b>\r
1286 @code\r
1287 UINT32 Eax;\r
1288 CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS_EBX Ebx;\r
1289 CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS_ECX Ecx;\r
1290 UINT32 SubLeaf;\r
1291\r
1292 AsmCpuidEx (\r
1293 CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS,\r
1294 CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS_SUB_LEAF_INFO,\r
1295 &Eax, NULL, NULL, NULL\r
1296 );\r
1297 for (SubLeaf = 0; SubLeaf <= Eax; SubLeaf++) {\r
1298 AsmCpuidEx (\r
1299 CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS,\r
1300 SubLeaf,\r
1301 NULL, &Ebx.Uint32, &Ecx.Uint32, NULL\r
1302 );\r
d93a10c0 1303 }\r
57d16ba1
MK
1304 @endcode\r
1305**/\r
1306#define CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS 0x07\r
1307\r
1308///\r
1309/// CPUID Structured Extended Feature Flags Enumeration sub-leaf\r
1310///\r
1311#define CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS_SUB_LEAF_INFO 0x00\r
1312\r
1313/**\r
1314 CPUID Structured Extended Feature Flags Enumeration in EBX for CPUID leaf\r
1315 #CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS sub leaf\r
1316 #CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS_SUB_LEAF_INFO.\r
1317**/\r
1318typedef union {\r
1319 ///\r
1320 /// Individual bit fields\r
1321 ///\r
1322 struct {\r
1323 ///\r
1324 /// [Bit 0] Supports RDFSBASE/RDGSBASE/WRFSBASE/WRGSBASE if 1.\r
1325 ///\r
1326 UINT32 FSGSBASE:1;\r
1327 ///\r
1328 /// [Bit 1] IA32_TSC_ADJUST MSR is supported if 1.\r
1329 ///\r
1330 UINT32 IA32_TSC_ADJUST:1;\r
c606a9a5
JF
1331 ///\r
1332 /// [Bit 2] Intel SGX is supported if 1. See section 37.7 "DISCOVERING SUPPORT\r
1333 /// FOR INTEL(R) SGX AND ENABLING ENCLAVE INSTRUCTIONS".\r
1334 ///\r
1335 UINT32 SGX:1;\r
57d16ba1
MK
1336 ///\r
1337 /// [Bit 3] If 1 indicates the processor supports the first group of advanced\r
1338 /// bit manipulation extensions (ANDN, BEXTR, BLSI, BLSMSK, BLSR, TZCNT)\r
1339 ///\r
1340 UINT32 BMI1:1;\r
1341 ///\r
1342 /// [Bit 4] Hardware Lock Elision\r
1343 ///\r
1344 UINT32 HLE:1;\r
1345 ///\r
1346 /// [Bit 5] If 1 indicates the processor supports AVX2 instruction extensions.\r
1347 ///\r
1348 UINT32 AVX2:1;\r
1349 ///\r
1350 /// [Bit 6] x87 FPU Data Pointer updated only on x87 exceptions if 1.\r
1351 ///\r
1352 UINT32 FDP_EXCPTN_ONLY:1;\r
1353 ///\r
1354 /// [Bit 7] Supports Supervisor-Mode Execution Prevention if 1.\r
1355 ///\r
1356 UINT32 SMEP:1;\r
1357 ///\r
1358 /// [Bit 8] If 1 indicates the processor supports the second group of\r
1359 /// advanced bit manipulation extensions (BZHI, MULX, PDEP, PEXT, RORX,\r
1360 /// SARX, SHLX, SHRX)\r
1361 ///\r
1362 UINT32 BMI2:1;\r
1363 ///\r
1364 /// [Bit 9] Supports Enhanced REP MOVSB/STOSB if 1.\r
1365 ///\r
1366 UINT32 EnhancedRepMovsbStosb:1;\r
1367 ///\r
1368 /// [Bit 10] If 1, supports INVPCID instruction for system software that\r
1369 /// manages process-context identifiers.\r
1370 ///\r
1371 UINT32 INVPCID:1;\r
1372 ///\r
1373 /// [Bit 11] Restricted Transactional Memory\r
1374 ///\r
1375 UINT32 RTM:1;\r
1376 ///\r
14806d7b
HW
1377 /// [Bit 12] Supports Intel(R) Resource Director Technology (Intel(R) RDT)\r
1378 /// Monitoring capability if 1.\r
57d16ba1 1379 ///\r
14806d7b 1380 UINT32 RDT_M:1;\r
57d16ba1
MK
1381 ///\r
1382 /// [Bit 13] Deprecates FPU CS and FPU DS values if 1.\r
1383 ///\r
1384 UINT32 DeprecateFpuCsDs:1;\r
1385 ///\r
1386 /// [Bit 14] Supports Intel(R) Memory Protection Extensions if 1.\r
1387 ///\r
1388 UINT32 MPX:1;\r
1389 ///\r
14806d7b
HW
1390 /// [Bit 15] Supports Intel(R) Resource Director Technology (Intel(R) RDT)\r
1391 /// Allocation capability if 1.\r
57d16ba1 1392 ///\r
14806d7b 1393 UINT32 RDT_A:1;\r
ee27f6ee
ED
1394 ///\r
1395 /// [Bit 16] AVX512F.\r
1396 ///\r
1397 UINT32 AVX512F:1;\r
1398 ///\r
1399 /// [Bit 17] AVX512DQ.\r
1400 ///\r
1401 UINT32 AVX512DQ:1;\r
57d16ba1
MK
1402 ///\r
1403 /// [Bit 18] If 1 indicates the processor supports the RDSEED instruction.\r
1404 ///\r
1405 UINT32 RDSEED:1;\r
1406 ///\r
1407 /// [Bit 19] If 1 indicates the processor supports the ADCX and ADOX\r
1408 /// instructions.\r
1409 ///\r
1410 UINT32 ADX:1;\r
1411 ///\r
1412 /// [Bit 20] Supports Supervisor-Mode Access Prevention (and the CLAC/STAC\r
1413 /// instructions) if 1.\r
1414 ///\r
1415 UINT32 SMAP:1;\r
ee27f6ee
ED
1416 ///\r
1417 /// [Bit 21] AVX512_IFMA.\r
1418 ///\r
1419 UINT32 AVX512_IFMA:1;\r
1420 UINT32 Reserved6:1;\r
57d16ba1
MK
1421 ///\r
1422 /// [Bit 23] If 1 indicates the processor supports the CLFLUSHOPT instruction.\r
1423 ///\r
1424 UINT32 CLFLUSHOPT:1;\r
14806d7b
HW
1425 ///\r
1426 /// [Bit 24] If 1 indicates the processor supports the CLWB instruction.\r
1427 ///\r
1428 UINT32 CLWB:1;\r
57d16ba1
MK
1429 ///\r
1430 /// [Bit 25] If 1 indicates the processor supports the Intel Processor Trace\r
1431 /// extensions.\r
1432 ///\r
1433 UINT32 IntelProcessorTrace:1;\r
ee27f6ee
ED
1434 ///\r
1435 /// [Bit 26] AVX512PF. (Intel Xeon Phi only.).\r
1436 ///\r
1437 UINT32 AVX512PF:1;\r
1438 ///\r
1439 /// [Bit 27] AVX512ER. (Intel Xeon Phi only.).\r
1440 ///\r
1441 UINT32 AVX512ER:1;\r
1442 ///\r
1443 /// [Bit 28] AVX512CD.\r
1444 ///\r
1445 UINT32 AVX512CD:1;\r
14806d7b
HW
1446 ///\r
1447 /// [Bit 29] Supports Intel(R) Secure Hash Algorithm Extensions (Intel(R)\r
1448 /// SHA Extensions) if 1.\r
1449 ///\r
1450 UINT32 SHA:1;\r
ee27f6ee
ED
1451 ///\r
1452 /// [Bit 30] AVX512BW.\r
1453 ///\r
1454 UINT32 AVX512BW:1;\r
1455 ///\r
1456 /// [Bit 31] AVX512VL.\r
1457 ///\r
1458 UINT32 AVX512VL:1;\r
57d16ba1
MK
1459 } Bits;\r
1460 ///\r
1461 /// All bit fields as a 32-bit value\r
1462 ///\r
1463 UINT32 Uint32;\r
1464} CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS_EBX;\r
1465\r
1466/**\r
1467 CPUID Structured Extended Feature Flags Enumeration in ECX for CPUID leaf\r
1468 #CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS sub leaf\r
1469 #CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS_SUB_LEAF_INFO.\r
1470**/\r
1471typedef union {\r
1472 ///\r
1473 /// Individual bit fields\r
1474 ///\r
1475 struct {\r
1476 ///\r
1477 /// [Bit 0] If 1 indicates the processor supports the PREFETCHWT1 instruction.\r
ee27f6ee 1478 /// (Intel Xeon Phi only.)\r
57d16ba1
MK
1479 ///\r
1480 UINT32 PREFETCHWT1:1;\r
ee27f6ee
ED
1481 ///\r
1482 /// [Bit 1] AVX512_VBMI.\r
1483 ///\r
1484 UINT32 AVX512_VBMI:1;\r
14806d7b
HW
1485 ///\r
1486 /// [Bit 2] Supports user-mode instruction prevention if 1.\r
1487 ///\r
1488 UINT32 UMIP:1;\r
57d16ba1
MK
1489 ///\r
1490 /// [Bit 3] Supports protection keys for user-mode pages if 1.\r
1491 ///\r
1492 UINT32 PKU:1;\r
1493 ///\r
1494 /// [Bit 4] If 1, OS has set CR4.PKE to enable protection keys (and the\r
1495 /// RDPKRU/WRPKRU instructions).\r
1496 ///\r
1497 UINT32 OSPKE:1;\r
ee27f6ee
ED
1498 UINT32 Reserved5:9;\r
1499 ///\r
1500 /// [Bits 14] AVX512_VPOPCNTDQ. (Intel Xeon Phi only.).\r
1501 ///\r
1502 UINT32 AVX512_VPOPCNTDQ:1;\r
f8113e25
RN
1503 UINT32 Reserved7:1;\r
1504 ///\r
1505 /// [Bits 16] Supports 5-level paging if 1.\r
1506 ///\r
1507 UINT32 FiveLevelPage:1;\r
14806d7b
HW
1508 ///\r
1509 /// [Bits 21:17] The value of MAWAU used by the BNDLDX and BNDSTX instructions\r
1510 /// in 64-bit mode.\r
1511 ///\r
1512 UINT32 MAWAU:5;\r
1513 ///\r
ee27f6ee 1514 /// [Bit 22] RDPID and IA32_TSC_AUX are available if 1.\r
14806d7b
HW
1515 ///\r
1516 UINT32 RDPID:1;\r
1517 UINT32 Reserved3:7;\r
1518 ///\r
1519 /// [Bit 30] Supports SGX Launch Configuration if 1.\r
1520 ///\r
1521 UINT32 SGX_LC:1;\r
1522 UINT32 Reserved4:1;\r
57d16ba1
MK
1523 } Bits;\r
1524 ///\r
1525 /// All bit fields as a 32-bit value\r
1526 ///\r
1527 UINT32 Uint32;\r
1528} CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS_ECX;\r
1529\r
ee27f6ee
ED
1530/**\r
1531 CPUID Structured Extended Feature Flags Enumeration in EDX for CPUID leaf\r
1532 #CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS sub leaf\r
1533 #CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS_SUB_LEAF_INFO.\r
1534**/\r
1535typedef union {\r
1536 ///\r
1537 /// Individual bit fields\r
1538 ///\r
1539 struct {\r
1540 ///\r
1541 /// [Bit 1:0] Reserved.\r
1542 ///\r
1543 UINT32 Reserved1:2;\r
1544 ///\r
1545 /// [Bit 2] AVX512_4VNNIW. (Intel Xeon Phi only.)\r
1546 ///\r
1547 UINT32 AVX512_4VNNIW:1;\r
1548 ///\r
1549 /// [Bit 3] AVX512_4FMAPS. (Intel Xeon Phi only.)\r
1550 ///\r
1551 UINT32 AVX512_4FMAPS:1;\r
1552 ///\r
1553 /// [Bit 25:4] Reserved.\r
1554 ///\r
1555 UINT32 Reserved2:22;\r
1556 ///\r
1557 /// [Bit 26] Enumerates support for indirect branch restricted speculation\r
1558 /// (IBRS) and the indirect branch pre-dictor barrier (IBPB). Processors\r
1559 /// that set this bit support the IA32_SPEC_CTRL MSR and the IA32_PRED_CMD\r
1560 /// MSR. They allow software to set IA32_SPEC_CTRL[0] (IBRS) and\r
1561 /// IA32_PRED_CMD[0] (IBPB).\r
1562 ///\r
1563 UINT32 EnumeratesSupportForIBRSAndIBPB:1;\r
1564 ///\r
1565 /// [Bit 27] Enumerates support for single thread indirect branch\r
1566 /// predictors (STIBP). Processors that set this bit support the\r
1567 /// IA32_SPEC_CTRL MSR. They allow software to set IA32_SPEC_CTRL[1]\r
1568 /// (STIBP).\r
1569 ///\r
1570 UINT32 EnumeratesSupportForSTIBP:1;\r
1571 ///\r
1572 /// [Bit 28] Enumerates support for L1D_FLUSH. Processors that set this bit\r
1573 /// support the IA32_FLUSH_CMD MSR. They allow software to set\r
1574 /// IA32_FLUSH_CMD[0] (L1D_FLUSH).\r
1575 ///\r
1576 UINT32 EnumeratesSupportForL1D_FLUSH:1;\r
1577 ///\r
1578 /// [Bit 29] Enumerates support for the IA32_ARCH_CAPABILITIES MSR.\r
1579 ///\r
1580 UINT32 EnumeratesSupportForCapability:1;\r
1581 ///\r
1582 /// [Bit 30] Reserved.\r
1583 ///\r
1584 UINT32 Reserved3:1;\r
1585 ///\r
1586 /// [Bit 31] Enumerates support for Speculative Store Bypass Disable (SSBD).\r
1587 /// Processors that set this bit sup-port the IA32_SPEC_CTRL MSR. They allow\r
1588 /// software to set IA32_SPEC_CTRL[2] (SSBD).\r
1589 ///\r
1590 UINT32 EnumeratesSupportForSSBD:1;\r
1591 } Bits;\r
1592 ///\r
1593 /// All bit fields as a 32-bit value\r
1594 ///\r
1595 UINT32 Uint32;\r
1596} CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS_EDX;\r
57d16ba1
MK
1597\r
1598/**\r
1599 CPUID Direct Cache Access Information\r
1600\r
1601 @param EAX CPUID_DIRECT_CACHE_ACCESS_INFO (0x09)\r
1602\r
1603 @retval EAX Value of bits [31:0] of IA32_PLATFORM_DCA_CAP MSR (address 1F8H).\r
1604 @retval EBX Reserved.\r
1605 @retval ECX Reserved.\r
1606 @retval EDX Reserved.\r
1607\r
1608 <b>Example usage</b>\r
1609 @code\r
1610 UINT32 Eax;\r
1611\r
1612 AsmCpuid (CPUID_DIRECT_CACHE_ACCESS_INFO, &Eax, NULL, NULL, NULL);\r
1613 @endcode\r
1614**/\r
1615#define CPUID_DIRECT_CACHE_ACCESS_INFO 0x09\r
1616\r
1617\r
1618/**\r
1619 CPUID Architectural Performance Monitoring\r
1620\r
1621 @param EAX CPUID_ARCHITECTURAL_PERFORMANCE_MONITORING (0x0A)\r
1622\r
1623 @retval EAX Architectural Performance Monitoring information described by\r
1624 the type CPUID_ARCHITECTURAL_PERFORMANCE_MONITORING_EAX.\r
1625 @retval EBX Architectural Performance Monitoring information described by\r
1626 the type CPUID_ARCHITECTURAL_PERFORMANCE_MONITORING_EBX.\r
1627 @retval ECX Reserved.\r
1628 @retval EDX Architectural Performance Monitoring information described by\r
1629 the type CPUID_ARCHITECTURAL_PERFORMANCE_MONITORING_EDX.\r
1630\r
1631 <b>Example usage</b>\r
1632 @code\r
1633 CPUID_ARCHITECTURAL_PERFORMANCE_MONITORING_EAX Eax;\r
1634 CPUID_ARCHITECTURAL_PERFORMANCE_MONITORING_EBX Ebx;\r
1635 CPUID_ARCHITECTURAL_PERFORMANCE_MONITORING_EDX Edx;\r
1636\r
1637 AsmCpuid (CPUID_ARCHITECTURAL_PERFORMANCE_MONITORING, &Eax.Uint32, &Ebx.Uint32, NULL, &Edx.Uint32);\r
1638 @endcode\r
1639**/\r
1640#define CPUID_ARCHITECTURAL_PERFORMANCE_MONITORING 0x0A\r
1641\r
1642/**\r
1643 CPUID Architectural Performance Monitoring EAX for CPUID leaf\r
1644 #CPUID_ARCHITECTURAL_PERFORMANCE_MONITORING.\r
1645**/\r
1646typedef union {\r
1647 ///\r
1648 /// Individual bit fields\r
1649 ///\r
1650 struct {\r
1651 ///\r
1652 /// [Bit 7:0] Version ID of architectural performance monitoring.\r
1653 ///\r
1654 UINT32 ArchPerfMonVerID:8;\r
1655 ///\r
1656 /// [Bits 15:8] Number of general-purpose performance monitoring counter\r
1657 /// per logical processor.\r
1658 ///\r
1659 /// IA32_PERFEVTSELx MSRs start at address 186H and occupy a contiguous\r
1660 /// block of MSR address space. Each performance event select register is\r
1661 /// paired with a corresponding performance counter in the 0C1H address\r
1662 /// block.\r
1663 ///\r
1664 UINT32 PerformanceMonitorCounters:8;\r
1665 ///\r
1666 /// [Bits 23:16] Bit width of general-purpose, performance monitoring counter.\r
1667 ///\r
1668 /// The bit width of an IA32_PMCx MSR. This the number of valid bits for\r
1669 /// read operation. On write operations, the lower-order 32 bits of the MSR\r
1670 /// may be written with any value, and the high-order bits are sign-extended\r
1671 /// from the value of bit 31.\r
1672 ///\r
1673 UINT32 PerformanceMonitorCounterWidth:8;\r
1674 ///\r
1675 /// [Bits 31:24] Length of EBX bit vector to enumerate architectural\r
1676 /// performance monitoring events.\r
1677 ///\r
1678 UINT32 EbxBitVectorLength:8;\r
1679 } Bits;\r
1680 ///\r
1681 /// All bit fields as a 32-bit value\r
1682 ///\r
1683 UINT32 Uint32;\r
1684} CPUID_ARCHITECTURAL_PERFORMANCE_MONITORING_EAX;\r
1685\r
1686/**\r
1687 CPUID Architectural Performance Monitoring EBX for CPUID leaf\r
1688 #CPUID_ARCHITECTURAL_PERFORMANCE_MONITORING.\r
1689**/\r
1690typedef union {\r
1691 ///\r
1692 /// Individual bit fields\r
1693 ///\r
1694 struct {\r
1695 ///\r
1696 /// [Bit 0] Core cycle event not available if 1.\r
1697 ///\r
1698 UINT32 UnhaltedCoreCycles:1;\r
1699 ///\r
1700 /// [Bit 1] Instruction retired event not available if 1.\r
1701 ///\r
1702 UINT32 InstructionsRetired:1;\r
1703 ///\r
1704 /// [Bit 2] Reference cycles event not available if 1.\r
1705 ///\r
1706 UINT32 UnhaltedReferenceCycles:1;\r
1707 ///\r
1708 /// [Bit 3] Last-level cache reference event not available if 1.\r
1709 ///\r
1710 UINT32 LastLevelCacheReferences:1;\r
1711 ///\r
1712 /// [Bit 4] Last-level cache misses event not available if 1.\r
1713 ///\r
1714 UINT32 LastLevelCacheMisses:1;\r
1715 ///\r
1716 /// [Bit 5] Branch instruction retired event not available if 1.\r
1717 ///\r
1718 UINT32 BranchInstructionsRetired:1;\r
1719 ///\r
1720 /// [Bit 6] Branch mispredict retired event not available if 1.\r
1721 ///\r
1722 UINT32 AllBranchMispredictRetired:1;\r
1723 UINT32 Reserved:25;\r
1724 } Bits;\r
1725 ///\r
1726 /// All bit fields as a 32-bit value\r
1727 ///\r
1728 UINT32 Uint32;\r
1729} CPUID_ARCHITECTURAL_PERFORMANCE_MONITORING_EBX;\r
1730\r
1731/**\r
1732 CPUID Architectural Performance Monitoring EDX for CPUID leaf\r
1733 #CPUID_ARCHITECTURAL_PERFORMANCE_MONITORING.\r
1734**/\r
1735typedef union {\r
1736 ///\r
1737 /// Individual bit fields\r
1738 ///\r
1739 struct {\r
1740 ///\r
1741 /// [Bits 4:0] Number of fixed-function performance counters\r
1742 /// (if Version ID > 1).\r
1743 ///\r
1744 UINT32 FixedFunctionPerformanceCounters:5;\r
1745 ///\r
1746 /// [Bits 12:5] Bit width of fixed-function performance counters\r
1747 /// (if Version ID > 1).\r
1748 ///\r
1749 UINT32 FixedFunctionPerformanceCounterWidth:8;\r
ee27f6ee
ED
1750 UINT32 Reserved1:2;\r
1751 ///\r
1752 /// [Bits 15] AnyThread deprecation.\r
1753 ///\r
1754 UINT32 AnyThreadDeprecation:1;\r
1755 UINT32 Reserved2:16;\r
57d16ba1
MK
1756 } Bits;\r
1757 ///\r
1758 /// All bit fields as a 32-bit value\r
1759 ///\r
1760 UINT32 Uint32;\r
1761} CPUID_ARCHITECTURAL_PERFORMANCE_MONITORING_EDX;\r
1762\r
1763\r
1764/**\r
1765 CPUID Extended Topology Information\r
1766\r
1767 @note\r
ee27f6ee
ED
1768 CPUID leaf 1FH is a preferred superset to leaf 0BH. Intel recommends first\r
1769 checking for the existence of Leaf 1FH before using leaf 0BH.\r
57d16ba1
MK
1770 Most of Leaf 0BH output depends on the initial value in ECX. The EDX output\r
1771 of leaf 0BH is always valid and does not vary with input value in ECX. Output\r
ee27f6ee
ED
1772 value in ECX[7:0] always equals input value in ECX[7:0].\r
1773 Sub-leaf index 0 enumerates SMT level. Each subsequent higher sub-leaf index\r
1774 enumerates a higher-level topological entity in hierarchical order.\r
1775 For sub-leaves that return an invalid level-type of 0 in ECX[15:8]; EAX and\r
1776 EBX will return 0.\r
1777 If an input value n in ECX returns the invalid level-type of 0 in ECX[15:8],\r
57d16ba1
MK
1778 other input values with ECX > n also return 0 in ECX[15:8].\r
1779\r
1780 @param EAX CPUID_EXTENDED_TOPOLOGY (0x0B)\r
1781 @param ECX Level number\r
1782\r
1783 @retval EAX Extended topology information described by the type\r
1784 CPUID_EXTENDED_TOPOLOGY_EAX.\r
1785 @retval EBX Extended topology information described by the type\r
1786 CPUID_EXTENDED_TOPOLOGY_EBX.\r
1787 @retval ECX Extended topology information described by the type\r
1788 CPUID_EXTENDED_TOPOLOGY_ECX.\r
1789 @retval EDX x2APIC ID the current logical processor.\r
1790\r
1791 <b>Example usage</b>\r
1792 @code\r
1793 CPUID_EXTENDED_TOPOLOGY_EAX Eax;\r
1794 CPUID_EXTENDED_TOPOLOGY_EBX Ebx;\r
1795 CPUID_EXTENDED_TOPOLOGY_ECX Ecx;\r
1796 UINT32 Edx;\r
1797 UINT32 LevelNumber;\r
1798\r
1799 LevelNumber = 0;\r
1800 do {\r
1801 AsmCpuidEx (\r
1802 CPUID_EXTENDED_TOPOLOGY, LevelNumber,\r
1803 &Eax.Uint32, &Ebx.Uint32, &Ecx.Uint32, &Edx\r
1804 );\r
1805 LevelNumber++;\r
1806 } while (Eax.Bits.ApicIdShift != 0);\r
1807 @endcode\r
1808**/\r
1809#define CPUID_EXTENDED_TOPOLOGY 0x0B\r
1810\r
1811/**\r
1812 CPUID Extended Topology Information EAX for CPUID leaf #CPUID_EXTENDED_TOPOLOGY.\r
1813**/\r
1814typedef union {\r
1815 ///\r
1816 /// Individual bit fields\r
1817 ///\r
1818 struct {\r
1819 ///\r
1820 /// [Bits 4:0] Number of bits to shift right on x2APIC ID to get a unique\r
1821 /// topology ID of the next level type. All logical processors with the\r
1822 /// same next level ID share current level.\r
1823 ///\r
1824 /// @note\r
1825 /// Software should use this field (EAX[4:0]) to enumerate processor\r
1826 /// topology of the system.\r
1827 ///\r
1828 UINT32 ApicIdShift:5;\r
1829 UINT32 Reserved:27;\r
1830 } Bits;\r
1831 ///\r
1832 /// All bit fields as a 32-bit value\r
1833 ///\r
1834 UINT32 Uint32;\r
1835} CPUID_EXTENDED_TOPOLOGY_EAX;\r
1836\r
1837/**\r
1838 CPUID Extended Topology Information EBX for CPUID leaf #CPUID_EXTENDED_TOPOLOGY.\r
1839**/\r
1840typedef union {\r
1841 ///\r
1842 /// Individual bit fields\r
1843 ///\r
1844 struct {\r
1845 ///\r
1846 /// [Bits 15:0] Number of logical processors at this level type. The number\r
1847 /// reflects configuration as shipped by Intel.\r
1848 ///\r
1849 /// @note\r
1850 /// Software must not use EBX[15:0] to enumerate processor topology of the\r
1851 /// system. This value in this field (EBX[15:0]) is only intended for\r
1852 /// display/diagnostic purposes. The actual number of logical processors\r
1853 /// available to BIOS/OS/Applications may be different from the value of\r
1854 /// EBX[15:0], depending on software and platform hardware configurations.\r
1855 ///\r
1856 UINT32 LogicalProcessors:16;\r
1857 UINT32 Reserved:16;\r
1858 } Bits;\r
1859 ///\r
1860 /// All bit fields as a 32-bit value\r
1861 ///\r
1862 UINT32 Uint32;\r
1863} CPUID_EXTENDED_TOPOLOGY_EBX;\r
1864\r
1865/**\r
1866 CPUID Extended Topology Information ECX for CPUID leaf #CPUID_EXTENDED_TOPOLOGY.\r
1867**/\r
1868typedef union {\r
1869 ///\r
1870 /// Individual bit fields\r
1871 ///\r
1872 struct {\r
1873 ///\r
1874 /// [Bits 7:0] Level number. Same value in ECX input.\r
1875 ///\r
1876 UINT32 LevelNumber:8;\r
1877 ///\r
1878 /// [Bits 15:8] Level type.\r
1879 ///\r
1880 /// @note\r
1881 /// The value of the "level type" field is not related to level numbers in\r
1882 /// any way, higher "level type" values do not mean higher levels.\r
1883 ///\r
1884 UINT32 LevelType:8;\r
1885 UINT32 Reserved:16;\r
1886 } Bits;\r
1887 ///\r
1888 /// All bit fields as a 32-bit value\r
1889 ///\r
1890 UINT32 Uint32;\r
1891} CPUID_EXTENDED_TOPOLOGY_ECX;\r
1892\r
1893///\r
1894/// @{ Define value for CPUID_EXTENDED_TOPOLOGY_ECX.LevelType\r
1895///\r
1896#define CPUID_EXTENDED_TOPOLOGY_LEVEL_TYPE_INVALID 0x00\r
1897#define CPUID_EXTENDED_TOPOLOGY_LEVEL_TYPE_SMT 0x01\r
1898#define CPUID_EXTENDED_TOPOLOGY_LEVEL_TYPE_CORE 0x02\r
1899///\r
1900/// @}\r
1901///\r
1902\r
1903\r
1904/**\r
1905 CPUID Extended State Information\r
1906\r
1907 @param EAX CPUID_EXTENDED_STATE (0x0D)\r
1908 @param ECX CPUID_EXTENDED_STATE_MAIN_LEAF (0x00).\r
1909 CPUID_EXTENDED_STATE_SUB_LEAF (0x01).\r
1910 CPUID_EXTENDED_STATE_SIZE_OFFSET (0x02).\r
1911 Sub leafs 2..n based on supported bits in XCR0 or IA32_XSS_MSR.\r
1912**/\r
1913#define CPUID_EXTENDED_STATE 0x0D\r
1914\r
1915/**\r
1916 CPUID Extended State Information Main Leaf\r
1917\r
1918 @param EAX CPUID_EXTENDED_STATE (0x0D)\r
1919 @param ECX CPUID_EXTENDED_STATE_MAIN_LEAF (0x00)\r
1920\r
1921 @retval EAX Reports the supported bits of the lower 32 bits of XCR0. XCR0[n]\r
1922 can be set to 1 only if EAX[n] is 1. The format of the extended\r
1923 state main leaf is described by the type\r
1924 CPUID_EXTENDED_STATE_MAIN_LEAF_EAX.\r
1925 @retval EBX Maximum size (bytes, from the beginning of the XSAVE/XRSTOR save\r
1926 area) required by enabled features in XCR0. May be different than\r
1927 ECX if some features at the end of the XSAVE save area are not\r
1928 enabled.\r
1929 @retval ECX Maximum size (bytes, from the beginning of the XSAVE/XRSTOR save\r
1930 area) of the XSAVE/XRSTOR save area required by all supported\r
14806d7b 1931 features in the processor, i.e., all the valid bit fields in XCR0.\r
57d16ba1
MK
1932 @retval EDX Reports the supported bits of the upper 32 bits of XCR0.\r
1933 XCR0[n+32] can be set to 1 only if EDX[n] is 1.\r
1934\r
1935 <b>Example usage</b>\r
1936 @code\r
1937 CPUID_EXTENDED_STATE_MAIN_LEAF_EAX Eax;\r
1938 UINT32 Ebx;\r
1939 UINT32 Ecx;\r
1940 UINT32 Edx;\r
1941\r
1942 AsmCpuidEx (\r
1943 CPUID_EXTENDED_STATE, CPUID_EXTENDED_STATE_MAIN_LEAF,\r
1944 &Eax.Uint32, &Ebx, &Ecx, &Edx\r
1945 );\r
1946 @endcode\r
1947**/\r
1948#define CPUID_EXTENDED_STATE_MAIN_LEAF 0x00\r
1949\r
1950/**\r
1951 CPUID Extended State Information EAX for CPUID leaf #CPUID_EXTENDED_STATE,\r
1952 sub-leaf #CPUID_EXTENDED_STATE_MAIN_LEAF.\r
1953**/\r
1954typedef union {\r
1955 ///\r
1956 /// Individual bit fields\r
1957 ///\r
1958 struct {\r
1959 ///\r
1960 /// [Bit 0] x87 state.\r
1961 ///\r
1962 UINT32 x87:1;\r
1963 ///\r
1964 /// [Bit 1] SSE state.\r
1965 ///\r
1966 UINT32 SSE:1;\r
1967 ///\r
1968 /// [Bit 2] AVX state.\r
1969 ///\r
1970 UINT32 AVX:1;\r
1971 ///\r
1972 /// [Bits 4:3] MPX state.\r
1973 ///\r
1974 UINT32 MPX:2;\r
1975 ///\r
1976 /// [Bits 7:5] AVX-512 state.\r
1977 ///\r
1978 UINT32 AVX_512:3;\r
1979 ///\r
1980 /// [Bit 8] Used for IA32_XSS.\r
1981 ///\r
1982 UINT32 IA32_XSS:1;\r
1983 ///\r
1984 /// [Bit 9] PKRU state.\r
1985 ///\r
1986 UINT32 PKRU:1;\r
ee27f6ee
ED
1987 UINT32 Reserved1:3;\r
1988 ///\r
1989 /// [Bit 13] Used for IA32_XSS, part 2.\r
1990 ///\r
1991 UINT32 IA32_XSS_2:1;\r
1992 UINT32 Reserved2:18;\r
57d16ba1
MK
1993 } Bits;\r
1994 ///\r
1995 /// All bit fields as a 32-bit value\r
1996 ///\r
1997 UINT32 Uint32;\r
1998} CPUID_EXTENDED_STATE_MAIN_LEAF_EAX;\r
1999\r
2000/**\r
2001 CPUID Extended State Information Sub Leaf\r
2002\r
2003 @param EAX CPUID_EXTENDED_STATE (0x0D)\r
2004 @param ECX CPUID_EXTENDED_STATE_SUB_LEAF (0x01)\r
2005\r
2006 @retval EAX The format of the extended state sub-leaf is described by the\r
2007 type CPUID_EXTENDED_STATE_SUB_LEAF_EAX.\r
2008 @retval EBX The size in bytes of the XSAVE area containing all states\r
2009 enabled by XCRO | IA32_XSS.\r
2010 @retval ECX The format of the extended state sub-leaf is described by the\r
2011 type CPUID_EXTENDED_STATE_SUB_LEAF_ECX.\r
2012 @retval EDX Reports the supported bits of the upper 32 bits of the\r
2013 IA32_XSS MSR. IA32_XSS[n+32] can be set to 1 only if EDX[n] is 1.\r
2014\r
2015 <b>Example usage</b>\r
2016 @code\r
2017 CPUID_EXTENDED_STATE_SUB_LEAF_EAX Eax;\r
2018 UINT32 Ebx;\r
2019 CPUID_EXTENDED_STATE_SUB_LEAF_ECX Ecx;\r
2020 UINT32 Edx;\r
2021\r
2022 AsmCpuidEx (\r
2023 CPUID_EXTENDED_STATE, CPUID_EXTENDED_STATE_SUB_LEAF,\r
2024 &Eax.Uint32, &Ebx, &Ecx.Uint32, &Edx\r
2025 );\r
2026 @endcode\r
2027**/\r
2028#define CPUID_EXTENDED_STATE_SUB_LEAF 0x01\r
2029\r
2030/**\r
2031 CPUID Extended State Information EAX for CPUID leaf #CPUID_EXTENDED_STATE,\r
2032 sub-leaf #CPUID_EXTENDED_STATE_SUB_LEAF.\r
2033**/\r
2034typedef union {\r
2035 ///\r
2036 /// Individual bit fields\r
2037 ///\r
2038 struct {\r
2039 ///\r
2040 /// [Bit 0] XSAVEOPT is available.\r
2041 ///\r
2042 UINT32 XSAVEOPT:1;\r
2043 ///\r
2044 /// [Bit 1] Supports XSAVEC and the compacted form of XRSTOR if set.\r
2045 ///\r
2046 UINT32 XSAVEC:1;\r
2047 ///\r
2048 /// [Bit 2] Supports XGETBV with ECX = 1 if set.\r
2049 ///\r
2050 UINT32 XGETBV:1;\r
2051 ///\r
2052 /// [Bit 3] Supports XSAVES/XRSTORS and IA32_XSS if set.\r
2053 ///\r
2054 UINT32 XSAVES:1;\r
2055 UINT32 Reserved:28;\r
2056 } Bits;\r
2057 ///\r
2058 /// All bit fields as a 32-bit value\r
2059 ///\r
2060 UINT32 Uint32;\r
2061} CPUID_EXTENDED_STATE_SUB_LEAF_EAX;\r
2062\r
2063/**\r
2064 CPUID Extended State Information ECX for CPUID leaf #CPUID_EXTENDED_STATE,\r
2065 sub-leaf #CPUID_EXTENDED_STATE_SUB_LEAF.\r
2066**/\r
2067typedef union {\r
2068 ///\r
2069 /// Individual bit fields\r
2070 ///\r
2071 struct {\r
2072 ///\r
2073 /// [Bits 7:0] Used for XCR0.\r
2074 ///\r
2075 UINT32 XCR0:1;\r
2076 ///\r
2077 /// [Bit 8] PT STate.\r
2078 ///\r
2079 UINT32 PT:1;\r
2080 ///\r
2081 /// [Bit 9] Used for XCR0.\r
2082 ///\r
2083 UINT32 XCR0_1:1;\r
ee27f6ee
ED
2084 UINT32 Reserved1:3;\r
2085 ///\r
2086 /// [Bit 13] HWP state.\r
2087 ///\r
2088 UINT32 HWPState:1;\r
2089 UINT32 Reserved8:18;\r
57d16ba1
MK
2090 } Bits;\r
2091 ///\r
2092 /// All bit fields as a 32-bit value\r
2093 ///\r
2094 UINT32 Uint32;\r
2095} CPUID_EXTENDED_STATE_SUB_LEAF_ECX;\r
2096\r
2097/**\r
2098 CPUID Extended State Information Size and Offset Sub Leaf\r
2099\r
2100 @note\r
2101 Leaf 0DH output depends on the initial value in ECX.\r
2102 Each sub-leaf index (starting at position 2) is supported if it corresponds to\r
2103 a supported bit in either the XCR0 register or the IA32_XSS MSR.\r
2104 If ECX contains an invalid sub-leaf index, EAX/EBX/ECX/EDX return 0. Sub-leaf\r
2105 n (0 <= n <= 31) is invalid if sub-leaf 0 returns 0 in EAX[n] and sub-leaf 1\r
2106 returns 0 in ECX[n]. Sub-leaf n (32 <= n <= 63) is invalid if sub-leaf 0\r
2107 returns 0 in EDX[n-32] and sub-leaf 1 returns 0 in EDX[n-32].\r
2108\r
2109 @param EAX CPUID_EXTENDED_STATE (0x0D)\r
2110 @param ECX CPUID_EXTENDED_STATE_SIZE_OFFSET (0x02). Sub leafs 2..n based\r
2111 on supported bits in XCR0 or IA32_XSS_MSR.\r
2112\r
2113 @retval EAX The size in bytes (from the offset specified in EBX) of the save\r
2114 area for an extended state feature associated with a valid\r
2115 sub-leaf index, n.\r
2116 @retval EBX The offset in bytes of this extended state component's save area\r
2117 from the beginning of the XSAVE/XRSTOR area. This field reports\r
2118 0 if the sub-leaf index, n, does not map to a valid bit in the\r
2119 XCR0 register.\r
2120 @retval ECX The format of the extended state components's save area as\r
2121 described by the type CPUID_EXTENDED_STATE_SIZE_OFFSET_ECX.\r
2122 This field reports 0 if the sub-leaf index, n, is invalid.\r
2123 @retval EDX This field reports 0 if the sub-leaf index, n, is invalid;\r
2124 otherwise it is reserved.\r
2125\r
2126 <b>Example usage</b>\r
2127 @code\r
2128 UINT32 Eax;\r
2129 UINT32 Ebx;\r
2130 CPUID_EXTENDED_STATE_SIZE_OFFSET_ECX Ecx;\r
2131 UINT32 Edx;\r
2132 UINTN SubLeaf;\r
2133\r
2134 for (SubLeaf = CPUID_EXTENDED_STATE_SIZE_OFFSET; SubLeaf < 32; SubLeaf++) {\r
2135 AsmCpuidEx (\r
2136 CPUID_EXTENDED_STATE, SubLeaf,\r
2137 &Eax, &Ebx, &Ecx.Uint32, &Edx\r
2138 );\r
2139 }\r
2140 @endcode\r
2141**/\r
2142#define CPUID_EXTENDED_STATE_SIZE_OFFSET 0x02\r
2143\r
2144/**\r
2145 CPUID Extended State Information ECX for CPUID leaf #CPUID_EXTENDED_STATE,\r
2146 sub-leaf #CPUID_EXTENDED_STATE_SIZE_OFFSET.\r
2147**/\r
2148typedef union {\r
2149 ///\r
2150 /// Individual bit fields\r
2151 ///\r
2152 struct {\r
2153 ///\r
2154 /// [Bit 0] Is set if the bit n (corresponding to the sub-leaf index) is\r
2155 /// supported in the IA32_XSS MSR; it is clear if bit n is instead supported\r
2156 /// in XCR0.\r
2157 ///\r
2158 UINT32 XSS:1;\r
2159 ///\r
2160 /// [Bit 1] is set if, when the compacted format of an XSAVE area is used,\r
2161 /// this extended state component located on the next 64-byte boundary\r
2162 /// following the preceding state component (otherwise, it is located\r
2163 /// immediately following the preceding state component).\r
2164 ///\r
2165 UINT32 Compacted:1;\r
2166 UINT32 Reserved:30;\r
2167 } Bits;\r
2168 ///\r
2169 /// All bit fields as a 32-bit value\r
2170 ///\r
2171 UINT32 Uint32;\r
2172} CPUID_EXTENDED_STATE_SIZE_OFFSET_ECX;\r
2173\r
2174\r
2175/**\r
14806d7b 2176 CPUID Intel Resource Director Technology (Intel RDT) Monitoring Information\r
57d16ba1 2177\r
14806d7b
HW
2178 @param EAX CPUID_INTEL_RDT_MONITORING (0x0F)\r
2179 @param ECX CPUID_INTEL_RDT_MONITORING_ENUMERATION_SUB_LEAF (0x00).\r
2180 CPUID_INTEL_RDT_MONITORING_L3_CACHE_SUB_LEAF (0x01).\r
57d16ba1
MK
2181\r
2182**/\r
14806d7b 2183#define CPUID_INTEL_RDT_MONITORING 0x0F\r
57d16ba1
MK
2184\r
2185/**\r
14806d7b
HW
2186 CPUID Intel Resource Director Technology (Intel RDT) Monitoring Information\r
2187 Enumeration Sub-leaf\r
57d16ba1 2188\r
14806d7b
HW
2189 @param EAX CPUID_INTEL_RDT_MONITORING (0x0F)\r
2190 @param ECX CPUID_INTEL_RDT_MONITORING_ENUMERATION_SUB_LEAF (0x00)\r
57d16ba1
MK
2191\r
2192 @retval EAX Reserved.\r
2193 @retval EBX Maximum range (zero-based) of RMID within this physical\r
2194 processor of all types.\r
2195 @retval ECX Reserved.\r
14806d7b
HW
2196 @retval EDX L3 Cache Intel RDT Monitoring Information Enumeration described by\r
2197 the type CPUID_INTEL_RDT_MONITORING_ENUMERATION_SUB_LEAF_EDX.\r
57d16ba1
MK
2198\r
2199 <b>Example usage</b>\r
2200 @code\r
2201 UINT32 Ebx;\r
14806d7b 2202 CPUID_INTEL_RDT_MONITORING_ENUMERATION_SUB_LEAF_EDX Edx;\r
57d16ba1
MK
2203\r
2204 AsmCpuidEx (\r
14806d7b 2205 CPUID_INTEL_RDT_MONITORING, CPUID_INTEL_RDT_MONITORING_ENUMERATION_SUB_LEAF,\r
57d16ba1
MK
2206 NULL, &Ebx, NULL, &Edx.Uint32\r
2207 );\r
2208 @endcode\r
2209**/\r
14806d7b 2210#define CPUID_INTEL_RDT_MONITORING_ENUMERATION_SUB_LEAF 0x00\r
57d16ba1
MK
2211\r
2212/**\r
14806d7b
HW
2213 CPUID Intel RDT Monitoring Information EDX for CPUID leaf\r
2214 #CPUID_INTEL_RDT_MONITORING, sub-leaf\r
2215 #CPUID_INTEL_RDT_MONITORING_ENUMERATION_SUB_LEAF.\r
57d16ba1
MK
2216**/\r
2217typedef union {\r
2218 ///\r
2219 /// Individual bit fields\r
2220 ///\r
2221 struct {\r
2222 UINT32 Reserved1:1;\r
2223 ///\r
14806d7b 2224 /// [Bit 1] Supports L3 Cache Intel RDT Monitoring if 1.\r
57d16ba1 2225 ///\r
14806d7b 2226 UINT32 L3CacheRDT_M:1;\r
57d16ba1
MK
2227 UINT32 Reserved2:30;\r
2228 } Bits;\r
2229 ///\r
2230 /// All bit fields as a 32-bit value\r
2231 ///\r
2232 UINT32 Uint32;\r
14806d7b 2233} CPUID_INTEL_RDT_MONITORING_ENUMERATION_SUB_LEAF_EDX;\r
57d16ba1
MK
2234\r
2235/**\r
14806d7b 2236 CPUID L3 Cache Intel RDT Monitoring Capability Enumeration Sub-leaf\r
57d16ba1 2237\r
14806d7b
HW
2238 @param EAX CPUID_INTEL_RDT_MONITORING (0x0F)\r
2239 @param ECX CPUID_INTEL_RDT_MONITORING_L3_CACHE_SUB_LEAF (0x01)\r
57d16ba1
MK
2240\r
2241 @retval EAX Reserved.\r
2242 @retval EBX Conversion factor from reported IA32_QM_CTR value to occupancy metric (bytes).\r
2243 @retval ECX Maximum range (zero-based) of RMID of this resource type.\r
14806d7b
HW
2244 @retval EDX L3 Cache Intel RDT Monitoring Capability information described by the\r
2245 type CPUID_INTEL_RDT_MONITORING_L3_CACHE_SUB_LEAF_EDX.\r
57d16ba1
MK
2246\r
2247 <b>Example usage</b>\r
2248 @code\r
14806d7b
HW
2249 UINT32 Ebx;\r
2250 UINT32 Ecx;\r
2251 CPUID_INTEL_RDT_MONITORING_L3_CACHE_SUB_LEAF_EDX Edx;\r
57d16ba1
MK
2252\r
2253 AsmCpuidEx (\r
14806d7b 2254 CPUID_INTEL_RDT_MONITORING, CPUID_INTEL_RDT_MONITORING_L3_CACHE_SUB_LEAF,\r
57d16ba1
MK
2255 NULL, &Ebx, &Ecx, &Edx.Uint32\r
2256 );\r
2257 @endcode\r
2258**/\r
14806d7b 2259#define CPUID_INTEL_RDT_MONITORING_L3_CACHE_SUB_LEAF 0x01\r
57d16ba1
MK
2260\r
2261/**\r
14806d7b
HW
2262 CPUID L3 Cache Intel RDT Monitoring Capability Information EDX for CPUID leaf\r
2263 #CPUID_INTEL_RDT_MONITORING, sub-leaf\r
2264 #CPUID_INTEL_RDT_MONITORING_L3_CACHE_SUB_LEAF.\r
57d16ba1
MK
2265**/\r
2266typedef union {\r
2267 ///\r
2268 /// Individual bit fields\r
2269 ///\r
2270 struct {\r
2271 ///\r
2272 /// [Bit 0] Supports L3 occupancy monitoring if 1.\r
2273 ///\r
2274 UINT32 L3CacheOccupancyMonitoring:1;\r
14806d7b
HW
2275 ///\r
2276 /// [Bit 1] Supports L3 Total Bandwidth monitoring if 1.\r
2277 ///\r
2278 UINT32 L3CacheTotalBandwidthMonitoring:1;\r
2279 ///\r
2280 /// [Bit 2] Supports L3 Local Bandwidth monitoring if 1.\r
2281 ///\r
2282 UINT32 L3CacheLocalBandwidthMonitoring:1;\r
2283 UINT32 Reserved:29;\r
57d16ba1
MK
2284 } Bits;\r
2285 ///\r
2286 /// All bit fields as a 32-bit value\r
2287 ///\r
2288 UINT32 Uint32;\r
14806d7b 2289} CPUID_INTEL_RDT_MONITORING_L3_CACHE_SUB_LEAF_EDX;\r
57d16ba1
MK
2290\r
2291\r
2292/**\r
14806d7b 2293 CPUID Intel Resource Director Technology (Intel RDT) Allocation Information\r
57d16ba1 2294\r
14806d7b
HW
2295 @param EAX CPUID_INTEL_RDT_ALLOCATION (0x10).\r
2296 @param ECX CPUID_INTEL_RDT_ALLOCATION_ENUMERATION_SUB_LEAF (0x00).\r
2297 CPUID_INTEL_RDT_ALLOCATION_L3_CACHE_SUB_LEAF (0x01).\r
2298 CPUID_INTEL_RDT_ALLOCATION_L2_CACHE_SUB_LEAF (0x02).\r
57d16ba1 2299**/\r
14806d7b 2300#define CPUID_INTEL_RDT_ALLOCATION 0x10\r
57d16ba1
MK
2301\r
2302/**\r
14806d7b 2303 Intel Resource Director Technology (Intel RDT) Allocation Enumeration Sub-leaf\r
57d16ba1 2304\r
14806d7b
HW
2305 @param EAX CPUID_INTEL_RDT_ALLOCATION (0x10)\r
2306 @param ECX CPUID_INTEL_RDT_ALLOCATION_ENUMERATION_SUB_LEAF (0x00).\r
57d16ba1
MK
2307\r
2308 @retval EAX Reserved.\r
14806d7b
HW
2309 @retval EBX L3 and L2 Cache Allocation Technology information described by\r
2310 the type CPUID_INTEL_RDT_ALLOCATION_ENUMERATION_SUB_LEAF_EBX.\r
57d16ba1
MK
2311 @retval ECX Reserved.\r
2312 @retval EDX Reserved.\r
2313\r
2314 <b>Example usage</b>\r
2315 @code\r
14806d7b 2316 CPUID_INTEL_RDT_ALLOCATION_ENUMERATION_SUB_LEAF_EBX Ebx;\r
57d16ba1
MK
2317\r
2318 AsmCpuidEx (\r
14806d7b 2319 CPUID_INTEL_RDT_ALLOCATION, CPUID_INTEL_RDT_ALLOCATION_ENUMERATION_SUB_LEAF,\r
57d16ba1
MK
2320 NULL, &Ebx.Uint32, NULL, NULL\r
2321 );\r
2322 @endcode\r
2323**/\r
14806d7b 2324#define CPUID_INTEL_RDT_ALLOCATION_ENUMERATION_SUB_LEAF 0x00\r
57d16ba1
MK
2325\r
2326/**\r
14806d7b
HW
2327 CPUID L3 and L2 Cache Allocation Support Information EBX for CPUID leaf\r
2328 #CPUID_INTEL_RDT_ALLOCATION, sub-leaf\r
2329 #CPUID_INTEL_RDT_ALLOCATION_ENUMERATION_SUB_LEAF.\r
57d16ba1
MK
2330**/\r
2331typedef union {\r
2332 ///\r
2333 /// Individual bit fields\r
2334 ///\r
2335 struct {\r
2336 UINT32 Reserved1:1;\r
2337 ///\r
14806d7b 2338 /// [Bit 1] Supports L3 Cache Allocation Technology if 1.\r
57d16ba1 2339 ///\r
14806d7b
HW
2340 UINT32 L3CacheAllocation:1;\r
2341 ///\r
2342 /// [Bit 2] Supports L2 Cache Allocation Technology if 1.\r
2343 ///\r
2344 UINT32 L2CacheAllocation:1;\r
ee27f6ee
ED
2345 ///\r
2346 /// [Bit 3] Supports Memory Bandwidth Allocation if 1.\r
2347 ///\r
2348 UINT32 MemoryBandwidth:1;\r
2349 UINT32 Reserved3:28;\r
57d16ba1
MK
2350 } Bits;\r
2351 ///\r
2352 /// All bit fields as a 32-bit value\r
2353 ///\r
2354 UINT32 Uint32;\r
14806d7b 2355} CPUID_INTEL_RDT_ALLOCATION_ENUMERATION_SUB_LEAF_EBX;\r
57d16ba1
MK
2356\r
2357\r
2358/**\r
14806d7b 2359 L3 Cache Allocation Technology Enumeration Sub-leaf\r
57d16ba1 2360\r
14806d7b
HW
2361 @param EAX CPUID_INTEL_RDT_ALLOCATION (0x10)\r
2362 @param ECX CPUID_INTEL_RDT_ALLOCATION_L3_CACHE_SUB_LEAF (0x01)\r
57d16ba1 2363\r
14806d7b
HW
2364 @retval EAX RESID L3 Cache Allocation Technology information described by\r
2365 the type CPUID_INTEL_RDT_ALLOCATION_L3_CACHE_SUB_LEAF_EAX.\r
57d16ba1 2366 @retval EBX Bit-granular map of isolation/contention of allocation units.\r
14806d7b
HW
2367 @retval ECX RESID L3 Cache Allocation Technology information described by\r
2368 the type CPUID_INTEL_RDT_ALLOCATION_L3_CACHE_SUB_LEAF_ECX.\r
2369 @retval EDX RESID L3 Cache Allocation Technology information described by\r
2370 the type CPUID_INTEL_RDT_ALLOCATION_L3_CACHE_SUB_LEAF_EDX.\r
57d16ba1
MK
2371\r
2372 <b>Example usage</b>\r
2373 @code\r
14806d7b 2374 CPUID_INTEL_RDT_ALLOCATION_L3_CACHE_SUB_LEAF_EAX Eax;\r
57d16ba1 2375 UINT32 Ebx;\r
14806d7b
HW
2376 CPUID_INTEL_RDT_ALLOCATION_L3_CACHE_SUB_LEAF_ECX Ecx;\r
2377 CPUID_INTEL_RDT_ALLOCATION_L3_CACHE_SUB_LEAF_EDX Edx;\r
57d16ba1
MK
2378\r
2379 AsmCpuidEx (\r
14806d7b 2380 CPUID_INTEL_RDT_ALLOCATION, CPUID_INTEL_RDT_ALLOCATION_L3_CACHE_SUB_LEAF,\r
57d16ba1
MK
2381 &Eax.Uint32, &Ebx, &Ecx.Uint32, &Edx.Uint32\r
2382 );\r
2383 @endcode\r
2384**/\r
14806d7b 2385#define CPUID_INTEL_RDT_ALLOCATION_L3_CACHE_SUB_LEAF 0x01\r
57d16ba1
MK
2386\r
2387/**\r
14806d7b
HW
2388 CPUID L3 Cache Allocation Technology Information EAX for CPUID leaf\r
2389 #CPUID_INTEL_RDT_ALLOCATION, sub-leaf\r
2390 #CPUID_INTEL_RDT_ALLOCATION_L3_CACHE_SUB_LEAF.\r
57d16ba1
MK
2391**/\r
2392typedef union {\r
2393 ///\r
2394 /// Individual bit fields\r
2395 ///\r
2396 struct {\r
2397 ///\r
14806d7b
HW
2398 /// [Bits 4:0] Length of the capacity bit mask for the corresponding ResID\r
2399 /// using minus-one notation.\r
57d16ba1 2400 ///\r
14806d7b
HW
2401 UINT32 CapacityLength:5;\r
2402 UINT32 Reserved:27;\r
57d16ba1
MK
2403 } Bits;\r
2404 ///\r
2405 /// All bit fields as a 32-bit value\r
2406 ///\r
2407 UINT32 Uint32;\r
14806d7b 2408} CPUID_INTEL_RDT_ALLOCATION_L3_CACHE_SUB_LEAF_EAX;\r
57d16ba1
MK
2409\r
2410/**\r
14806d7b
HW
2411 CPUID L3 Cache Allocation Technology Information ECX for CPUID leaf\r
2412 #CPUID_INTEL_RDT_ALLOCATION, sub-leaf\r
2413 #CPUID_INTEL_RDT_ALLOCATION_L3_CACHE_SUB_LEAF.\r
57d16ba1
MK
2414**/\r
2415typedef union {\r
2416 ///\r
2417 /// Individual bit fields\r
2418 ///\r
2419 struct {\r
ee27f6ee 2420 UINT32 Reserved3:2;\r
57d16ba1
MK
2421 ///\r
2422 /// [Bit 2] Code and Data Prioritization Technology supported if 1.\r
2423 ///\r
2424 UINT32 CodeDataPrioritization:1;\r
2425 UINT32 Reserved2:29;\r
2426 } Bits;\r
2427 ///\r
2428 /// All bit fields as a 32-bit value\r
2429 ///\r
2430 UINT32 Uint32;\r
14806d7b
HW
2431} CPUID_INTEL_RDT_ALLOCATION_L3_CACHE_SUB_LEAF_ECX;\r
2432\r
2433/**\r
2434 CPUID L3 Cache Allocation Technology Information EDX for CPUID leaf\r
2435 #CPUID_INTEL_RDT_ALLOCATION, sub-leaf\r
2436 #CPUID_INTEL_RDT_ALLOCATION_L3_CACHE_SUB_LEAF.\r
2437**/\r
2438typedef union {\r
2439 ///\r
2440 /// Individual bit fields\r
2441 ///\r
2442 struct {\r
2443 ///\r
2444 /// [Bits 15:0] Highest COS number supported for this ResID.\r
2445 ///\r
2446 UINT32 HighestCosNumber:16;\r
2447 UINT32 Reserved:16;\r
2448 } Bits;\r
2449 ///\r
2450 /// All bit fields as a 32-bit value\r
2451 ///\r
2452 UINT32 Uint32;\r
2453} CPUID_INTEL_RDT_ALLOCATION_L3_CACHE_SUB_LEAF_EDX;\r
2454\r
2455/**\r
2456 L2 Cache Allocation Technology Enumeration Sub-leaf\r
2457\r
2458 @param EAX CPUID_INTEL_RDT_ALLOCATION (0x10)\r
2459 @param ECX CPUID_INTEL_RDT_ALLOCATION_L2_CACHE_SUB_LEAF (0x02)\r
2460\r
2461 @retval EAX RESID L2 Cache Allocation Technology information described by\r
2462 the type CPUID_INTEL_RDT_ALLOCATION_L2_CACHE_SUB_LEAF_EAX.\r
2463 @retval EBX Bit-granular map of isolation/contention of allocation units.\r
2464 @retval ECX Reserved.\r
2465 @retval EDX RESID L2 Cache Allocation Technology information described by\r
2466 the type CPUID_INTEL_RDT_ALLOCATION_L2_CACHE_SUB_LEAF_EDX.\r
2467\r
2468 <b>Example usage</b>\r
2469 @code\r
2470 CPUID_INTEL_RDT_ALLOCATION_L2_CACHE_SUB_LEAF_EAX Eax;\r
2471 UINT32 Ebx;\r
2472 CPUID_INTEL_RDT_ALLOCATION_L2_CACHE_SUB_LEAF_EDX Edx;\r
2473\r
2474 AsmCpuidEx (\r
2475 CPUID_INTEL_RDT_ALLOCATION, CPUID_INTEL_RDT_ALLOCATION_L2_CACHE_SUB_LEAF,\r
2476 &Eax.Uint32, &Ebx, NULL, &Edx.Uint32\r
2477 );\r
2478 @endcode\r
2479**/\r
2480#define CPUID_INTEL_RDT_ALLOCATION_L2_CACHE_SUB_LEAF 0x02\r
57d16ba1
MK
2481\r
2482/**\r
14806d7b
HW
2483 CPUID L2 Cache Allocation Technology Information EAX for CPUID leaf\r
2484 #CPUID_INTEL_RDT_ALLOCATION, sub-leaf\r
2485 #CPUID_INTEL_RDT_ALLOCATION_L2_CACHE_SUB_LEAF.\r
2486**/\r
2487typedef union {\r
2488 ///\r
2489 /// Individual bit fields\r
2490 ///\r
2491 struct {\r
2492 ///\r
2493 /// [Bits 4:0] Length of the capacity bit mask for the corresponding ResID\r
2494 /// using minus-one notation.\r
2495 ///\r
2496 UINT32 CapacityLength:5;\r
2497 UINT32 Reserved:27;\r
2498 } Bits;\r
2499 ///\r
2500 /// All bit fields as a 32-bit value\r
2501 ///\r
2502 UINT32 Uint32;\r
2503} CPUID_INTEL_RDT_ALLOCATION_L2_CACHE_SUB_LEAF_EAX;\r
2504\r
2505/**\r
2506 CPUID L2 Cache Allocation Technology Information EDX for CPUID leaf\r
2507 #CPUID_INTEL_RDT_ALLOCATION, sub-leaf\r
2508 #CPUID_INTEL_RDT_ALLOCATION_L2_CACHE_SUB_LEAF.\r
57d16ba1
MK
2509**/\r
2510typedef union {\r
2511 ///\r
2512 /// Individual bit fields\r
2513 ///\r
2514 struct {\r
2515 ///\r
2516 /// [Bits 15:0] Highest COS number supported for this ResID.\r
2517 ///\r
2518 UINT32 HighestCosNumber:16;\r
2519 UINT32 Reserved:16;\r
2520 } Bits;\r
2521 ///\r
2522 /// All bit fields as a 32-bit value\r
2523 ///\r
2524 UINT32 Uint32;\r
14806d7b 2525} CPUID_INTEL_RDT_ALLOCATION_L2_CACHE_SUB_LEAF_EDX;\r
57d16ba1 2526\r
ee27f6ee
ED
2527/**\r
2528 Memory Bandwidth Allocation Enumeration Sub-leaf\r
2529\r
2530 @param EAX CPUID_INTEL_RDT_ALLOCATION (0x10)\r
2531 @param ECX CPUID_INTEL_RDT_ALLOCATION_MEMORY_BANDWIDTH_SUB_LEAF (0x03)\r
2532\r
2533 @retval EAX RESID memory bandwidth Allocation Technology information\r
2534 described by the type\r
2535 CPUID_INTEL_RDT_ALLOCATION_MEMORY_BANDWIDTH_SUB_LEAF_EAX.\r
2536 @retval EBX Reserved.\r
2537 @retval ECX RESID memory bandwidth Allocation Technology information\r
2538 described by the type\r
2539 CPUID_INTEL_RDT_ALLOCATION_MEMORY_BANDWIDTH_SUB_LEAF_ECX.\r
2540 @retval EDX RESID memory bandwidth Allocation Technology information\r
2541 described by the type\r
2542 CPUID_INTEL_RDT_ALLOCATION_MEMORY_BANDWIDTH_SUB_LEAF_EDX.\r
2543\r
2544 <b>Example usage</b>\r
2545 @code\r
2546 CPUID_INTEL_RDT_ALLOCATION_MEMORY_BANDWIDTH_SUB_LEAF_EAX Eax;\r
2547 UINT32 Ebx;\r
2548 CPUID_INTEL_RDT_ALLOCATION_MEMORY_BANDWIDTH_SUB_LEAF_ECX Ecx;\r
2549 CPUID_INTEL_RDT_ALLOCATION_MEMORY_BANDWIDTH_SUB_LEAF_EDX Edx;\r
2550\r
2551\r
2552 AsmCpuidEx (\r
2553 CPUID_INTEL_RDT_ALLOCATION, CPUID_INTEL_RDT_ALLOCATION_MEMORY_BANDWIDTH_SUB_LEAF,\r
2554 &Eax.Uint32, &Ebx, NULL, &Edx.Uint32\r
2555 );\r
2556 @endcode\r
2557**/\r
2558#define CPUID_INTEL_RDT_ALLOCATION_MEMORY_BANDWIDTH_SUB_LEAF 0x03\r
2559\r
2560/**\r
2561 CPUID memory bandwidth Allocation Technology Information EAX for CPUID leaf\r
2562 #CPUID_INTEL_RDT_ALLOCATION, sub-leaf\r
2563 #CPUID_INTEL_RDT_ALLOCATION_MEMORY_BANDWIDTH_SUB_LEAF.\r
2564**/\r
2565typedef union {\r
2566 ///\r
2567 /// Individual bit fields\r
2568 ///\r
2569 struct {\r
2570 ///\r
2571 /// [Bits 11:0] Reports the maximum MBA throttling value supported for\r
2572 /// the corresponding ResID using minus-one notation.\r
2573 ///\r
2574 UINT32 MaximumMBAThrottling:12;\r
2575 UINT32 Reserved:20;\r
2576 } Bits;\r
2577 ///\r
2578 /// All bit fields as a 32-bit value\r
2579 ///\r
2580 UINT32 Uint32;\r
2581} CPUID_INTEL_RDT_ALLOCATION_MEMORY_BANDWIDTH_SUB_LEAF_EAX;\r
2582\r
2583/**\r
2584 CPUID memory bandwidth Allocation Technology Information ECX for CPUID leaf\r
2585 #CPUID_INTEL_RDT_ALLOCATION, sub-leaf\r
2586 #CPUID_INTEL_RDT_ALLOCATION_MEMORY_BANDWIDTH_SUB_LEAF.\r
2587**/\r
2588typedef union {\r
2589 ///\r
2590 /// Individual bit fields\r
2591 ///\r
2592 struct {\r
2593 ///\r
2594 /// [Bits 1:0] Reserved.\r
2595 ///\r
2596 UINT32 Reserved1:2;\r
2597 ///\r
2598 /// [Bits 3] Reports whether the response of the delay values is linear.\r
2599 ///\r
2600 UINT32 Liner:1;\r
2601 UINT32 Reserved2:29;\r
2602 } Bits;\r
2603 ///\r
2604 /// All bit fields as a 32-bit value\r
2605 ///\r
2606 UINT32 Uint32;\r
2607} CPUID_INTEL_RDT_ALLOCATION_MEMORY_BANDWIDTH_SUB_LEAF_ECX;\r
2608\r
2609/**\r
2610 CPUID memory bandwidth Allocation Technology Information EDX for CPUID leaf\r
2611 #CPUID_INTEL_RDT_ALLOCATION, sub-leaf\r
2612 #CPUID_INTEL_RDT_ALLOCATION_MEMORY_BANDWIDTH_SUB_LEAF.\r
2613**/\r
2614typedef union {\r
2615 ///\r
2616 /// Individual bit fields\r
2617 ///\r
2618 struct {\r
2619 ///\r
2620 /// [Bits 15:0] Highest COS number supported for this ResID.\r
2621 ///\r
2622 UINT32 HighestCosNumber:16;\r
2623 UINT32 Reserved:16;\r
2624 } Bits;\r
2625 ///\r
2626 /// All bit fields as a 32-bit value\r
2627 ///\r
2628 UINT32 Uint32;\r
2629} CPUID_INTEL_RDT_ALLOCATION_MEMORY_BANDWIDTH_SUB_LEAF_EDX;\r
57d16ba1 2630\r
c606a9a5
JF
2631/**\r
2632 Intel SGX resource capability and configuration.\r
2633 See Section 37.7.2 "Intel(R) SGX Resource Enumeration Leaves".\r
2634\r
2635 If CPUID.(EAX=07H, ECX=0H):EBX.SGX = 1, the processor also supports querying\r
2636 CPUID with EAX=12H on Intel SGX resource capability and configuration.\r
2637\r
2638 @param EAX CPUID_INTEL_SGX (0x12)\r
2639 @param ECX CPUID_INTEL_SGX_CAPABILITIES_0_SUB_LEAF (0x00).\r
2640 CPUID_INTEL_SGX_CAPABILITIES_1_SUB_LEAF (0x01).\r
2641 CPUID_INTEL_SGX_CAPABILITIES_RESOURCES_SUB_LEAF (0x02).\r
2642 Sub leafs 2..n based on the sub-leaf-type encoding (returned in EAX[3:0])\r
2643 until the sub-leaf type is invalid.\r
2644\r
2645**/\r
2646#define CPUID_INTEL_SGX 0x12\r
2647\r
2648/**\r
2649 Sub-Leaf 0 Enumeration of Intel SGX Capabilities.\r
2650 Enumerates Intel SGX capability, including enclave instruction opcode support.\r
2651\r
2652 @param EAX CPUID_INTEL_SGX (0x12)\r
2653 @param ECX CPUID_INTEL_SGX_CAPABILITIES_0_SUB_LEAF (0x00)\r
2654\r
2655 @retval EAX The format of Sub-Leaf 0 Enumeration of Intel SGX Capabilities is\r
2656 described by the type CPUID_INTEL_SGX_CAPABILITIES_0_SUB_LEAF_EAX.\r
2657 @retval EBX MISCSELECT: Reports the bit vector of supported extended features\r
2658 that can be written to the MISC region of the SSA.\r
2659 @retval ECX Reserved.\r
2660 @retval EDX The format of Sub-Leaf 0 Enumeration of Intel SGX Capabilities is\r
2661 described by the type CPUID_INTEL_SGX_CAPABILITIES_0_SUB_LEAF_EDX.\r
2662\r
2663 <b>Example usage</b>\r
2664 @code\r
2665 CPUID_INTEL_SGX_CAPABILITIES_0_SUB_LEAF_EAX Eax;\r
2666 UINT32 Ebx;\r
2667 CPUID_INTEL_SGX_CAPABILITIES_0_SUB_LEAF_EDX Edx;\r
2668\r
2669 AsmCpuidEx (\r
2670 CPUID_INTEL_SGX, CPUID_INTEL_SGX_CAPABILITIES_0_SUB_LEAF,\r
2671 &Eax.Uint32, &Ebx, NULL, &Edx.Uint32\r
2672 );\r
2673 @endcode\r
2674**/\r
2675#define CPUID_INTEL_SGX_CAPABILITIES_0_SUB_LEAF 0x00\r
2676\r
2677/**\r
2678 Sub-Leaf 0 Enumeration of Intel SGX Capabilities EAX for CPUID leaf #CPUID_INTEL_SGX,\r
2679 sub-leaf #CPUID_INTEL_SGX_CAPABILITIES_0_SUB_LEAF.\r
2680**/\r
2681typedef union {\r
2682 ///\r
2683 /// Individual bit fields\r
2684 ///\r
2685 struct {\r
2686 ///\r
2687 /// [Bit 0] If 1, indicates leaf functions of SGX1 instruction are supported.\r
2688 ///\r
2689 UINT32 SGX1:1;\r
2690 ///\r
2691 /// [Bit 1] If 1, indicates leaf functions of SGX2 instruction are supported.\r
2692 ///\r
2693 UINT32 SGX2:1;\r
ee27f6ee
ED
2694 UINT32 Reserved1:3;\r
2695 ///\r
2696 /// [Bit 5] If 1, indicates Intel SGX supports ENCLV instruction leaves\r
2697 /// EINCVIRTCHILD, EDECVIRTCHILD, and ESETCONTEXT.\r
2698 ///\r
2699 UINT32 ENCLV:1;\r
2700 ///\r
2701 /// [Bit 6] If 1, indicates Intel SGX supports ENCLS instruction leaves ETRACKC,\r
2702 /// ERDINFO, ELDBC, and ELDUC.\r
2703 ///\r
2704 UINT32 ENCLS:1;\r
2705 UINT32 Reserved2:25;\r
c606a9a5
JF
2706 } Bits;\r
2707 ///\r
2708 /// All bit fields as a 32-bit value\r
2709 ///\r
2710 UINT32 Uint32;\r
2711} CPUID_INTEL_SGX_CAPABILITIES_0_SUB_LEAF_EAX;\r
2712\r
2713/**\r
2714 Sub-Leaf 0 Enumeration of Intel SGX Capabilities EDX for CPUID leaf #CPUID_INTEL_SGX,\r
2715 sub-leaf #CPUID_INTEL_SGX_CAPABILITIES_0_SUB_LEAF.\r
2716**/\r
2717typedef union {\r
2718 ///\r
2719 /// Individual bit fields\r
2720 ///\r
2721 struct {\r
2722 ///\r
2723 /// [Bit 7:0] The maximum supported enclave size is 2^(EDX[7:0]) bytes\r
2724 /// when not in 64-bit mode.\r
2725 ///\r
2726 UINT32 MaxEnclaveSize_Not64:8;\r
2727 ///\r
2728 /// [Bit 15:8] The maximum supported enclave size is 2^(EDX[15:8]) bytes\r
2729 /// when operating in 64-bit mode.\r
2730 ///\r
2731 UINT32 MaxEnclaveSize_64:8;\r
2732 UINT32 Reserved:16;\r
2733 } Bits;\r
2734 ///\r
2735 /// All bit fields as a 32-bit value\r
2736 ///\r
2737 UINT32 Uint32;\r
2738} CPUID_INTEL_SGX_CAPABILITIES_0_SUB_LEAF_EDX;\r
2739\r
2740\r
2741/**\r
2742 Sub-Leaf 1 Enumeration of Intel SGX Capabilities.\r
2743 Enumerates Intel SGX capability of processor state configuration and enclave\r
2744 configuration in the SECS structure.\r
2745\r
2746 @param EAX CPUID_INTEL_SGX (0x12)\r
2747 @param ECX CPUID_INTEL_SGX_CAPABILITIES_1_SUB_LEAF (0x01)\r
2748\r
2749 @retval EAX Report the valid bits of SECS.ATTRIBUTES[31:0] that software can\r
2750 set with ECREATE. SECS.ATTRIBUTES[n] can be set to 1 using ECREATE\r
2751 only if EAX[n] is 1, where n < 32.\r
2752 @retval EBX Report the valid bits of SECS.ATTRIBUTES[63:32] that software can\r
2753 set with ECREATE. SECS.ATTRIBUTES[n+32] can be set to 1 using ECREATE\r
2754 only if EBX[n] is 1, where n < 32.\r
2755 @retval ECX Report the valid bits of SECS.ATTRIBUTES[95:64] that software can\r
2756 set with ECREATE. SECS.ATTRIBUTES[n+64] can be set to 1 using ECREATE\r
2757 only if ECX[n] is 1, where n < 32.\r
2758 @retval EDX Report the valid bits of SECS.ATTRIBUTES[127:96] that software can\r
2759 set with ECREATE. SECS.ATTRIBUTES[n+96] can be set to 1 using ECREATE\r
2760 only if EDX[n] is 1, where n < 32.\r
2761\r
2762 <b>Example usage</b>\r
2763 @code\r
2764 UINT32 Eax;\r
2765 UINT32 Ebx;\r
2766 UINT32 Ecx;\r
2767 UINT32 Edx;\r
2768\r
2769 AsmCpuidEx (\r
2770 CPUID_INTEL_SGX, CPUID_INTEL_SGX_CAPABILITIES_1_SUB_LEAF,\r
2771 &Eax, &Ebx, &Ecx, &Edx\r
2772 );\r
2773 @endcode\r
2774**/\r
2775#define CPUID_INTEL_SGX_CAPABILITIES_1_SUB_LEAF 0x01\r
2776\r
2777\r
2778/**\r
2779 Sub-Leaf Index 2 or Higher Enumeration of Intel SGX Resources.\r
2780 Enumerates available EPC resources.\r
2781\r
2782 @param EAX CPUID_INTEL_SGX (0x12)\r
2783 @param ECX CPUID_INTEL_SGX_CAPABILITIES_RESOURCES_SUB_LEAF (0x02)\r
2784\r
2785 @retval EAX The format of Sub-Leaf Index 2 or Higher Enumeration of Intel SGX\r
2786 Resources is described by the type\r
2787 CPUID_INTEL_SGX_CAPABILITIES_RESOURCES_SUB_LEAF_EAX.\r
2788 @retval EBX The format of Sub-Leaf Index 2 or Higher Enumeration of Intel SGX\r
2789 Resources is described by the type\r
2790 CPUID_INTEL_SGX_CAPABILITIES_RESOURCES_SUB_LEAF_EBX.\r
2791 @retval EDX The format of Sub-Leaf Index 2 or Higher Enumeration of Intel SGX\r
2792 Resources is described by the type\r
2793 CPUID_INTEL_SGX_CAPABILITIES_RESOURCES_SUB_LEAF_ECX.\r
2794 @retval EDX The format of Sub-Leaf Index 2 or Higher Enumeration of Intel SGX\r
2795 Resources is described by the type\r
2796 CPUID_INTEL_SGX_CAPABILITIES_RESOURCES_SUB_LEAF_EDX.\r
2797\r
2798 <b>Example usage</b>\r
2799 @code\r
2800 CPUID_INTEL_SGX_CAPABILITIES_RESOURCES_SUB_LEAF_EAX Eax;\r
2801 CPUID_INTEL_SGX_CAPABILITIES_RESOURCES_SUB_LEAF_EBX Ebx;\r
2802 CPUID_INTEL_SGX_CAPABILITIES_RESOURCES_SUB_LEAF_ECX Ecx;\r
2803 CPUID_INTEL_SGX_CAPABILITIES_RESOURCES_SUB_LEAF_EDX Edx;\r
2804\r
2805 AsmCpuidEx (\r
2806 CPUID_INTEL_SGX, CPUID_INTEL_SGX_CAPABILITIES_RESOURCES_SUB_LEAF,\r
2807 &Eax.Uint32, &Ebx.Uint32, &Ecx.Uint32, &Edx.Uint32\r
2808 );\r
2809 @endcode\r
2810**/\r
2811#define CPUID_INTEL_SGX_CAPABILITIES_RESOURCES_SUB_LEAF 0x02\r
2812\r
2813/**\r
2814 Sub-Leaf Index 2 or Higher Enumeration of Intel SGX Resources EAX for CPUID\r
2815 leaf #CPUID_INTEL_SGX, sub-leaf #CPUID_INTEL_SGX_CAPABILITIES_RESOURCES_SUB_LEAF.\r
2816**/\r
2817typedef union {\r
2818 ///\r
2819 /// Individual bit fields\r
2820 ///\r
2821 struct {\r
2822 ///\r
2823 /// [Bit 3:0] Sub-leaf-type encoding.\r
2824 /// 0000b: This sub-leaf is invalid, EBX:EAX and EDX:ECX report 0.\r
2825 /// 0001b: This sub-leaf provides information on the Enclave Page Cache (EPC)\r
2826 /// in EBX:EAX and EDX:ECX.\r
2827 /// All other encoding are reserved.\r
2828 ///\r
2829 UINT32 SubLeafType:4;\r
2830 UINT32 Reserved:8;\r
2831 ///\r
2832 /// [Bit 31:12] If EAX[3:0] = 0001b, these are bits 31:12 of the physical address of\r
2833 /// the base of the EPC section.\r
2834 ///\r
2835 UINT32 LowAddressOfEpcSection:20;\r
2836 } Bits;\r
2837 ///\r
2838 /// All bit fields as a 32-bit value\r
2839 ///\r
2840 UINT32 Uint32;\r
2841} CPUID_INTEL_SGX_CAPABILITIES_RESOURCES_SUB_LEAF_EAX;\r
2842\r
2843/**\r
2844 Sub-Leaf Index 2 or Higher Enumeration of Intel SGX Resources EBX for CPUID\r
2845 leaf #CPUID_INTEL_SGX, sub-leaf #CPUID_INTEL_SGX_CAPABILITIES_RESOURCES_SUB_LEAF.\r
2846**/\r
2847typedef union {\r
2848 ///\r
2849 /// Individual bit fields\r
2850 ///\r
2851 struct {\r
2852 ///\r
2853 /// [Bit 19:0] If EAX[3:0] = 0001b, these are bits 51:32 of the physical address of\r
2854 /// the base of the EPC section.\r
2855 ///\r
2856 UINT32 HighAddressOfEpcSection:20;\r
2857 UINT32 Reserved:12;\r
2858 } Bits;\r
2859 ///\r
2860 /// All bit fields as a 32-bit value\r
2861 ///\r
2862 UINT32 Uint32;\r
2863} CPUID_INTEL_SGX_CAPABILITIES_RESOURCES_SUB_LEAF_EBX;\r
2864\r
2865/**\r
2866 Sub-Leaf Index 2 or Higher Enumeration of Intel SGX Resources ECX for CPUID\r
2867 leaf #CPUID_INTEL_SGX, sub-leaf #CPUID_INTEL_SGX_CAPABILITIES_RESOURCES_SUB_LEAF.\r
2868**/\r
2869typedef union {\r
2870 ///\r
2871 /// Individual bit fields\r
2872 ///\r
2873 struct {\r
2874 ///\r
2875 /// [Bit 3:0] The EPC section encoding.\r
2876 /// 0000b: Not valid.\r
2877 /// 0001b: The EPC section is confidentiality, integrity and replay protected.\r
2878 /// All other encoding are reserved.\r
2879 ///\r
2880 UINT32 EpcSection:4;\r
2881 UINT32 Reserved:8;\r
2882 ///\r
2883 /// [Bit 31:12] If EAX[3:0] = 0001b, these are bits 31:12 of the size of the\r
2884 /// corresponding EPC section within the Processor Reserved Memory.\r
2885 ///\r
2886 UINT32 LowSizeOfEpcSection:20;\r
2887 } Bits;\r
2888 ///\r
2889 /// All bit fields as a 32-bit value\r
2890 ///\r
2891 UINT32 Uint32;\r
2892} CPUID_INTEL_SGX_CAPABILITIES_RESOURCES_SUB_LEAF_ECX;\r
2893\r
2894/**\r
2895 Sub-Leaf Index 2 or Higher Enumeration of Intel SGX Resources EDX for CPUID\r
2896 leaf #CPUID_INTEL_SGX, sub-leaf #CPUID_INTEL_SGX_CAPABILITIES_RESOURCES_SUB_LEAF.\r
2897**/\r
2898typedef union {\r
2899 ///\r
2900 /// Individual bit fields\r
2901 ///\r
2902 struct {\r
2903 ///\r
2904 /// [Bit 19:0] If EAX[3:0] = 0001b, these are bits 51:32 of the size of the\r
2905 /// corresponding EPC section within the Processor Reserved Memory.\r
2906 ///\r
2907 UINT32 HighSizeOfEpcSection:20;\r
2908 UINT32 Reserved:12;\r
2909 } Bits;\r
2910 ///\r
2911 /// All bit fields as a 32-bit value\r
2912 ///\r
2913 UINT32 Uint32;\r
2914} CPUID_INTEL_SGX_CAPABILITIES_RESOURCES_SUB_LEAF_EDX;\r
2915\r
2916\r
57d16ba1
MK
2917/**\r
2918 CPUID Intel Processor Trace Information\r
2919\r
2920 @param EAX CPUID_INTEL_PROCESSOR_TRACE (0x14)\r
2921 @param ECX CPUID_INTEL_PROCESSOR_TRACE_MAIN_LEAF (0x00).\r
2922 CPUID_INTEL_PROCESSOR_TRACE_SUB_LEAF (0x01).\r
2923\r
2924**/\r
2925#define CPUID_INTEL_PROCESSOR_TRACE 0x14\r
2926\r
2927/**\r
2928 CPUID Intel Processor Trace Information Main Leaf\r
2929\r
2930 @param EAX CPUID_INTEL_PROCEDSSOR_TRACE (0x14)\r
2931 @param ECX CPUID_INTEL_PROCEDSSOR_TRACE_MAIN_LEAF (0x00)\r
2932\r
2933 @retval EAX Reports the maximum sub-leaf supported in leaf 14H.\r
2934 @retval EBX Returns Intel processor trace information described by the\r
2935 type CPUID_INTEL_PROCESSOR_TRACE_MAIN_LEAF_EBX.\r
2936 @retval ECX Returns Intel processor trace information described by the\r
2937 type CPUID_INTEL_PROCESSOR_TRACE_MAIN_LEAF_ECX.\r
2938 @retval EDX Reserved.\r
2939\r
2940 <b>Example usage</b>\r
2941 @code\r
2942 UINT32 Eax;\r
2943 CPUID_INTEL_PROCESSOR_TRACE_MAIN_LEAF_EBX Ebx;\r
2944 CPUID_INTEL_PROCESSOR_TRACE_MAIN_LEAF_ECX Ecx;\r
2945\r
2946 AsmCpuidEx (\r
2947 CPUID_INTEL_PROCESSOR_TRACE, CPUID_INTEL_PROCESSOR_TRACE_MAIN_LEAF,\r
2948 &Eax, &Ebx.Uint32, &Ecx.Uint32, NULL\r
2949 );\r
2950 @endcode\r
2951**/\r
2952#define CPUID_INTEL_PROCESSOR_TRACE_MAIN_LEAF 0x00\r
2953\r
2954/**\r
2955 CPUID Intel Processor Trace EBX for CPUID leaf #CPUID_INTEL_PROCESSOR_TRACE,\r
2956 sub-leaf #CPUID_INTEL_PROCESSOR_TRACE_MAIN_LEAF.\r
2957**/\r
2958typedef union {\r
2959 ///\r
2960 /// Individual bit fields\r
2961 ///\r
2962 struct {\r
2963 ///\r
14806d7b 2964 /// [Bit 0] If 1, indicates that IA32_RTIT_CTL.CR3Filter can be set to 1,\r
57d16ba1
MK
2965 /// and that IA32_RTIT_CR3_MATCH MSR can be accessed.\r
2966 ///\r
2967 UINT32 Cr3Filter:1;\r
2968 ///\r
14806d7b 2969 /// [Bit 1] If 1, indicates support of Configurable PSB and Cycle-Accurate\r
57d16ba1
MK
2970 /// Mode.\r
2971 ///\r
2972 UINT32 ConfigurablePsb:1;\r
2973 ///\r
14806d7b 2974 /// [Bit 2] If 1, indicates support of IP Filtering, TraceStop filtering,\r
57d16ba1
MK
2975 /// and preservation of Intel PT MSRs across warm reset.\r
2976 ///\r
2977 UINT32 IpTraceStopFiltering:1;\r
2978 ///\r
14806d7b 2979 /// [Bit 3] If 1, indicates support of MTC timing packet and suppression of\r
57d16ba1
MK
2980 /// COFI-based packets.\r
2981 ///\r
2982 UINT32 Mtc:1;\r
14806d7b
HW
2983 ///\r
2984 /// [Bit 4] If 1, indicates support of PTWRITE. Writes can set\r
2985 /// IA32_RTIT_CTL[12] (PTWEn) and IA32_RTIT_CTL[5] (FUPonPTW), and PTWRITE\r
2986 /// can generate packets.\r
2987 ///\r
2988 UINT32 PTWrite:1;\r
2989 ///\r
2990 /// [Bit 5] If 1, indicates support of Power Event Trace. Writes can set\r
2991 /// IA32_RTIT_CTL[4] (PwrEvtEn), enabling Power Event Trace packet\r
2992 /// generation.\r
2993 ///\r
2994 UINT32 PowerEventTrace:1;\r
2995 UINT32 Reserved:26;\r
57d16ba1
MK
2996 } Bits;\r
2997 ///\r
2998 /// All bit fields as a 32-bit value\r
2999 ///\r
3000 UINT32 Uint32;\r
3001} CPUID_INTEL_PROCESSOR_TRACE_MAIN_LEAF_EBX;\r
3002\r
3003/**\r
3004 CPUID Intel Processor Trace ECX for CPUID leaf #CPUID_INTEL_PROCESSOR_TRACE,\r
3005 sub-leaf #CPUID_INTEL_PROCESSOR_TRACE_MAIN_LEAF.\r
3006**/\r
3007typedef union {\r
3008 ///\r
3009 /// Individual bit fields\r
3010 ///\r
3011 struct {\r
3012 ///\r
3013 /// [Bit 0] If 1, Tracing can be enabled with IA32_RTIT_CTL.ToPA = 1, hence\r
3014 /// utilizing the ToPA output scheme; IA32_RTIT_OUTPUT_BASE and\r
3015 /// IA32_RTIT_OUTPUT_MASK_PTRS MSRs can be accessed.\r
3016 ///\r
3017 UINT32 RTIT:1;\r
3018 ///\r
3019 /// [Bit 1] If 1, ToPA tables can hold any number of output entries, up to\r
3020 /// the maximum allowed by the MaskOrTableOffset field of\r
3021 /// IA32_RTIT_OUTPUT_MASK_PTRS.\r
3022 ///\r
3023 UINT32 ToPA:1;\r
3024 ///\r
14806d7b 3025 /// [Bit 2] If 1, indicates support of Single-Range Output scheme.\r
57d16ba1
MK
3026 ///\r
3027 UINT32 SingleRangeOutput:1;\r
3028 ///\r
14806d7b 3029 /// [Bit 3] If 1, indicates support of output to Trace Transport subsystem.\r
57d16ba1
MK
3030 ///\r
3031 UINT32 TraceTransportSubsystem:1;\r
3032 UINT32 Reserved:27;\r
3033 ///\r
14806d7b 3034 /// [Bit 31] If 1, generated packets which contain IP payloads have LIP\r
57d16ba1
MK
3035 /// values, which include the CS base component.\r
3036 ///\r
3037 UINT32 LIP:1;\r
3038 } Bits;\r
3039 ///\r
3040 /// All bit fields as a 32-bit value\r
3041 ///\r
3042 UINT32 Uint32;\r
3043} CPUID_INTEL_PROCESSOR_TRACE_MAIN_LEAF_ECX;\r
3044\r
3045\r
3046/**\r
3047 CPUID Intel Processor Trace Information Sub-leaf\r
3048\r
3049 @param EAX CPUID_INTEL_PROCEDSSOR_TRACE (0x14)\r
3050 @param ECX CPUID_INTEL_PROCESSOR_TRACE_SUB_LEAF (0x01)\r
3051\r
3052 @retval EAX Returns Intel processor trace information described by the\r
3053 type CPUID_INTEL_PROCESSOR_TRACE_SUB_LEAF_EAX.\r
3054 @retval EBX Returns Intel processor trace information described by the\r
3055 type CPUID_INTEL_PROCESSOR_TRACE_SUB_LEAF_EBX.\r
3056 @retval ECX Reserved.\r
3057 @retval EDX Reserved.\r
3058\r
3059 <b>Example usage</b>\r
3060 @code\r
3061 UINT32 MaximumSubLeaf;\r
3062 UINT32 SubLeaf;\r
3063 CPUID_INTEL_PROCESSOR_TRACE_SUB_LEAF_EAX Eax;\r
3064 CPUID_INTEL_PROCESSOR_TRACE_SUB_LEAF_EBX Ebx;\r
3065\r
3066 AsmCpuidEx (\r
3067 CPUID_INTEL_PROCESSOR_TRACE, CPUID_INTEL_PROCESSOR_TRACE_MAIN_LEAF,\r
3068 &MaximumSubLeaf, NULL, NULL, NULL\r
3069 );\r
3070\r
3071 for (SubLeaf = CPUID_INTEL_PROCESSOR_TRACE_SUB_LEAF; SubLeaf <= MaximumSubLeaf; SubLeaf++) {\r
3072 AsmCpuidEx (\r
3073 CPUID_INTEL_PROCESSOR_TRACE, SubLeaf,\r
3074 &Eax.Uint32, &Ebx.Uint32, NULL, NULL\r
3075 );\r
3076 }\r
3077 @endcode\r
3078**/\r
3079#define CPUID_INTEL_PROCESSOR_TRACE_SUB_LEAF 0x01\r
3080\r
3081/**\r
3082 CPUID Intel Processor Trace EAX for CPUID leaf #CPUID_INTEL_PROCESSOR_TRACE,\r
3083 sub-leaf #CPUID_INTEL_PROCESSOR_TRACE_SUB_LEAF.\r
3084**/\r
3085typedef union {\r
3086 ///\r
3087 /// Individual bit fields\r
3088 ///\r
3089 struct {\r
3090 ///\r
3091 /// [Bits 2:0] Number of configurable Address Ranges for filtering.\r
3092 ///\r
3093 UINT32 ConfigurableAddressRanges:3;\r
3094 UINT32 Reserved:13;\r
3095 ///\r
3096 /// [Bits 31:16] Bitmap of supported MTC period encodings\r
3097 ///\r
3098 UINT32 MtcPeriodEncodings:16;\r
3099\r
3100 } Bits;\r
3101 ///\r
3102 /// All bit fields as a 32-bit value\r
3103 ///\r
3104 UINT32 Uint32;\r
3105} CPUID_INTEL_PROCESSOR_TRACE_SUB_LEAF_EAX;\r
3106\r
3107/**\r
3108 CPUID Intel Processor Trace EBX for CPUID leaf #CPUID_INTEL_PROCESSOR_TRACE,\r
3109 sub-leaf #CPUID_INTEL_PROCESSOR_TRACE_SUB_LEAF.\r
3110**/\r
3111typedef union {\r
3112 ///\r
3113 /// Individual bit fields\r
3114 ///\r
3115 struct {\r
3116 ///\r
3117 /// [Bits 15:0] Bitmap of supported Cycle Threshold value encodings.\r
3118 ///\r
3119 UINT32 CycleThresholdEncodings:16;\r
3120 ///\r
3121 /// [Bits 31:16] Bitmap of supported Configurable PSB frequency encodings.\r
3122 ///\r
3123 UINT32 PsbFrequencyEncodings:16;\r
3124\r
3125 } Bits;\r
3126 ///\r
3127 /// All bit fields as a 32-bit value\r
3128 ///\r
3129 UINT32 Uint32;\r
3130} CPUID_INTEL_PROCESSOR_TRACE_SUB_LEAF_EBX;\r
3131\r
3132\r
3133/**\r
14806d7b 3134 CPUID Time Stamp Counter and Nominal Core Crystal Clock Information\r
57d16ba1
MK
3135\r
3136 @note\r
3137 If EBX[31:0] is 0, the TSC/"core crystal clock" ratio is not enumerated.\r
3138 EBX[31:0]/EAX[31:0] indicates the ratio of the TSC frequency and the core\r
3139 crystal clock frequency.\r
14806d7b
HW
3140 If ECX is 0, the nominal core crystal clock frequency is not enumerated.\r
3141 "TSC frequency" = "core crystal clock frequency" * EBX/EAX.\r
57d16ba1
MK
3142 The core crystal clock may differ from the reference clock, bus clock, or core\r
3143 clock frequencies.\r
3144\r
3145 @param EAX CPUID_TIME_STAMP_COUNTER (0x15)\r
3146\r
3147 @retval EAX An unsigned integer which is the denominator of the\r
3148 TSC/"core crystal clock" ratio\r
3149 @retval EBX An unsigned integer which is the numerator of the\r
3150 TSC/"core crystal clock" ratio.\r
14806d7b
HW
3151 @retval ECX An unsigned integer which is the nominal frequency\r
3152 of the core crystal clock in Hz.\r
57d16ba1
MK
3153 @retval EDX Reserved.\r
3154\r
3155 <b>Example usage</b>\r
3156 @code\r
3157 UINT32 Eax;\r
3158 UINT32 Ebx;\r
14806d7b 3159 UINT32 Ecx;\r
57d16ba1 3160\r
14806d7b 3161 AsmCpuid (CPUID_TIME_STAMP_COUNTER, &Eax, &Ebx, &Ecx, NULL);\r
57d16ba1
MK
3162 @endcode\r
3163**/\r
3164#define CPUID_TIME_STAMP_COUNTER 0x15\r
3165\r
3166\r
3167/**\r
3168 CPUID Processor Frequency Information\r
3169\r
3170 @note\r
3171 Data is returned from this interface in accordance with the processor's\r
3172 specification and does not reflect actual values. Suitable use of this data\r
3173 includes the display of processor information in like manner to the processor\r
3174 brand string and for determining the appropriate range to use when displaying\r
3175 processor information e.g. frequency history graphs. The returned information\r
3176 should not be used for any other purpose as the returned information does not\r
3177 accurately correlate to information / counters returned by other processor\r
3178 interfaces. While a processor may support the Processor Frequency Information\r
3179 leaf, fields that return a value of zero are not supported.\r
3180\r
3181 @param EAX CPUID_TIME_STAMP_COUNTER (0x16)\r
3182\r
3183 @retval EAX Returns processor base frequency information described by the\r
3184 type CPUID_PROCESSOR_FREQUENCY_EAX.\r
3185 @retval EBX Returns maximum frequency information described by the type\r
3186 CPUID_PROCESSOR_FREQUENCY_EBX.\r
3187 @retval ECX Returns bus frequency information described by the type\r
3188 CPUID_PROCESSOR_FREQUENCY_ECX.\r
3189 @retval EDX Reserved.\r
3190\r
3191 <b>Example usage</b>\r
3192 @code\r
3193 CPUID_PROCESSOR_FREQUENCY_EAX Eax;\r
3194 CPUID_PROCESSOR_FREQUENCY_EBX Ebx;\r
3195 CPUID_PROCESSOR_FREQUENCY_ECX Ecx;\r
3196\r
3197 AsmCpuid (CPUID_PROCESSOR_FREQUENCY, &Eax.Uint32, &Ebx.Uint32, &Ecx.Uint32, NULL);\r
3198 @endcode\r
3199**/\r
3200#define CPUID_PROCESSOR_FREQUENCY 0x16\r
3201\r
3202/**\r
3203 CPUID Processor Frequency Information EAX for CPUID leaf\r
3204 #CPUID_PROCESSOR_FREQUENCY.\r
3205**/\r
3206typedef union {\r
3207 ///\r
3208 /// Individual bit fields\r
3209 ///\r
3210 struct {\r
3211 ///\r
3212 /// [Bits 15:0] Processor Base Frequency (in MHz).\r
3213 ///\r
3214 UINT32 ProcessorBaseFrequency:16;\r
3215 UINT32 Reserved:16;\r
3216 } Bits;\r
3217 ///\r
3218 /// All bit fields as a 32-bit value\r
3219 ///\r
3220 UINT32 Uint32;\r
3221} CPUID_PROCESSOR_FREQUENCY_EAX;\r
3222\r
3223/**\r
3224 CPUID Processor Frequency Information EBX for CPUID leaf\r
3225 #CPUID_PROCESSOR_FREQUENCY.\r
3226**/\r
3227typedef union {\r
3228 ///\r
3229 /// Individual bit fields\r
3230 ///\r
3231 struct {\r
3232 ///\r
3233 /// [Bits 15:0] Maximum Frequency (in MHz).\r
3234 ///\r
3235 UINT32 MaximumFrequency:16;\r
3236 UINT32 Reserved:16;\r
3237 } Bits;\r
3238 ///\r
3239 /// All bit fields as a 32-bit value\r
3240 ///\r
3241 UINT32 Uint32;\r
3242} CPUID_PROCESSOR_FREQUENCY_EBX;\r
3243\r
3244/**\r
3245 CPUID Processor Frequency Information ECX for CPUID leaf\r
3246 #CPUID_PROCESSOR_FREQUENCY.\r
3247**/\r
3248typedef union {\r
3249 ///\r
3250 /// Individual bit fields\r
3251 ///\r
3252 struct {\r
3253 ///\r
3254 /// [Bits 15:0] Bus (Reference) Frequency (in MHz).\r
3255 ///\r
3256 UINT32 BusFrequency:16;\r
3257 UINT32 Reserved:16;\r
3258 } Bits;\r
3259 ///\r
3260 /// All bit fields as a 32-bit value\r
3261 ///\r
3262 UINT32 Uint32;\r
3263} CPUID_PROCESSOR_FREQUENCY_ECX;\r
3264\r
28a7ddf0 3265\r
57d16ba1
MK
3266/**\r
3267 CPUID SoC Vendor Information\r
28a7ddf0 3268\r
57d16ba1
MK
3269 @param EAX CPUID_SOC_VENDOR (0x17)\r
3270 @param ECX CPUID_SOC_VENDOR_MAIN_LEAF (0x00)\r
3271 CPUID_SOC_VENDOR_BRAND_STRING1 (0x01)\r
3272 CPUID_SOC_VENDOR_BRAND_STRING1 (0x02)\r
3273 CPUID_SOC_VENDOR_BRAND_STRING1 (0x03)\r
28a7ddf0 3274\r
57d16ba1
MK
3275 @note\r
3276 Leaf 17H output depends on the initial value in ECX. SOC Vendor Brand String\r
3277 is a UTF-8 encoded string padded with trailing bytes of 00H. The complete SOC\r
3278 Vendor Brand String is constructed by concatenating in ascending order of\r
3279 EAX:EBX:ECX:EDX and from the sub-leaf 1 fragment towards sub-leaf 3.\r
28a7ddf0 3280\r
57d16ba1
MK
3281**/\r
3282#define CPUID_SOC_VENDOR 0x17\r
3283\r
3284/**\r
3285 CPUID SoC Vendor Information\r
3286\r
3287 @param EAX CPUID_SOC_VENDOR (0x17)\r
3288 @param ECX CPUID_SOC_VENDOR_MAIN_LEAF (0x00)\r
3289\r
3290 @retval EAX MaxSOCID_Index. Reports the maximum input value of supported\r
3291 sub-leaf in leaf 17H.\r
3292 @retval EBX Returns SoC Vendor information described by the type\r
3293 CPUID_SOC_VENDOR_MAIN_LEAF_EBX.\r
3294 @retval ECX Project ID. A unique number an SOC vendor assigns to its SOC\r
3295 projects.\r
3296 @retval EDX Stepping ID. A unique number within an SOC project that an SOC\r
3297 vendor assigns.\r
3298\r
3299 <b>Example usage</b>\r
3300 @code\r
3301 UINT32 Eax;\r
3302 CPUID_SOC_VENDOR_MAIN_LEAF_EBX Ebx;\r
3303 UINT32 Ecx;\r
3304 UINT32 Edx;\r
3305\r
3306 AsmCpuidEx (\r
3307 CPUID_SOC_VENDOR, CPUID_SOC_VENDOR_MAIN_LEAF,\r
3308 &Eax, &Ebx.Uint32, &Ecx, &Edx\r
3309 );\r
3310 @endcode\r
3311**/\r
3312#define CPUID_SOC_VENDOR_MAIN_LEAF 0x00\r
3313\r
3314/**\r
3315 CPUID SoC Vendor Information EBX for CPUID leaf #CPUID_SOC_VENDOR sub-leaf\r
3316 #CPUID_SOC_VENDOR_MAIN_LEAF.\r
3317**/\r
3318typedef union {\r
3319 ///\r
3320 /// Individual bit fields\r
3321 ///\r
3322 struct {\r
3323 ///\r
3324 /// [Bits 15:0] SOC Vendor ID.\r
3325 ///\r
3326 UINT32 SocVendorId:16;\r
3327 ///\r
3328 /// [Bit 16] If 1, the SOC Vendor ID field is assigned via an industry\r
3329 /// standard enumeration scheme. Otherwise, the SOC Vendor ID field is\r
3330 /// assigned by Intel.\r
3331 ///\r
3332 UINT32 IsVendorScheme:1;\r
3333 UINT32 Reserved:15;\r
3334 } Bits;\r
3335 ///\r
3336 /// All bit fields as a 32-bit value\r
3337 ///\r
3338 UINT32 Uint32;\r
3339} CPUID_SOC_VENDOR_MAIN_LEAF_EBX;\r
3340\r
3341/**\r
3342 CPUID SoC Vendor Information\r
3343\r
3344 @param EAX CPUID_SOC_VENDOR (0x17)\r
3345 @param ECX CPUID_SOC_VENDOR_BRAND_STRING1 (0x01)\r
3346\r
3347 @retval EAX SOC Vendor Brand String. UTF-8 encoded string of type\r
3348 CPUID_SOC_VENDOR_BRAND_STRING_DATA.\r
3349 @retval EBX SOC Vendor Brand String. UTF-8 encoded string of type\r
3350 CPUID_SOC_VENDOR_BRAND_STRING_DATA.\r
3351 @retval ECX SOC Vendor Brand String. UTF-8 encoded string of type\r
3352 CPUID_SOC_VENDOR_BRAND_STRING_DATA.\r
3353 @retval EDX SOC Vendor Brand String. UTF-8 encoded string of type\r
3354 CPUID_SOC_VENDOR_BRAND_STRING_DATA.\r
3355\r
3356 <b>Example usage</b>\r
3357 @code\r
3358 CPUID_SOC_VENDOR_BRAND_STRING_DATA Eax;\r
3359 CPUID_SOC_VENDOR_BRAND_STRING_DATA Ebx;\r
3360 CPUID_SOC_VENDOR_BRAND_STRING_DATA Ecx;\r
3361 CPUID_SOC_VENDOR_BRAND_STRING_DATA Edx;\r
3362\r
3363 AsmCpuidEx (\r
3364 CPUID_SOC_VENDOR, CPUID_SOC_VENDOR_BRAND_STRING1,\r
3365 &Eax.Uint32, &Ebx.Uint32, &Ecx.Uint32, &Edx.Uint32\r
3366 );\r
3367 @endcode\r
3368**/\r
3369#define CPUID_SOC_VENDOR_BRAND_STRING1 0x01\r
3370\r
3371/**\r
3372 CPUID SoC Vendor Brand String for CPUID leafs #CPUID_SOC_VENDOR_BRAND_STRING1,\r
3373 #CPUID_SOC_VENDOR_BRAND_STRING2, and #CPUID_SOC_VENDOR_BRAND_STRING3.\r
3374**/\r
3375typedef union {\r
3376 ///\r
3377 /// 4 UTF-8 characters of Soc Vendor Brand String\r
3378 ///\r
3379 CHAR8 BrandString[4];\r
3380 ///\r
3381 /// All fields as a 32-bit value\r
3382 ///\r
3383 UINT32 Uint32;\r
3384} CPUID_SOC_VENDOR_BRAND_STRING_DATA;\r
3385\r
3386/**\r
3387 CPUID SoC Vendor Information\r
3388\r
3389 @param EAX CPUID_SOC_VENDOR (0x17)\r
3390 @param ECX CPUID_SOC_VENDOR_BRAND_STRING2 (0x02)\r
3391\r
3392 @retval EAX SOC Vendor Brand String. UTF-8 encoded string of type\r
3393 CPUID_SOC_VENDOR_BRAND_STRING_DATA.\r
3394 @retval EBX SOC Vendor Brand String. UTF-8 encoded string of type\r
3395 CPUID_SOC_VENDOR_BRAND_STRING_DATA.\r
3396 @retval ECX SOC Vendor Brand String. UTF-8 encoded string of type\r
3397 CPUID_SOC_VENDOR_BRAND_STRING_DATA.\r
3398 @retval EDX SOC Vendor Brand String. UTF-8 encoded string of type\r
3399 CPUID_SOC_VENDOR_BRAND_STRING_DATA.\r
3400\r
3401 <b>Example usage</b>\r
3402 @code\r
3403 CPUID_SOC_VENDOR_BRAND_STRING_DATA Eax;\r
3404 CPUID_SOC_VENDOR_BRAND_STRING_DATA Ebx;\r
3405 CPUID_SOC_VENDOR_BRAND_STRING_DATA Ecx;\r
3406 CPUID_SOC_VENDOR_BRAND_STRING_DATA Edx;\r
3407\r
3408 AsmCpuidEx (\r
3409 CPUID_SOC_VENDOR, CPUID_SOC_VENDOR_BRAND_STRING2,\r
3410 &Eax.Uint32, &Ebx.Uint32, &Ecx.Uint32, &Edx.Uint32\r
3411 );\r
3412 @endcode\r
3413**/\r
3414#define CPUID_SOC_VENDOR_BRAND_STRING2 0x02\r
3415\r
3416/**\r
3417 CPUID SoC Vendor Information\r
3418\r
3419 @param EAX CPUID_SOC_VENDOR (0x17)\r
3420 @param ECX CPUID_SOC_VENDOR_BRAND_STRING3 (0x03)\r
28a7ddf0 3421\r
57d16ba1
MK
3422 @retval EAX SOC Vendor Brand String. UTF-8 encoded string of type\r
3423 CPUID_SOC_VENDOR_BRAND_STRING_DATA.\r
3424 @retval EBX SOC Vendor Brand String. UTF-8 encoded string of type\r
3425 CPUID_SOC_VENDOR_BRAND_STRING_DATA.\r
3426 @retval ECX SOC Vendor Brand String. UTF-8 encoded string of type\r
3427 CPUID_SOC_VENDOR_BRAND_STRING_DATA.\r
3428 @retval EDX SOC Vendor Brand String. UTF-8 encoded string of type\r
3429 CPUID_SOC_VENDOR_BRAND_STRING_DATA.\r
3430\r
3431 <b>Example usage</b>\r
3432 @code\r
3433 CPUID_SOC_VENDOR_BRAND_STRING_DATA Eax;\r
3434 CPUID_SOC_VENDOR_BRAND_STRING_DATA Ebx;\r
3435 CPUID_SOC_VENDOR_BRAND_STRING_DATA Ecx;\r
3436 CPUID_SOC_VENDOR_BRAND_STRING_DATA Edx;\r
3437\r
3438 AsmCpuidEx (\r
3439 CPUID_SOC_VENDOR, CPUID_SOC_VENDOR_BRAND_STRING3,\r
3440 &Eax.Uint32, &Ebx.Uint32, &Ecx.Uint32, &Edx.Uint32\r
3441 );\r
3442 @endcode\r
3443**/\r
3444#define CPUID_SOC_VENDOR_BRAND_STRING3 0x03\r
4de216c0 3445\r
ee27f6ee
ED
3446/**\r
3447 CPUID Deterministic Address Translation Parameters\r
3448\r
3449 @note\r
3450 Each sub-leaf enumerates a different address translation structure.\r
3451 If ECX contains an invalid sub-leaf index, EAX/EBX/ECX/EDX return 0. Sub-leaf\r
3452 index n is invalid if n exceeds the value that sub-leaf 0 returns in EAX. A\r
3453 sub-leaf index is also invalid if EDX[4:0] returns 0.\r
3454 Valid sub-leaves do not need to be contiguous or in any particular order. A\r
3455 valid sub-leaf may be in a higher input ECX value than an invalid sub-leaf or\r
3456 than a valid sub-leaf of a higher or lower-level structure.\r
3457 * Some unified TLBs will allow a single TLB entry to satisfy data read/write\r
3458 and instruction fetches. Others will require separate entries (e.g., one\r
3459 loaded on data read/write and another loaded on an instruction fetch).\r
3460 Please see the Intel 64 and IA-32 Architectures Optimization Reference Manual\r
3461 for details of a particular product.\r
3462 ** Add one to the return value to get the result.\r
3463\r
3464 @param EAX CPUID_DETERMINISTIC_ADDRESS_TRANSLATION_PARAMETERS (0x18)\r
3465 @param ECX CPUID_DETERMINISTIC_ADDRESS_TRANSLATION_PARAMETERS_MAIN_LEAF (0x00)\r
3466 CPUID_DETERMINISTIC_ADDRESS_TRANSLATION_PARAMETERS_SUB_LEAF (0x*)\r
3467\r
3468**/\r
3469#define CPUID_DETERMINISTIC_ADDRESS_TRANSLATION_PARAMETERS 0x18\r
3470\r
3471/**\r
3472 CPUID Deterministic Address Translation Parameters\r
3473\r
3474 @param EAX CPUID_DETERMINISTIC_ADDRESS_TRANSLATION_PARAMETERS (0x18)\r
3475 @param ECX CPUID_DETERMINISTIC_ADDRESS_TRANSLATION_PARAMETERS_MAIN_LEAF (0x00)\r
3476\r
3477 @retval EAX Reports the maximum input value of supported sub-leaf in leaf 18H.\r
3478 @retval EBX Returns Deterministic Address Translation Parameters described by\r
3479 the type CPUID_DETERMINISTIC_ADDRESS_TRANSLATION_PARAMETERS_EBX.\r
3480 @retval ECX Number of Sets.\r
3481 @retval EDX Returns Deterministic Address Translation Parameters described by\r
3482 the type CPUID_DETERMINISTIC_ADDRESS_TRANSLATION_PARAMETERS_EDX.\r
3483\r
3484 <b>Example usage</b>\r
3485 @code\r
3486 UINT32 Eax;\r
3487 CPUID_DETERMINISTIC_ADDRESS_TRANSLATION_PARAMETERS_EBX Ebx;\r
3488 UINT32 Ecx;\r
3489 CPUID_DETERMINISTIC_ADDRESS_TRANSLATION_PARAMETERS_EDX Edx;\r
3490\r
3491 AsmCpuidEx (\r
3492 CPUID_DETERMINISTIC_ADDRESS_TRANSLATION_PARAMETERS,\r
3493 CPUID_DETERMINISTIC_ADDRESS_TRANSLATION_PARAMETERS_MAIN_LEAF,\r
3494 &Eax, &Ebx.Uint32, &Ecx, &Edx.Uint32\r
3495 );\r
3496 @endcode\r
3497**/\r
3498#define CPUID_DETERMINISTIC_ADDRESS_TRANSLATION_PARAMETERS_MAIN_LEAF 0x00\r
3499\r
3500/**\r
3501 CPUID Deterministic Address Translation Parameters EBX for CPUID leafs.\r
3502**/\r
3503typedef union {\r
3504 ///\r
3505 /// Individual bit fields\r
3506 ///\r
3507 struct {\r
3508 ///\r
3509 /// [Bits 0] 4K page size entries supported by this structure.\r
3510 ///\r
3511 UINT32 Page4K:1;\r
3512 ///\r
3513 /// [Bits 1] 2MB page size entries supported by this structure.\r
3514 ///\r
3515 UINT32 Page2M:1;\r
3516 ///\r
3517 /// [Bits 2] 4MB page size entries supported by this structure.\r
3518 ///\r
3519 UINT32 Page4M:1;\r
3520 ///\r
3521 /// [Bits 3] 1 GB page size entries supported by this structure.\r
3522 ///\r
3523 UINT32 Page1G:1;\r
3524 ///\r
3525 /// [Bits 7:4] Reserved.\r
3526 ///\r
3527 UINT32 Reserved1:4;\r
3528 ///\r
3529 /// [Bits 10:8] Partitioning (0: Soft partitioning between the logical\r
3530 /// processors sharing this structure)\r
3531 ///\r
3532 UINT32 Partitioning:3;\r
3533 ///\r
3534 /// [Bits 15:11] Reserved.\r
3535 ///\r
3536 UINT32 Reserved2:5;\r
3537 ///\r
3538 /// [Bits 31:16] W = Ways of associativity.\r
3539 ///\r
3540 UINT32 Way:16;\r
3541 } Bits;\r
3542 ///\r
3543 /// All bit fields as a 32-bit value\r
3544 ///\r
3545 UINT32 Uint32;\r
3546} CPUID_DETERMINISTIC_ADDRESS_TRANSLATION_PARAMETERS_EBX;\r
3547\r
3548/**\r
3549 CPUID Deterministic Address Translation Parameters EDX for CPUID leafs.\r
3550**/\r
3551typedef union {\r
3552 ///\r
3553 /// Individual bit fields\r
3554 ///\r
3555 struct {\r
3556 ///\r
3557 /// [Bits 4:0] Translation cache type field.\r
3558 ///\r
3559 UINT32 TranslationCacheType:5;\r
3560 ///\r
3561 /// [Bits 7:5] Translation cache level (starts at 1).\r
3562 ///\r
3563 UINT32 TranslationCacheLevel:3;\r
3564 ///\r
3565 /// [Bits 8] Fully associative structure.\r
3566 ///\r
3567 UINT32 FullyAssociative:1;\r
3568 ///\r
3569 /// [Bits 13:9] Reserved.\r
3570 ///\r
3571 UINT32 Reserved1:5;\r
3572 ///\r
3573 /// [Bits 25:14] Maximum number of addressable IDs for logical\r
3574 /// processors sharing this translation cache.\r
3575 ///\r
3576 UINT32 MaximumNum:12;\r
3577 ///\r
3578 /// [Bits 31:26] Reserved.\r
3579 ///\r
3580 UINT32 Reserved2:6;\r
3581 } Bits;\r
3582 ///\r
3583 /// All bit fields as a 32-bit value\r
3584 ///\r
3585 UINT32 Uint32;\r
3586} CPUID_DETERMINISTIC_ADDRESS_TRANSLATION_PARAMETERS_EDX;\r
3587\r
3588///\r
3589/// @{ Define value for CPUID_DETERMINISTIC_ADDRESS_TRANSLATION_PARAMETERS_EDX.TranslationCacheType\r
3590///\r
3591#define CPUID_DETERMINISTIC_ADDRESS_TRANSLATION_PARAMETERS_TRANSLATION_CACHE_TYPE_INVALID 0x00\r
3592#define CPUID_DETERMINISTIC_ADDRESS_TRANSLATION_PARAMETERS_TRANSLATION_CACHE_TYPE_DATA_TLB 0x01\r
3593#define CPUID_DETERMINISTIC_ADDRESS_TRANSLATION_PARAMETERS_TRANSLATION_CACHE_TYPE_INSTRUCTION_TLB 0x02\r
3594#define CPUID_DETERMINISTIC_ADDRESS_TRANSLATION_PARAMETERS_TRANSLATION_CACHE_TYPE_UNIFIED_TLB 0x03\r
3595///\r
3596/// @}\r
3597///\r
3598\r
3599\r
3600/**\r
3601 CPUID V2 Extended Topology Enumeration Leaf\r
3602\r
3603 @note\r
3604 CPUID leaf 1FH is a preferred superset to leaf 0BH. Intel recommends first checking\r
3605 for the existence of Leaf 1FH and using this if available.\r
3606 Most of Leaf 1FH output depends on the initial value in ECX. The EDX output of leaf\r
3607 1FH is always valid and does not vary with input value in ECX. Output value in ECX[7:0]\r
3608 always equals input value in ECX[7:0]. Sub-leaf index 0 enumerates SMT level. Each\r
3609 subsequent higher sub-leaf index enumerates a higher-level topological entity in\r
3610 hierarchical order. For sub-leaves that return an invalid level-type of 0 in ECX[15:8];\r
3611 EAX and EBX will return 0. If an input value n in ECX returns the invalid level-type of\r
3612 0 in ECX[15:8], other input values with ECX > n also return 0 in ECX[15:8].\r
3613\r
3614 Software should use this field (EAX[4:0]) to enumerate processor topology of the system.\r
3615 Software must not use EBX[15:0] to enumerate processor topology of the system. This value\r
3616 in this field (EBX[15:0]) is only intended for display/diagnostic purposes. The actual\r
3617 number of logical processors available to BIOS/OS/Applications may be different from the\r
3618 value of EBX[15:0], depending on software and platform hardware configurations.\r
3619\r
516e3397
RN
3620 @param EAX CPUID_V2_EXTENDED_TOPOLOGY (0x1F)\r
3621 @param ECX Level number\r
ee27f6ee 3622\r
ee27f6ee 3623**/\r
516e3397 3624#define CPUID_V2_EXTENDED_TOPOLOGY 0x1F\r
ee27f6ee
ED
3625\r
3626///\r
516e3397 3627/// @{ Define value for CPUID_EXTENDED_TOPOLOGY_ECX.LevelType\r
ee27f6ee
ED
3628/// The value of the "level type" field is not related to level numbers in\r
3629/// any way, higher "level type" values do not mean higher levels.\r
3630///\r
516e3397
RN
3631#define CPUID_V2_EXTENDED_TOPOLOGY_LEVEL_TYPE_MODULE 0x03\r
3632#define CPUID_V2_EXTENDED_TOPOLOGY_LEVEL_TYPE_TILE 0x04\r
3633#define CPUID_V2_EXTENDED_TOPOLOGY_LEVEL_TYPE_DIE 0x05\r
ee27f6ee
ED
3634///\r
3635/// @}\r
3636///\r
28a7ddf0 3637\r
57d16ba1
MK
3638/**\r
3639 CPUID Extended Function\r
3640\r
3641 @param EAX CPUID_EXTENDED_FUNCTION (0x80000000)\r
3642\r
3643 @retval EAX Maximum Input Value for Extended Function CPUID Information.\r
3644 @retval EBX Reserved.\r
3645 @retval ECX Reserved.\r
3646 @retval EDX Reserved.\r
3647\r
3648 <b>Example usage</b>\r
3649 @code\r
3650 UINT32 Eax;\r
3651\r
3652 AsmCpuid (CPUID_EXTENDED_FUNCTION, &Eax, NULL, NULL, NULL);\r
3653 @endcode\r
3654**/\r
28a7ddf0
MK
3655#define CPUID_EXTENDED_FUNCTION 0x80000000\r
3656\r
57d16ba1
MK
3657\r
3658/**\r
3659 CPUID Extended Processor Signature and Feature Bits\r
3660\r
3661 @param EAX CPUID_EXTENDED_CPU_SIG (0x80000001)\r
3662\r
3663 @retval EAX CPUID_EXTENDED_CPU_SIG.\r
3664 @retval EBX Reserved.\r
3665 @retval ECX Extended Processor Signature and Feature Bits information\r
3666 described by the type CPUID_EXTENDED_CPU_SIG_ECX.\r
3667 @retval EDX Extended Processor Signature and Feature Bits information\r
3668 described by the type CPUID_EXTENDED_CPU_SIG_EDX.\r
3669\r
3670 <b>Example usage</b>\r
3671 @code\r
3672 UINT32 Eax;\r
3673 CPUID_EXTENDED_CPU_SIG_ECX Ecx;\r
3674 CPUID_EXTENDED_CPU_SIG_EDX Edx;\r
3675\r
3676 AsmCpuid (CPUID_EXTENDED_CPU_SIG, &Eax, NULL, &Ecx.Uint32, &Edx.Uint32);\r
3677 @endcode\r
3678**/\r
28a7ddf0
MK
3679#define CPUID_EXTENDED_CPU_SIG 0x80000001\r
3680\r
57d16ba1
MK
3681/**\r
3682 CPUID Extended Processor Signature and Feature Bits ECX for CPUID leaf\r
3683 #CPUID_EXTENDED_CPU_SIG.\r
3684**/\r
3685typedef union {\r
3686 ///\r
3687 /// Individual bit fields\r
3688 ///\r
3689 struct {\r
3690 ///\r
3691 /// [Bit 0] LAHF/SAHF available in 64-bit mode.\r
3692 ///\r
3693 UINT32 LAHF_SAHF:1;\r
3694 UINT32 Reserved1:4;\r
3695 ///\r
3696 /// [Bit 5] LZCNT.\r
3697 ///\r
3698 UINT32 LZCNT:1;\r
3699 UINT32 Reserved2:2;\r
3700 ///\r
3701 /// [Bit 8] PREFETCHW.\r
3702 ///\r
3703 UINT32 PREFETCHW:1;\r
3704 UINT32 Reserved3:23;\r
3705 } Bits;\r
3706 ///\r
3707 /// All bit fields as a 32-bit value\r
3708 ///\r
3709 UINT32 Uint32;\r
3710} CPUID_EXTENDED_CPU_SIG_ECX;\r
3711\r
3712/**\r
3713 CPUID Extended Processor Signature and Feature Bits EDX for CPUID leaf\r
3714 #CPUID_EXTENDED_CPU_SIG.\r
3715**/\r
3716typedef union {\r
3717 ///\r
3718 /// Individual bit fields\r
3719 ///\r
3720 struct {\r
3721 UINT32 Reserved1:11;\r
3722 ///\r
3723 /// [Bit 11] SYSCALL/SYSRET available in 64-bit mode.\r
3724 ///\r
3725 UINT32 SYSCALL_SYSRET:1;\r
3726 UINT32 Reserved2:8;\r
3727 ///\r
3728 /// [Bit 20] Execute Disable Bit available.\r
3729 ///\r
3730 UINT32 NX:1;\r
3731 UINT32 Reserved3:5;\r
3732 ///\r
3733 /// [Bit 26] 1-GByte pages are available if 1.\r
3734 ///\r
3735 UINT32 Page1GB:1;\r
3736 ///\r
3737 /// [Bit 27] RDTSCP and IA32_TSC_AUX are available if 1.\r
3738 ///\r
3739 UINT32 RDTSCP:1;\r
3740 UINT32 Reserved4:1;\r
3741 ///\r
3742 /// [Bit 29] Intel(R) 64 Architecture available if 1.\r
3743 ///\r
3744 UINT32 LM:1;\r
3745 UINT32 Reserved5:2;\r
3746 } Bits;\r
3747 ///\r
3748 /// All bit fields as a 32-bit value\r
3749 ///\r
3750 UINT32 Uint32;\r
3751} CPUID_EXTENDED_CPU_SIG_EDX;\r
3752\r
3753\r
3754/**\r
3755 CPUID Processor Brand String\r
3756\r
3757 @param EAX CPUID_BRAND_STRING1 (0x80000002)\r
3758\r
3759 @retval EAX Processor Brand String in type CPUID_BRAND_STRING_DATA.\r
3760 @retval EBX Processor Brand String Continued in type CPUID_BRAND_STRING_DATA.\r
3761 @retval ECX Processor Brand String Continued in type CPUID_BRAND_STRING_DATA.\r
3762 @retval EDX Processor Brand String Continued in type CPUID_BRAND_STRING_DATA.\r
3763\r
3764 <b>Example usage</b>\r
3765 @code\r
3766 CPUID_BRAND_STRING_DATA Eax;\r
3767 CPUID_BRAND_STRING_DATA Ebx;\r
3768 CPUID_BRAND_STRING_DATA Ecx;\r
3769 CPUID_BRAND_STRING_DATA Edx;\r
3770\r
3771 AsmCpuid (CPUID_BRAND_STRING1, &Eax.Uint32, &Ebx.Uint32, &Ecx.Uint32, &Edx.Uint32);\r
3772 @endcode\r
3773**/\r
28a7ddf0
MK
3774#define CPUID_BRAND_STRING1 0x80000002\r
3775\r
57d16ba1
MK
3776/**\r
3777 CPUID Processor Brand String for CPUID leafs #CPUID_BRAND_STRING1,\r
3778 #CPUID_BRAND_STRING2, and #CPUID_BRAND_STRING3.\r
3779**/\r
3780typedef union {\r
3781 ///\r
3782 /// 4 ASCII characters of Processor Brand String\r
3783 ///\r
3784 CHAR8 BrandString[4];\r
3785 ///\r
3786 /// All fields as a 32-bit value\r
3787 ///\r
3788 UINT32 Uint32;\r
3789} CPUID_BRAND_STRING_DATA;\r
3790\r
3791/**\r
3792 CPUID Processor Brand String\r
3793\r
3794 @param EAX CPUID_BRAND_STRING2 (0x80000003)\r
3795\r
3796 @retval EAX Processor Brand String Continued in type CPUID_BRAND_STRING_DATA.\r
3797 @retval EBX Processor Brand String Continued in type CPUID_BRAND_STRING_DATA.\r
3798 @retval ECX Processor Brand String Continued in type CPUID_BRAND_STRING_DATA.\r
3799 @retval EDX Processor Brand String Continued in type CPUID_BRAND_STRING_DATA.\r
3800\r
3801 <b>Example usage</b>\r
3802 @code\r
3803 CPUID_BRAND_STRING_DATA Eax;\r
3804 CPUID_BRAND_STRING_DATA Ebx;\r
3805 CPUID_BRAND_STRING_DATA Ecx;\r
3806 CPUID_BRAND_STRING_DATA Edx;\r
3807\r
3808 AsmCpuid (CPUID_BRAND_STRING2, &Eax.Uint32, &Ebx.Uint32, &Ecx.Uint32, &Edx.Uint32);\r
3809 @endcode\r
3810**/\r
28a7ddf0
MK
3811#define CPUID_BRAND_STRING2 0x80000003\r
3812\r
57d16ba1
MK
3813/**\r
3814 CPUID Processor Brand String\r
3815\r
3816 @param EAX CPUID_BRAND_STRING3 (0x80000004)\r
3817\r
3818 @retval EAX Processor Brand String Continued in type CPUID_BRAND_STRING_DATA.\r
3819 @retval EBX Processor Brand String Continued in type CPUID_BRAND_STRING_DATA.\r
3820 @retval ECX Processor Brand String Continued in type CPUID_BRAND_STRING_DATA.\r
3821 @retval EDX Processor Brand String Continued in type CPUID_BRAND_STRING_DATA.\r
3822\r
3823 <b>Example usage</b>\r
3824 @code\r
3825 CPUID_BRAND_STRING_DATA Eax;\r
3826 CPUID_BRAND_STRING_DATA Ebx;\r
3827 CPUID_BRAND_STRING_DATA Ecx;\r
3828 CPUID_BRAND_STRING_DATA Edx;\r
3829\r
3830 AsmCpuid (CPUID_BRAND_STRING3, &Eax.Uint32, &Ebx.Uint32, &Ecx.Uint32, &Edx.Uint32);\r
3831 @endcode\r
3832**/\r
28a7ddf0
MK
3833#define CPUID_BRAND_STRING3 0x80000004\r
3834\r
57d16ba1
MK
3835\r
3836/**\r
3837 CPUID Extended Cache information\r
3838\r
3839 @param EAX CPUID_EXTENDED_CACHE_INFO (0x80000006)\r
3840\r
3841 @retval EAX Reserved.\r
3842 @retval EBX Reserved.\r
3843 @retval ECX Extended cache information described by the type\r
3844 CPUID_EXTENDED_CACHE_INFO_ECX.\r
3845 @retval EDX Reserved.\r
3846\r
3847 <b>Example usage</b>\r
3848 @code\r
3849 CPUID_EXTENDED_CACHE_INFO_ECX Ecx;\r
3850\r
3851 AsmCpuid (CPUID_EXTENDED_CACHE_INFO, NULL, NULL, &Ecx.Uint32, NULL);\r
3852 @endcode\r
3853**/\r
3854#define CPUID_EXTENDED_CACHE_INFO 0x80000006\r
3855\r
3856/**\r
3857 CPUID Extended Cache information ECX for CPUID leaf #CPUID_EXTENDED_CACHE_INFO.\r
3858**/\r
3859typedef union {\r
3860 ///\r
3861 /// Individual bit fields\r
3862 ///\r
3863 struct {\r
3864 ///\r
3865 /// [Bits 7:0] Cache line size in bytes.\r
3866 ///\r
3867 UINT32 CacheLineSize:8;\r
3868 UINT32 Reserved:4;\r
3869 ///\r
3870 /// [Bits 15:12] L2 Associativity field. Supported values are in the range\r
3871 /// #CPUID_EXTENDED_CACHE_INFO_ECX_L2_ASSOCIATIVITY_DISABLED to\r
3872 /// #CPUID_EXTENDED_CACHE_INFO_ECX_L2_ASSOCIATIVITY_FULL\r
3873 ///\r
3874 UINT32 L2Associativity:4;\r
3875 ///\r
3876 /// [Bits 31:16] Cache size in 1K units.\r
3877 ///\r
3878 UINT32 CacheSize:16;\r
3879 } Bits;\r
3880 ///\r
3881 /// All bit fields as a 32-bit value\r
3882 ///\r
3883 UINT32 Uint32;\r
3884} CPUID_EXTENDED_CACHE_INFO_ECX;\r
3885\r
3886///\r
3887/// @{ Define value for bit field CPUID_EXTENDED_CACHE_INFO_ECX.L2Associativity\r
3888///\r
3889#define CPUID_EXTENDED_CACHE_INFO_ECX_L2_ASSOCIATIVITY_DISABLED 0x00\r
3890#define CPUID_EXTENDED_CACHE_INFO_ECX_L2_ASSOCIATIVITY_DIRECT_MAPPED 0x01\r
3891#define CPUID_EXTENDED_CACHE_INFO_ECX_L2_ASSOCIATIVITY_2_WAY 0x02\r
3892#define CPUID_EXTENDED_CACHE_INFO_ECX_L2_ASSOCIATIVITY_4_WAY 0x04\r
3893#define CPUID_EXTENDED_CACHE_INFO_ECX_L2_ASSOCIATIVITY_8_WAY 0x06\r
3894#define CPUID_EXTENDED_CACHE_INFO_ECX_L2_ASSOCIATIVITY_16_WAY 0x08\r
ee27f6ee
ED
3895#define CPUID_EXTENDED_CACHE_INFO_ECX_L2_ASSOCIATIVITY_32_WAY 0x0A\r
3896#define CPUID_EXTENDED_CACHE_INFO_ECX_L2_ASSOCIATIVITY_48_WAY 0x0B\r
3897#define CPUID_EXTENDED_CACHE_INFO_ECX_L2_ASSOCIATIVITY_64_WAY 0x0C\r
3898#define CPUID_EXTENDED_CACHE_INFO_ECX_L2_ASSOCIATIVITY_96_WAY 0x0D\r
3899#define CPUID_EXTENDED_CACHE_INFO_ECX_L2_ASSOCIATIVITY_128_WAY 0x0E\r
57d16ba1
MK
3900#define CPUID_EXTENDED_CACHE_INFO_ECX_L2_ASSOCIATIVITY_FULL 0x0F\r
3901///\r
3902/// @}\r
3903///\r
3904\r
3905/**\r
3906 CPUID Extended Time Stamp Counter information\r
3907\r
3908 @param EAX CPUID_EXTENDED_TIME_STAMP_COUNTER (0x80000007)\r
3909\r
3910 @retval EAX Reserved.\r
3911 @retval EBX Reserved.\r
3912 @retval ECX Reserved.\r
3913 @retval EDX Extended time stamp counter (TSC) information described by the\r
3914 type CPUID_EXTENDED_TIME_STAMP_COUNTER_EDX.\r
3915\r
3916 <b>Example usage</b>\r
3917 @code\r
3918 CPUID_EXTENDED_TIME_STAMP_COUNTER_EDX Edx;\r
3919\r
3920 AsmCpuid (CPUID_EXTENDED_TIME_STAMP_COUNTER, NULL, NULL, NULL, &Edx.Uint32);\r
3921 @endcode\r
3922**/\r
3923#define CPUID_EXTENDED_TIME_STAMP_COUNTER 0x80000007\r
3924\r
3925/**\r
3926 CPUID Extended Time Stamp Counter information EDX for CPUID leaf\r
3927 #CPUID_EXTENDED_TIME_STAMP_COUNTER.\r
3928**/\r
3929typedef union {\r
3930 ///\r
3931 /// Individual bit fields\r
3932 ///\r
3933 struct {\r
3934 UINT32 Reserved1:8;\r
3935 ///\r
3936 /// [Bit 8] Invariant TSC available if 1.\r
3937 ///\r
3938 UINT32 InvariantTsc:1;\r
3939 UINT32 Reserved2:23;\r
3940 } Bits;\r
3941 ///\r
3942 /// All bit fields as a 32-bit value\r
3943 ///\r
3944 UINT32 Uint32;\r
3945} CPUID_EXTENDED_TIME_STAMP_COUNTER_EDX;\r
3946\r
3947\r
3948/**\r
3949 CPUID Linear Physical Address Size\r
3950\r
3951 @param EAX CPUID_VIR_PHY_ADDRESS_SIZE (0x80000008)\r
3952\r
3953 @retval EAX Linear/Physical Address Size described by the type\r
3954 CPUID_VIR_PHY_ADDRESS_SIZE_EAX.\r
3955 @retval EBX Reserved.\r
3956 @retval ECX Reserved.\r
3957 @retval EDX Reserved.\r
3958\r
3959 <b>Example usage</b>\r
3960 @code\r
3961 CPUID_VIR_PHY_ADDRESS_SIZE_EAX Eax;\r
3962\r
3963 AsmCpuid (CPUID_VIR_PHY_ADDRESS_SIZE, &Eax.Uint32, NULL, NULL, NULL);\r
3964 @endcode\r
3965**/\r
28a7ddf0
MK
3966#define CPUID_VIR_PHY_ADDRESS_SIZE 0x80000008\r
3967\r
57d16ba1
MK
3968/**\r
3969 CPUID Linear Physical Address Size EAX for CPUID leaf\r
3970 #CPUID_VIR_PHY_ADDRESS_SIZE.\r
3971**/\r
3972typedef union {\r
3973 ///\r
3974 /// Individual bit fields\r
3975 ///\r
3976 struct {\r
3977 ///\r
3978 /// [Bits 7:0] Number of physical address bits.\r
3979 ///\r
3980 /// @note\r
3981 /// If CPUID.80000008H:EAX[7:0] is supported, the maximum physical address\r
3982 /// number supported should come from this field.\r
3983 ///\r
3984 UINT32 PhysicalAddressBits:8;\r
3985 ///\r
3986 /// [Bits 15:8] Number of linear address bits.\r
3987 ///\r
3988 UINT32 LinearAddressBits:8;\r
3989 UINT32 Reserved:16;\r
3990 } Bits;\r
3991 ///\r
3992 /// All bit fields as a 32-bit value\r
3993 ///\r
3994 UINT32 Uint32;\r
3995} CPUID_VIR_PHY_ADDRESS_SIZE_EAX;\r
3996\r
28a7ddf0 3997#endif\r