2 CPUID leaf definitions.
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.
9 Copyright (c) 2017, Advanced Micro Devices. All rights reserved.<BR>
11 SPDX-License-Identifier: BSD-2-Clause-Patent
13 @par Specification Reference:
14 AMD64 Architecture Programming Manual volume 2, March 2017, Sections 15.34
18 #ifndef __AMD_CPUID_H__
19 #define __AMD_CPUID_H__
22 CPUID Signature Information
24 @param EAX CPUID_SIGNATURE (0x00)
26 @retval EAX Returns the highest value the CPUID instruction recognizes for
27 returning basic processor information. The value is returned is
29 @retval EBX First 4 characters of a vendor identification string.
30 @retval ECX Last 4 characters of a vendor identification string.
31 @retval EDX Middle 4 characters of a vendor identification string.
36 /// @{ CPUID signature values returned by AMD processors
38 #define CPUID_SIGNATURE_AUTHENTIC_AMD_EBX SIGNATURE_32 ('A', 'u', 't', 'h')
39 #define CPUID_SIGNATURE_AUTHENTIC_AMD_EDX SIGNATURE_32 ('e', 'n', 't', 'i')
40 #define CPUID_SIGNATURE_AUTHENTIC_AMD_ECX SIGNATURE_32 ('c', 'A', 'M', 'D')
47 CPUID Extended Processor Signature and Features
49 @param EAX CPUID_EXTENDED_CPU_SIG (0x80000001)
51 @retval EAX Extended Family, Model, Stepping Identifiers
52 described by the type CPUID_AMD_EXTENDED_CPU_SIG_EAX.
53 @retval EBX Brand Identifier
54 described by the type CPUID_AMD_EXTENDED_CPU_SIG_EBX.
55 @retval ECX Extended Feature Identifiers
56 described by the type CPUID_AMD_EXTENDED_CPU_SIG_ECX.
57 @retval EDX Extended Feature Identifiers
58 described by the type CPUID_AMD_EXTENDED_CPU_SIG_EDX.
62 CPUID Extended Processor Signature and Features EAX for CPUID leaf
63 #CPUID_EXTENDED_CPU_SIG.
67 /// Individual bit fields
71 /// [Bits 3:0] Stepping.
75 /// [Bits 7:4] Base Model.
79 /// [Bits 11:8] Base Family.
83 /// [Bit 15:12] Reserved.
87 /// [Bits 19:16] Extended Model.
91 /// [Bits 27:20] Extended Family.
95 /// [Bit 31:28] Reserved.
100 /// All bit fields as a 32-bit value
103 } CPUID_AMD_EXTENDED_CPU_SIG_EAX
;
106 CPUID Extended Processor Signature and Features EBX for CPUID leaf
107 #CPUID_EXTENDED_CPU_SIG.
111 /// Individual bit fields
115 /// [Bits 27:0] Reserved.
119 /// [Bit 31:28] Package Type.
124 /// All bit fields as a 32-bit value
127 } CPUID_AMD_EXTENDED_CPU_SIG_EBX
;
130 CPUID Extended Processor Signature and Features ECX for CPUID leaf
131 #CPUID_EXTENDED_CPU_SIG.
135 /// Individual bit fields
139 /// [Bit 0] LAHF/SAHF available in 64-bit mode.
143 /// [Bit 1] Core multi-processing legacy mode.
147 /// [Bit 2] Secure Virtual Mode feature.
151 /// [Bit 3] Extended APIC register space.
153 UINT32 ExtApicSpace
:1;
155 /// [Bit 4] LOCK MOV CR0 means MOV CR8.
159 /// [Bit 5] LZCNT instruction support.
163 /// [Bit 6] SSE4A instruction support.
167 /// [Bit 7] Misaligned SSE Mode.
169 UINT32 MisAlignSse
:1;
171 /// [Bit 8] ThreeDNow Prefetch instructions.
175 /// [Bit 9] OS Visible Work-around support.
179 /// [Bit 10] Instruction Based Sampling.
183 /// [Bit 11] Extended Operation Support.
187 /// [Bit 12] SKINIT and STGI support.
191 /// [Bit 13] Watchdog Timer support.
195 /// [Bit 14] Reserved.
199 /// [Bit 15] Lightweight Profiling support.
203 /// [Bit 16] 4-Operand FMA instruction support.
207 /// [Bit 17] Translation Cache Extension.
211 /// [Bit 21:18] Reserved.
215 /// [Bit 22] Topology Extensions support.
217 UINT32 TopologyExtensions
:1;
219 /// [Bit 23] Core Performance Counter Extensions.
221 UINT32 PerfCtrExtCore
:1;
223 /// [Bit 25:24] Reserved.
227 /// [Bit 26] Data Breakpoint Extension.
229 UINT32 DataBreakpointExtension
:1;
231 /// [Bit 27] Performance Time-Stamp Counter.
235 /// [Bit 28] L3 Performance Counter Extensions.
237 UINT32 PerfCtrExtL3
:1;
239 /// [Bit 29] MWAITX and MONITORX capability.
241 UINT32 MwaitExtended
:1;
243 /// [Bit 31:30] Reserved.
248 /// All bit fields as a 32-bit value
251 } CPUID_AMD_EXTENDED_CPU_SIG_ECX
;
254 CPUID Extended Processor Signature and Features EDX for CPUID leaf
255 #CPUID_EXTENDED_CPU_SIG.
259 /// Individual bit fields
263 /// [Bit 0] x87 floating point unit on-chip.
267 /// [Bit 1] Virtual-mode enhancements.
271 /// [Bit 2] Debugging extensions, IO breakpoints, CR4.DE.
275 /// [Bit 3] Page-size extensions (4 MB pages).
279 /// [Bit 4] Time stamp counter, RDTSC/RDTSCP instructions, CR4.TSD.
283 /// [Bit 5] MSRs, with RDMSR and WRMSR instructions.
287 /// [Bit 6] Physical-address extensions (PAE).
291 /// [Bit 7] Machine check exception, CR4.MCE.
295 /// [Bit 8] CMPXCHG8B instruction.
299 /// [Bit 9] APIC exists and is enabled.
303 /// [Bit 10] Reserved.
307 /// [Bit 11] SYSCALL and SYSRET instructions.
309 UINT32 SYSCALL_SYSRET
:1;
311 /// [Bit 12] Memory-type range registers.
315 /// [Bit 13] Page global extension, CR4.PGE.
319 /// [Bit 14] Machine check architecture, MCG_CAP.
323 /// [Bit 15] Conditional move instructions, CMOV, FCOMI, FCMOV.
327 /// [Bit 16] Page attribute table.
331 /// [Bit 17] Page-size extensions.
335 /// [Bit 19:18] Reserved.
339 /// [Bit 20] No-execute page protection.
343 /// [Bit 21] Reserved.
347 /// [Bit 22] AMD Extensions to MMX instructions.
351 /// [Bit 23] MMX instructions.
355 /// [Bit 24] FXSAVE and FXRSTOR instructions.
359 /// [Bit 25] FXSAVE and FXRSTOR instruction optimizations.
363 /// [Bit 26] 1-GByte large page support.
367 /// [Bit 27] RDTSCP instructions.
371 /// [Bit 28] Reserved.
375 /// [Bit 29] Long Mode.
379 /// [Bit 30] 3DNow! instructions.
383 /// [Bit 31] AMD Extensions to 3DNow! instructions.
385 UINT32 ThreeDNowExt
:1;
388 /// All bit fields as a 32-bit value
391 } CPUID_AMD_EXTENDED_CPU_SIG_EDX
;
395 CPUID Linear Physical Address Size
397 @param EAX CPUID_VIR_PHY_ADDRESS_SIZE (0x80000008)
399 @retval EAX Linear/Physical Address Size described by the type
400 CPUID_AMD_VIR_PHY_ADDRESS_SIZE_EAX.
401 @retval EBX Linear/Physical Address Size described by the type
402 CPUID_AMD_VIR_PHY_ADDRESS_SIZE_EBX.
403 @retval ECX Linear/Physical Address Size described by the type
404 CPUID_AMD_VIR_PHY_ADDRESS_SIZE_ECX.
405 @retval EDX Reserved.
409 CPUID Linear Physical Address Size EAX for CPUID leaf
410 #CPUID_VIR_PHY_ADDRESS_SIZE.
414 /// Individual bit fields
418 /// [Bits 7:0] Maximum physical byte address size in bits.
420 UINT32 PhysicalAddressBits
:8;
422 /// [Bits 15:8] Maximum linear byte address size in bits.
424 UINT32 LinearAddressBits
:8;
426 /// [Bits 23:16] Maximum guest physical byte address size in bits.
428 UINT32 GuestPhysAddrSize
:8;
430 /// [Bit 31:24] Reserved.
435 /// All bit fields as a 32-bit value
438 } CPUID_AMD_VIR_PHY_ADDRESS_SIZE_EAX
;
441 CPUID Linear Physical Address Size EBX for CPUID leaf
442 #CPUID_VIR_PHY_ADDRESS_SIZE.
446 /// Individual bit fields
450 /// [Bits 0] Clear Zero Instruction.
454 /// [Bits 1] Instructions retired count support.
458 /// [Bits 2] Restore error pointers for XSave instructions.
462 /// [Bit 31:3] Reserved.
467 /// All bit fields as a 32-bit value
470 } CPUID_AMD_VIR_PHY_ADDRESS_SIZE_EBX
;
473 CPUID Linear Physical Address Size ECX for CPUID leaf
474 #CPUID_VIR_PHY_ADDRESS_SIZE.
478 /// Individual bit fields
482 /// [Bits 7:0] Number of threads - 1.
486 /// [Bit 11:8] Reserved.
490 /// [Bits 15:12] APIC ID size.
492 UINT32 ApicIdCoreIdSize
:4;
494 /// [Bits 17:16] Performance time-stamp counter size.
496 UINT32 PerfTscSize
:2;
498 /// [Bit 31:18] Reserved.
503 /// All bit fields as a 32-bit value
506 } CPUID_AMD_VIR_PHY_ADDRESS_SIZE_ECX
;
510 CPUID AMD Processor Topology
512 @param EAX CPUID_AMD_PROCESSOR_TOPOLOGY (0x8000001E)
514 @retval EAX Extended APIC ID described by the type
515 CPUID_AMD_PROCESSOR_TOPOLOGY_EAX.
516 @retval EBX Core Identifiers described by the type
517 CPUID_AMD_PROCESSOR_TOPOLOGY_EBX.
518 @retval ECX Node Identifiers described by the type
519 CPUID_AMD_PROCESSOR_TOPOLOGY_ECX.
520 @retval EDX Reserved.
522 #define CPUID_AMD_PROCESSOR_TOPOLOGY 0x8000001E
525 CPUID AMD Processor Topology EAX for CPUID leaf
526 #CPUID_AMD_PROCESSOR_TOPOLOGY.
530 /// Individual bit fields
534 /// [Bit 31:0] Extended APIC Id.
536 UINT32 ExtendedApicId
;
539 /// All bit fields as a 32-bit value
542 } CPUID_AMD_PROCESSOR_TOPOLOGY_EAX
;
545 CPUID AMD Processor Topology EBX for CPUID leaf
546 #CPUID_AMD_PROCESSOR_TOPOLOGY.
550 /// Individual bit fields
554 /// [Bits 7:0] Core Id.
558 /// [Bits 15:8] Threads per core.
560 UINT32 ThreadsPerCore
:8;
562 /// [Bit 31:16] Reserved.
567 /// All bit fields as a 32-bit value
570 } CPUID_AMD_PROCESSOR_TOPOLOGY_EBX
;
573 CPUID AMD Processor Topology ECX for CPUID leaf
574 #CPUID_AMD_PROCESSOR_TOPOLOGY.
578 /// Individual bit fields
582 /// [Bits 7:0] Node Id.
586 /// [Bits 10:8] Nodes per processor.
588 UINT32 NodesPerProcessor
:3;
590 /// [Bit 31:11] Reserved.
595 /// All bit fields as a 32-bit value
598 } CPUID_AMD_PROCESSOR_TOPOLOGY_ECX
;
602 CPUID Memory Encryption Information
604 @param EAX CPUID_MEMORY_ENCRYPTION_INFO (0x8000001F)
606 @retval EAX Returns the memory encryption feature support status.
607 @retval EBX If memory encryption feature is present then return
608 the page table bit number used to enable memory encryption support
609 and reducing of physical address space in bits.
610 @retval ECX Returns number of encrypted guest supported simultaneously.
611 @retval EDX Returns minimum SEV enabled and SEV disabled ASID.
620 AsmCpuid (CPUID_MEMORY_ENCRYPTION_INFO, &Eax, &Ebx, &Ecx, &Edx);
624 #define CPUID_MEMORY_ENCRYPTION_INFO 0x8000001F
627 CPUID Memory Encryption support information EAX for CPUID leaf
628 #CPUID_MEMORY_ENCRYPTION_INFO.
632 /// Individual bit fields
636 /// [Bit 0] Secure Memory Encryption (Sme) Support
641 /// [Bit 1] Secure Encrypted Virtualization (Sev) Support
646 /// [Bit 2] Page flush MSR support
648 UINT32 PageFlushMsrBit
:1;
651 /// [Bit 3] Encrypted state support
656 /// [Bit 31:4] Reserved
658 UINT32 ReservedBits
:28;
661 /// All bit fields as a 32-bit value
664 } CPUID_MEMORY_ENCRYPTION_INFO_EAX
;
667 CPUID Memory Encryption support information EBX for CPUID leaf
668 #CPUID_MEMORY_ENCRYPTION_INFO.
672 /// Individual bit fields
676 /// [Bit 5:0] Page table bit number used to enable memory encryption
681 /// [Bit 11:6] Reduction of system physical address space bits when
682 /// memory encryption is enabled
684 UINT32 ReducedPhysBits
:5;
687 /// [Bit 31:12] Reserved
689 UINT32 ReservedBits
:21;
692 /// All bit fields as a 32-bit value
695 } CPUID_MEMORY_ENCRYPTION_INFO_EBX
;
698 CPUID Memory Encryption support information ECX for CPUID leaf
699 #CPUID_MEMORY_ENCRYPTION_INFO.
703 /// Individual bit fields
707 /// [Bit 31:0] Number of encrypted guest supported simultaneously
712 /// All bit fields as a 32-bit value
715 } CPUID_MEMORY_ENCRYPTION_INFO_ECX
;
718 CPUID Memory Encryption support information EDX for CPUID leaf
719 #CPUID_MEMORY_ENCRYPTION_INFO.
723 /// Individual bit fields
727 /// [Bit 31:0] Minimum SEV enabled, SEV-ES disabled ASID
732 /// All bit fields as a 32-bit value
735 } CPUID_MEMORY_ENCRYPTION_INFO_EDX
;