9#define CPU_FEATURE_FPU 1, 0, d, 0
10#define CPU_FEATURE_VME 1, 0, d, 1
11#define CPU_FEATURE_DE 1, 0, d, 2
12#define CPU_FEATURE_PSE 1, 0, d, 3
13#define CPU_FEATURE_TSC 1, 0, d, 4
14#define CPU_FEATURE_MSR 1, 0, d, 5
15#define CPU_FEATURE_PAE 1, 0, d, 6
16#define CPU_FEATURE_MCE 1, 0, d, 7
17#define CPU_FEATURE_CX8 1, 0, d, 8
18#define CPU_FEATURE_APIC 1, 0, d, 9
19#define CPU_FEATURE_SEP 1, 0, d, 11
20#define CPU_FEATURE_MTRR 1, 0, d, 12
21#define CPU_FEATURE_PGE 1, 0, d, 13
22#define CPU_FEATURE_MCA 1, 0, d, 14
23#define CPU_FEATURE_CMOV 1, 0, d, 15
24#define CPU_FEATURE_PAT 1, 0, d, 16
25#define CPU_FEATURE_PSE36 1, 0, d, 17
26#define CPU_FEATURE_PSN 1, 0, d, 18
27#define CPU_FEATURE_CLFSH 1, 0, d, 19
28#define CPU_FEATURE_DS 1, 0, d, 21
29#define CPU_FEATURE_ACPI 1, 0, d, 22
30#define CPU_FEATURE_MMX 1, 0, d, 23
31#define CPU_FEATURE_FXSR 1, 0, d, 24
32#define CPU_FEATURE_SSE 1, 0, d, 25
33#define CPU_FEATURE_SSE2 1, 0, d, 26
34#define CPU_FEATURE_SS 1, 0, d, 27
35#define CPU_FEATURE_HTT 1, 0, d, 28
36#define CPU_FEATURE_TM1 1, 0, d, 29
37#define CPU_FEATURE_IA64 1, 0, d, 30
38#define CPU_FEATURE_PBE 1, 0, d, 31
39#define CPU_FEATURE_SSE3 1, 0, c, 0
40#define CPU_FEATURE_SSSE3 1, 0, c, 9
41#define CPU_FEATURE_PCID 1, 0, c, 17
42#define CPU_FEATURE_DCA 1, 0, c, 18
43#define CPU_FEATURE_SSE4_1 1, 0, c, 19
44#define CPU_FEATURE_SSE4_2 1, 0, c, 20
45#define CPU_FEATURE_X2APIC 1, 0, c, 21
46#define CPU_FEATURE_MOVBE 1, 0, c, 22
47#define CPU_FEATURE_POPCNT 1, 0, c, 23
48#define CPU_FEATURE_TSC_DEADLINE 1, 0, c, 24
49#define CPU_FEATURE_AES_NI 1, 0, c, 25
50#define CPU_FEATURE_XSAVE 1, 0, c, 26
51#define CPU_FEATURE_OSXSAVE 1, 0, c, 27
52#define CPU_FEATURE_AVX 1, 0, c, 28
53#define CPU_FEATURE_F16C 1, 0, c, 29
54#define CPU_FEATURE_RDRAND 1, 0, c, 30
55#define CPU_FEATURE_HYPERVISOR 1, 0, c, 31
56#define CPU_FEATURE_AVX2 7, 0, b, 5
57#define CPU_FEATURE_FSGSBASE 7, 0, b, 0
58#define CPU_FEATURE_LA57 7, 0, c, 16
59#define CPU_FEATURE_XSAVES 0xd, 1, a, 3
60#define CPU_FEATURE_NX 0x80000001, 0, d, 20
61#define CPU_FEATURE_PDPE1GB 0x80000001, 0, d, 26
64#define FOR_ALL_CPU_FEATURES(M) \
65 M(FPU) M(VME) M(DE) M(PSE) M(TSC) M(MSR) M(PAE) M(MCE) M(CX8) M(APIC) \
66 M(SEP) M(MTRR) M(PGE) M(MCA) M(CMOV) M(PAT) M(PSE36) M(PSN) M(CLFSH) M(DS) \
67 M(ACPI) M(MMX) M(FXSR) M(SSE) M(SSE2) M(SS) M(HTT) M(TM1) M(IA64) M(PBE) \
68 M(SSE3) M(SSSE3) M(PCID) M(DCA) M(SSE4_1) M(SSE4_2) M(X2APIC) M(MOVBE) M(POPCNT) M(TSC_DEADLINE) \
69 M(AES_NI) M(XSAVE) M(OSXSAVE) M(AVX) M(F16C) M(RDRAND) M(HYPERVISOR) M(AVX2) M(FSGSBASE) M(LA57) \
70 M(XSAVES) M(NX) M(PDPE1GB)
73#define _do_count(leaf) __COUNTER__,
77#define x86_cpu_get_feature_impl(leaf, subleaf, reg, bit) (per_cpu(platform_info->cpu)->cpuinfo.cpuid[X86_CPUID_LEAF_ENUM(leaf, subleaf, reg, )] & (1 << bit))
79#define cpu_has_feature(feat) x86_cpu_get_feature_impl(feat)
81#define FOR_ALL_SUPPORTED_CPUID_LEAF(M) \
89#define X86_CPUID_LEAF_ENUM(leaf, subleaf, reg, ...) X86_CPUID_##leaf##_##subleaf##_##reg
93#define _do_define_enum(leaf, subleaf, reg) X86_CPUID_LEAF_ENUM(leaf, subleaf, reg, _unused_),
101#define XCR0_X87 BIT(0)
102#define XCR0_SSE BIT(1)
103#define XCR0_AVX BIT(2)
104#define XCR0_BNDREGS BIT(3)
105#define XCR0_BNDCSR BIT(4)
106#define XCR0_OPMASK BIT(5)
107#define XCR0_ZMM_Hi256 BIT(6)
108#define XCR0_Hi16_ZMM BIT(7)
109#define XCR0_PT BIT(8)
110#define XCR0_PKRU BIT(9)
111#define XCR0_PASID BIT(10)
112#define XCR0_CET_U BIT(11)
113#define XCR0_CET_S BIT(12)
114#define XCR0_HDC BIT(13)
115#define XCR0_UINTR BIT(14)
116#define XCR0_LBR BIT(15)
117#define XCR0_HMP BIT(16)
118#define XCR0_AMX_TILECFG BIT(17)
119#define XCR0_AMX_TILEDATA BIT(18)
120#define XCR0_APX_EXGPRS BIT(19)
#define FOR_ALL_CPU_FEATURES(M)
#define _do_define_enum(leaf, subleaf, reg)
reg32_t x86_cpuid_array[_X86_CPUID_COUNT]
#define FOR_ALL_SUPPORTED_CPUID_LEAF(M)
MOSAPI int(2, 3) sprintf(char *__restrict str
#define MOS_STATIC_ASSERT