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