VirtualBox

source: vbox/trunk/include/iprt/x86.mac@ 83488

Last change on this file since 83488 was 82968, checked in by vboxsync, 5 years ago

Copyright year updates by scm.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 55.5 KB
Line 
1;; @file
2; IPRT - X86 and AMD64 Structures and Definitions.
3;
4; Automatically generated by various.sed. DO NOT EDIT!
5;
6
7;
8; Copyright (C) 2006-2020 Oracle Corporation
9;
10; This file is part of VirtualBox Open Source Edition (OSE), as
11; available from http://www.virtualbox.org. This file is free software;
12; you can redistribute it and/or modify it under the terms of the GNU
13; General Public License (GPL) as published by the Free Software
14; Foundation, in version 2 as it comes in the "COPYING" file of the
15; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
16; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
17;
18; The contents of this file may alternatively be used under the terms
19; of the Common Development and Distribution License Version 1.0
20; (CDDL) only, as it comes in the "COPYING.CDDL" file of the
21; VirtualBox OSE distribution, in which case the provisions of the
22; CDDL are applicable instead of those of the GPL.
23;
24; You may elect to license modified versions of this file under the
25; terms and conditions of either the GPL or the CDDL or both.
26;
27
28%ifndef IPRT_INCLUDED_x86_h
29%define IPRT_INCLUDED_x86_h
30%ifndef RT_WITHOUT_PRAGMA_ONCE
31%endif
32%ifndef VBOX_FOR_DTRACE_LIB
33%else
34%endif
35%ifdef RT_OS_SOLARIS
36%endif
37%ifndef VBOX_FOR_DTRACE_LIB
38%endif
39%ifndef VBOX_FOR_DTRACE_LIB
40%endif
41%ifndef VBOX_FOR_DTRACE_LIB
42%endif
43%define X86_EFL_CF RT_BIT_32(0)
44%define X86_EFL_CF_BIT 0
45%define X86_EFL_1 RT_BIT_32(1)
46%define X86_EFL_PF RT_BIT_32(2)
47%define X86_EFL_AF RT_BIT_32(4)
48%define X86_EFL_AF_BIT 4
49%define X86_EFL_ZF RT_BIT_32(6)
50%define X86_EFL_ZF_BIT 6
51%define X86_EFL_SF RT_BIT_32(7)
52%define X86_EFL_SF_BIT 7
53%define X86_EFL_TF RT_BIT_32(8)
54%define X86_EFL_IF RT_BIT_32(9)
55%define X86_EFL_DF RT_BIT_32(10)
56%define X86_EFL_OF RT_BIT_32(11)
57%define X86_EFL_OF_BIT 11
58%define X86_EFL_IOPL (RT_BIT_32(12) | RT_BIT_32(13))
59%define X86_EFL_NT RT_BIT_32(14)
60%define X86_EFL_RF RT_BIT_32(16)
61%define X86_EFL_VM RT_BIT_32(17)
62%define X86_EFL_AC RT_BIT_32(18)
63%define X86_EFL_VIF RT_BIT_32(19)
64%define X86_EFL_VIP RT_BIT_32(20)
65%define X86_EFL_ID RT_BIT_32(21)
66%define X86_EFL_LIVE_MASK 0x003f7fd5
67%define X86_EFL_RA1_MASK RT_BIT_32(1)
68%define X86_EFL_IOPL_SHIFT 12
69%define X86_EFL_GET_IOPL(efl) (((efl) >> X86_EFL_IOPL_SHIFT) & 3)
70%define X86_EFL_POPF_BITS ( X86_EFL_CF | X86_EFL_PF | X86_EFL_AF | X86_EFL_ZF | X86_EFL_SF | X86_EFL_TF | X86_EFL_IF \
71 | X86_EFL_DF | X86_EFL_OF | X86_EFL_IOPL | X86_EFL_NT | X86_EFL_AC | X86_EFL_ID )
72%define X86_EFL_POPF_BITS_386 ( X86_EFL_CF | X86_EFL_PF | X86_EFL_AF | X86_EFL_ZF | X86_EFL_SF | X86_EFL_TF | X86_EFL_IF \
73 | X86_EFL_DF | X86_EFL_OF | X86_EFL_IOPL | X86_EFL_NT )
74%define X86_EFL_STATUS_BITS ( X86_EFL_CF | X86_EFL_PF | X86_EFL_AF | X86_EFL_ZF | X86_EFL_SF | X86_EFL_OF )
75%ifndef VBOX_FOR_DTRACE_LIB
76%else
77%endif
78%ifndef VBOX_FOR_DTRACE_LIB
79%else
80%endif
81%define X86_CPUID_VENDOR_INTEL_EBX 0x756e6547
82%define X86_CPUID_VENDOR_INTEL_ECX 0x6c65746e
83%define X86_CPUID_VENDOR_INTEL_EDX 0x49656e69
84%define X86_CPUID_VENDOR_AMD_EBX 0x68747541
85%define X86_CPUID_VENDOR_AMD_ECX 0x444d4163
86%define X86_CPUID_VENDOR_AMD_EDX 0x69746e65
87%define X86_CPUID_VENDOR_VIA_EBX 0x746e6543
88%define X86_CPUID_VENDOR_VIA_ECX 0x736c7561
89%define X86_CPUID_VENDOR_VIA_EDX 0x48727561
90%define X86_CPUID_VENDOR_SHANGHAI_EBX 0x68532020
91%define X86_CPUID_VENDOR_SHANGHAI_ECX 0x20206961
92%define X86_CPUID_VENDOR_SHANGHAI_EDX 0x68676e61
93%define X86_CPUID_VENDOR_HYGON_EBX 0x6f677948
94%define X86_CPUID_VENDOR_HYGON_ECX 0x656e6975
95%define X86_CPUID_VENDOR_HYGON_EDX 0x6e65476e
96%define X86_CPUID_FEATURE_ECX_SSE3 RT_BIT_32(0)
97%define X86_CPUID_FEATURE_ECX_PCLMUL RT_BIT_32(1)
98%define X86_CPUID_FEATURE_ECX_DTES64 RT_BIT_32(2)
99%define X86_CPUID_FEATURE_ECX_MONITOR RT_BIT_32(3)
100%define X86_CPUID_FEATURE_ECX_CPLDS RT_BIT_32(4)
101%define X86_CPUID_FEATURE_ECX_VMX RT_BIT_32(5)
102%define X86_CPUID_FEATURE_ECX_SMX RT_BIT_32(6)
103%define X86_CPUID_FEATURE_ECX_EST RT_BIT_32(7)
104%define X86_CPUID_FEATURE_ECX_TM2 RT_BIT_32(8)
105%define X86_CPUID_FEATURE_ECX_SSSE3 RT_BIT_32(9)
106%define X86_CPUID_FEATURE_ECX_CNTXID RT_BIT_32(10)
107%define X86_CPUID_FEATURE_ECX_SDBG RT_BIT_32(11)
108%define X86_CPUID_FEATURE_ECX_FMA RT_BIT_32(12)
109%define X86_CPUID_FEATURE_ECX_CX16 RT_BIT_32(13)
110%define X86_CPUID_FEATURE_ECX_TPRUPDATE RT_BIT_32(14)
111%define X86_CPUID_FEATURE_ECX_PDCM RT_BIT_32(15)
112%define X86_CPUID_FEATURE_ECX_PCID RT_BIT_32(17)
113%define X86_CPUID_FEATURE_ECX_DCA RT_BIT_32(18)
114%define X86_CPUID_FEATURE_ECX_SSE4_1 RT_BIT_32(19)
115%define X86_CPUID_FEATURE_ECX_SSE4_2 RT_BIT_32(20)
116%define X86_CPUID_FEATURE_ECX_X2APIC RT_BIT_32(21)
117%define X86_CPUID_FEATURE_ECX_MOVBE RT_BIT_32(22)
118%define X86_CPUID_FEATURE_ECX_POPCNT RT_BIT_32(23)
119%define X86_CPUID_FEATURE_ECX_TSCDEADL RT_BIT_32(24)
120%define X86_CPUID_FEATURE_ECX_AES RT_BIT_32(25)
121%define X86_CPUID_FEATURE_ECX_XSAVE RT_BIT_32(26)
122%define X86_CPUID_FEATURE_ECX_OSXSAVE RT_BIT_32(27)
123%define X86_CPUID_FEATURE_ECX_AVX RT_BIT_32(28)
124%define X86_CPUID_FEATURE_ECX_F16C RT_BIT_32(29)
125%define X86_CPUID_FEATURE_ECX_RDRAND RT_BIT_32(30)
126%define X86_CPUID_FEATURE_ECX_HVP RT_BIT_32(31)
127%define X86_CPUID_FEATURE_EDX_FPU RT_BIT_32(0)
128%define X86_CPUID_FEATURE_EDX_VME RT_BIT_32(1)
129%define X86_CPUID_FEATURE_EDX_DE RT_BIT_32(2)
130%define X86_CPUID_FEATURE_EDX_PSE RT_BIT_32(3)
131%define X86_CPUID_FEATURE_EDX_PSE_BIT 3
132%define X86_CPUID_FEATURE_EDX_TSC RT_BIT_32(4)
133%define X86_CPUID_FEATURE_EDX_MSR RT_BIT_32(5)
134%define X86_CPUID_FEATURE_EDX_PAE RT_BIT_32(6)
135%define X86_CPUID_FEATURE_EDX_PAE_BIT 6
136%define X86_CPUID_FEATURE_EDX_MCE RT_BIT_32(7)
137%define X86_CPUID_FEATURE_EDX_CX8 RT_BIT_32(8)
138%define X86_CPUID_FEATURE_EDX_APIC RT_BIT_32(9)
139%define X86_CPUID_FEATURE_EDX_SEP RT_BIT_32(11)
140%define X86_CPUID_FEATURE_EDX_MTRR RT_BIT_32(12)
141%define X86_CPUID_FEATURE_EDX_PGE RT_BIT_32(13)
142%define X86_CPUID_FEATURE_EDX_MCA RT_BIT_32(14)
143%define X86_CPUID_FEATURE_EDX_CMOV RT_BIT_32(15)
144%define X86_CPUID_FEATURE_EDX_PAT RT_BIT_32(16)
145%define X86_CPUID_FEATURE_EDX_PSE36 RT_BIT_32(17)
146%define X86_CPUID_FEATURE_EDX_PSN RT_BIT_32(18)
147%define X86_CPUID_FEATURE_EDX_CLFSH RT_BIT_32(19)
148%define X86_CPUID_FEATURE_EDX_DS RT_BIT_32(21)
149%define X86_CPUID_FEATURE_EDX_ACPI RT_BIT_32(22)
150%define X86_CPUID_FEATURE_EDX_MMX RT_BIT_32(23)
151%define X86_CPUID_FEATURE_EDX_FXSR RT_BIT_32(24)
152%define X86_CPUID_FEATURE_EDX_SSE RT_BIT_32(25)
153%define X86_CPUID_FEATURE_EDX_SSE2 RT_BIT_32(26)
154%define X86_CPUID_FEATURE_EDX_SS RT_BIT_32(27)
155%define X86_CPUID_FEATURE_EDX_HTT RT_BIT_32(28)
156%define X86_CPUID_FEATURE_EDX_TM RT_BIT_32(29)
157%define X86_CPUID_FEATURE_EDX_PBE RT_BIT_32(31)
158%define X86_CPUID_MWAIT_ECX_EXT RT_BIT_32(0)
159%define X86_CPUID_MWAIT_ECX_BREAKIRQIF0 RT_BIT_32(1)
160%define X86_CPUID_STEXT_FEATURE_EBX_FSGSBASE RT_BIT_32(0)
161%define X86_CPUID_STEXT_FEATURE_EBX_TSC_ADJUST RT_BIT_32(1)
162%define X86_CPUID_STEXT_FEATURE_EBX_SGX RT_BIT_32(2)
163%define X86_CPUID_STEXT_FEATURE_EBX_BMI1 RT_BIT_32(3)
164%define X86_CPUID_STEXT_FEATURE_EBX_HLE RT_BIT_32(4)
165%define X86_CPUID_STEXT_FEATURE_EBX_AVX2 RT_BIT_32(5)
166%define X86_CPUID_STEXT_FEATURE_EBX_FDP_EXCPTN_ONLY RT_BIT_32(6)
167%define X86_CPUID_STEXT_FEATURE_EBX_SMEP RT_BIT_32(7)
168%define X86_CPUID_STEXT_FEATURE_EBX_BMI2 RT_BIT_32(8)
169%define X86_CPUID_STEXT_FEATURE_EBX_ERMS RT_BIT_32(9)
170%define X86_CPUID_STEXT_FEATURE_EBX_INVPCID RT_BIT_32(10)
171%define X86_CPUID_STEXT_FEATURE_EBX_RTM RT_BIT_32(11)
172%define X86_CPUID_STEXT_FEATURE_EBX_PQM RT_BIT_32(12)
173%define X86_CPUID_STEXT_FEATURE_EBX_DEPR_FPU_CS_DS RT_BIT_32(13)
174%define X86_CPUID_STEXT_FEATURE_EBX_MPE RT_BIT_32(14)
175%define X86_CPUID_STEXT_FEATURE_EBX_PQE RT_BIT_32(15)
176%define X86_CPUID_STEXT_FEATURE_EBX_AVX512F RT_BIT_32(16)
177%define X86_CPUID_STEXT_FEATURE_EBX_RDSEED RT_BIT_32(18)
178%define X86_CPUID_STEXT_FEATURE_EBX_ADX RT_BIT_32(19)
179%define X86_CPUID_STEXT_FEATURE_EBX_SMAP RT_BIT_32(20)
180%define X86_CPUID_STEXT_FEATURE_EBX_CLFLUSHOPT RT_BIT_32(23)
181%define X86_CPUID_STEXT_FEATURE_EBX_INTEL_PT RT_BIT_32(25)
182%define X86_CPUID_STEXT_FEATURE_EBX_AVX512PF RT_BIT_32(26)
183%define X86_CPUID_STEXT_FEATURE_EBX_AVX512ER RT_BIT_32(27)
184%define X86_CPUID_STEXT_FEATURE_EBX_AVX512CD RT_BIT_32(28)
185%define X86_CPUID_STEXT_FEATURE_EBX_SHA RT_BIT_32(29)
186%define X86_CPUID_STEXT_FEATURE_ECX_PREFETCHWT1 RT_BIT_32(0)
187%define X86_CPUID_STEXT_FEATURE_ECX_UMIP RT_BIT_32(2)
188%define X86_CPUID_STEXT_FEATURE_ECX_PKU RT_BIT_32(3)
189%define X86_CPUID_STEXT_FEATURE_ECX_OSPKE RT_BIT_32(4)
190%define X86_CPUID_STEXT_FEATURE_ECX_MAWAU 0x003e0000
191%define X86_CPUID_STEXT_FEATURE_ECX_RDPID RT_BIT_32(2)
192%define X86_CPUID_STEXT_FEATURE_ECX_SGX_LC RT_BIT_32(30)
193%define X86_CPUID_STEXT_FEATURE_EDX_IBRS_IBPB RT_BIT_32(26)
194%define X86_CPUID_STEXT_FEATURE_EDX_STIBP RT_BIT_32(27)
195%define X86_CPUID_STEXT_FEATURE_EDX_FLUSH_CMD RT_BIT_32(28)
196%define X86_CPUID_STEXT_FEATURE_EDX_ARCHCAP RT_BIT_32(29)
197%define X86_CPUID_EXT_FEATURE_ECX_LAHF_SAHF RT_BIT_32(0)
198%define X86_CPUID_EXT_FEATURE_EDX_SYSCALL RT_BIT_32(11)
199%define X86_CPUID_EXT_FEATURE_EDX_NX RT_BIT_32(20)
200%define X86_CPUID_EXT_FEATURE_EDX_PAGE1GB RT_BIT_32(26)
201%define X86_CPUID_EXT_FEATURE_EDX_RDTSCP RT_BIT_32(27)
202%define X86_CPUID_EXT_FEATURE_EDX_LONG_MODE RT_BIT_32(29)
203%define X86_CPUID_AMD_FEATURE_EDX_FPU RT_BIT_32(0)
204%define X86_CPUID_AMD_FEATURE_EDX_VME RT_BIT_32(1)
205%define X86_CPUID_AMD_FEATURE_EDX_DE RT_BIT_32(2)
206%define X86_CPUID_AMD_FEATURE_EDX_PSE RT_BIT_32(3)
207%define X86_CPUID_AMD_FEATURE_EDX_TSC RT_BIT_32(4)
208%define X86_CPUID_AMD_FEATURE_EDX_MSR RT_BIT_32(5)
209%define X86_CPUID_AMD_FEATURE_EDX_PAE RT_BIT_32(6)
210%define X86_CPUID_AMD_FEATURE_EDX_MCE RT_BIT_32(7)
211%define X86_CPUID_AMD_FEATURE_EDX_CX8 RT_BIT_32(8)
212%define X86_CPUID_AMD_FEATURE_EDX_APIC RT_BIT_32(9)
213%define X86_CPUID_AMD_FEATURE_EDX_MTRR RT_BIT_32(12)
214%define X86_CPUID_AMD_FEATURE_EDX_PGE RT_BIT_32(13)
215%define X86_CPUID_AMD_FEATURE_EDX_MCA RT_BIT_32(14)
216%define X86_CPUID_AMD_FEATURE_EDX_CMOV RT_BIT_32(15)
217%define X86_CPUID_AMD_FEATURE_EDX_PAT RT_BIT_32(16)
218%define X86_CPUID_AMD_FEATURE_EDX_PSE36 RT_BIT_32(17)
219%define X86_CPUID_AMD_FEATURE_EDX_AXMMX RT_BIT_32(22)
220%define X86_CPUID_AMD_FEATURE_EDX_MMX RT_BIT_32(23)
221%define X86_CPUID_AMD_FEATURE_EDX_FXSR RT_BIT_32(24)
222%define X86_CPUID_AMD_FEATURE_EDX_FFXSR RT_BIT_32(25)
223%define X86_CPUID_AMD_FEATURE_EDX_3DNOW_EX RT_BIT_32(30)
224%define X86_CPUID_AMD_FEATURE_EDX_3DNOW RT_BIT_32(31)
225%define X86_CPUID_AMD_FEATURE_ECX_CMPL RT_BIT_32(1)
226%define X86_CPUID_AMD_FEATURE_ECX_SVM RT_BIT_32(2)
227%define X86_CPUID_AMD_FEATURE_ECX_EXT_APIC RT_BIT_32(3)
228%define X86_CPUID_AMD_FEATURE_ECX_CR8L RT_BIT_32(4)
229%define X86_CPUID_AMD_FEATURE_ECX_ABM RT_BIT_32(5)
230%define X86_CPUID_AMD_FEATURE_ECX_SSE4A RT_BIT_32(6)
231%define X86_CPUID_AMD_FEATURE_ECX_MISALNSSE RT_BIT_32(7)
232%define X86_CPUID_AMD_FEATURE_ECX_3DNOWPRF RT_BIT_32(8)
233%define X86_CPUID_AMD_FEATURE_ECX_OSVW RT_BIT_32(9)
234%define X86_CPUID_AMD_FEATURE_ECX_IBS RT_BIT_32(10)
235%define X86_CPUID_AMD_FEATURE_ECX_XOP RT_BIT_32(11)
236%define X86_CPUID_AMD_FEATURE_ECX_SKINIT RT_BIT_32(12)
237%define X86_CPUID_AMD_FEATURE_ECX_WDT RT_BIT_32(13)
238%define X86_CPUID_AMD_FEATURE_ECX_LWP RT_BIT_32(15)
239%define X86_CPUID_AMD_FEATURE_ECX_FMA4 RT_BIT_32(16)
240%define X86_CPUID_AMD_FEATURE_ECX_NODEID RT_BIT_32(19)
241%define X86_CPUID_AMD_FEATURE_ECX_TBM RT_BIT_32(21)
242%define X86_CPUID_AMD_FEATURE_ECX_TOPOEXT RT_BIT_32(22)
243%define X86_CPUID_AMD_ADVPOWER_EDX_TS RT_BIT_32(0)
244%define X86_CPUID_AMD_ADVPOWER_EDX_FID RT_BIT_32(1)
245%define X86_CPUID_AMD_ADVPOWER_EDX_VID RT_BIT_32(2)
246%define X86_CPUID_AMD_ADVPOWER_EDX_TTP RT_BIT_32(3)
247%define X86_CPUID_AMD_ADVPOWER_EDX_TM RT_BIT_32(4)
248%define X86_CPUID_AMD_ADVPOWER_EDX_STC RT_BIT_32(5)
249%define X86_CPUID_AMD_ADVPOWER_EDX_MC RT_BIT_32(6)
250%define X86_CPUID_AMD_ADVPOWER_EDX_HWPSTATE RT_BIT_32(7)
251%define X86_CPUID_AMD_ADVPOWER_EDX_TSCINVAR RT_BIT_32(8)
252%define X86_CPUID_AMD_ADVPOWER_EDX_CPB RT_BIT_32(9)
253%define X86_CPUID_AMD_ADVPOWER_EDX_EFRO RT_BIT_32(10)
254%define X86_CPUID_AMD_ADVPOWER_EDX_PFI RT_BIT_32(11)
255%define X86_CPUID_AMD_ADVPOWER_EDX_PA RT_BIT_32(12)
256%define X86_CPUID_AMD_EFEID_EBX_CLZERO RT_BIT_32(0)
257%define X86_CPUID_AMD_EFEID_EBX_IRPERF RT_BIT_32(1)
258%define X86_CPUID_AMD_EFEID_EBX_XSAVE_ER_PTR RT_BIT_32(2)
259%define X86_CPUID_AMD_EFEID_EBX_IBPB RT_BIT_32(12)
260%define X86_CPUID_SVM_FEATURE_EDX_NESTED_PAGING RT_BIT(0)
261%define X86_CPUID_SVM_FEATURE_EDX_LBR_VIRT RT_BIT(1)
262%define X86_CPUID_SVM_FEATURE_EDX_SVM_LOCK RT_BIT(2)
263%define X86_CPUID_SVM_FEATURE_EDX_NRIP_SAVE RT_BIT(3)
264%define X86_CPUID_SVM_FEATURE_EDX_TSC_RATE_MSR RT_BIT(4)
265%define X86_CPUID_SVM_FEATURE_EDX_VMCB_CLEAN RT_BIT(5)
266%define X86_CPUID_SVM_FEATURE_EDX_FLUSH_BY_ASID RT_BIT(6)
267%define X86_CPUID_SVM_FEATURE_EDX_DECODE_ASSISTS RT_BIT(7)
268%define X86_CPUID_SVM_FEATURE_EDX_PAUSE_FILTER RT_BIT(10)
269%define X86_CPUID_SVM_FEATURE_EDX_PAUSE_FILTER_THRESHOLD RT_BIT(12)
270%define X86_CPUID_SVM_FEATURE_EDX_AVIC RT_BIT(13)
271%define X86_CPUID_SVM_FEATURE_EDX_VIRT_VMSAVE_VMLOAD RT_BIT(15)
272%define X86_CPUID_SVM_FEATURE_EDX_VGIF RT_BIT(16)
273%define X86_CR0_PE RT_BIT_32(0)
274%define X86_CR0_PROTECTION_ENABLE RT_BIT_32(0)
275%define X86_CR0_MP RT_BIT_32(1)
276%define X86_CR0_MONITOR_COPROCESSOR RT_BIT_32(1)
277%define X86_CR0_EM RT_BIT_32(2)
278%define X86_CR0_EMULATE_FPU RT_BIT_32(2)
279%define X86_CR0_TS RT_BIT_32(3)
280%define X86_CR0_TASK_SWITCH RT_BIT_32(3)
281%define X86_CR0_ET RT_BIT_32(4)
282%define X86_CR0_EXTENSION_TYPE RT_BIT_32(4)
283%define X86_CR0_NE RT_BIT_32(5)
284%define X86_CR0_NUMERIC_ERROR RT_BIT_32(5)
285%define X86_CR0_WP RT_BIT_32(16)
286%define X86_CR0_WRITE_PROTECT RT_BIT_32(16)
287%define X86_CR0_AM RT_BIT_32(18)
288%define X86_CR0_ALIGMENT_MASK RT_BIT_32(18)
289%define X86_CR0_NW RT_BIT_32(29)
290%define X86_CR0_NOT_WRITE_THROUGH RT_BIT_32(29)
291%define X86_CR0_CD RT_BIT_32(30)
292%define X86_CR0_CACHE_DISABLE RT_BIT_32(30)
293%define X86_CR0_PG RT_BIT_32(31)
294%define X86_CR0_PAGING RT_BIT_32(31)
295%define X86_CR0_BIT_PG 31
296%define X86_CR3_PWT RT_BIT_32(3)
297%define X86_CR3_PCD RT_BIT_32(4)
298%define X86_CR3_PAGE_MASK (0xfffff000)
299%define X86_CR3_PAE_PAGE_MASK (0xffffffe0)
300%define X86_CR3_AMD64_PAGE_MASK 0x000ffffffffff000
301%define X86_CR4_VME RT_BIT_32(0)
302%define X86_CR4_PVI RT_BIT_32(1)
303%define X86_CR4_TSD RT_BIT_32(2)
304%define X86_CR4_DE RT_BIT_32(3)
305%define X86_CR4_PSE RT_BIT_32(4)
306%define X86_CR4_PAE RT_BIT_32(5)
307%define X86_CR4_MCE RT_BIT_32(6)
308%define X86_CR4_PGE RT_BIT_32(7)
309%define X86_CR4_PCE RT_BIT_32(8)
310%define X86_CR4_OSFXSR RT_BIT_32(9)
311%define X86_CR4_OSXMMEEXCPT RT_BIT_32(10)
312%define X86_CR4_VMXE RT_BIT_32(13)
313%define X86_CR4_SMXE RT_BIT_32(14)
314%define X86_CR4_FSGSBASE RT_BIT_32(16)
315%define X86_CR4_PCIDE RT_BIT_32(17)
316%define X86_CR4_OSXSAVE RT_BIT_32(18)
317%define X86_CR4_SMEP RT_BIT_32(20)
318%define X86_CR4_SMAP RT_BIT_32(21)
319%define X86_CR4_PKE RT_BIT_32(22)
320%define X86_DR6_B0 RT_BIT_32(0)
321%define X86_DR6_B1 RT_BIT_32(1)
322%define X86_DR6_B2 RT_BIT_32(2)
323%define X86_DR6_B3 RT_BIT_32(3)
324%define X86_DR6_B_MASK 0x0000000f
325%define X86_DR6_BD RT_BIT_32(13)
326%define X86_DR6_BS RT_BIT_32(14)
327%define X86_DR6_BT RT_BIT_32(15)
328%define X86_DR6_RTM RT_BIT_32(16)
329%define X86_DR6_INIT_VAL 0xffff0ff0
330%define X86_DR6_RA1_MASK 0xffff0ff0
331%define X86_DR6_RA1_MASK_RTM 0xfffe0ff0
332%define X86_DR6_RAZ_MASK RT_BIT_64(12)
333%define X86_DR6_MBZ_MASK 0xffffffff00000000
334%define X86_DR6_B(iBp) RT_BIT_64(iBp)
335%define X86_DR7_L0 RT_BIT_32(0)
336%define X86_DR7_G0 RT_BIT_32(1)
337%define X86_DR7_L1 RT_BIT_32(2)
338%define X86_DR7_G1 RT_BIT_32(3)
339%define X86_DR7_L2 RT_BIT_32(4)
340%define X86_DR7_G2 RT_BIT_32(5)
341%define X86_DR7_L3 RT_BIT_32(6)
342%define X86_DR7_G3 RT_BIT_32(7)
343%define X86_DR7_LE RT_BIT_32(8)
344%define X86_DR7_GE RT_BIT_32(9)
345%define X86_DR7_LE_ALL 0x0000000000000055
346%define X86_DR7_GE_ALL 0x00000000000000aa
347%define X86_DR7_RTM RT_BIT_32(11)
348%define X86_DR7_ICE_IR RT_BIT_32(12)
349%define X86_DR7_GD RT_BIT_32(13)
350%define X86_DR7_ICE_TR1 RT_BIT_32(14)
351%define X86_DR7_ICE_TR2 RT_BIT_32(15)
352%define X86_DR7_RW0_MASK (3 << 16)
353%define X86_DR7_LEN0_MASK (3 << 18)
354%define X86_DR7_RW1_MASK (3 << 20)
355%define X86_DR7_LEN1_MASK (3 << 22)
356%define X86_DR7_RW2_MASK (3 << 24)
357%define X86_DR7_LEN2_MASK (3 << 26)
358%define X86_DR7_RW3_MASK (3 << 28)
359%define X86_DR7_LEN3_MASK (3 << 30)
360%define X86_DR7_RA1_MASK RT_BIT_32(10)
361%define X86_DR7_RAZ_MASK 0x0000d800
362%define X86_DR7_MBZ_MASK 0xffffffff00000000
363%define X86_DR7_L(iBp) ( 1 << (iBp * 2) )
364%define X86_DR7_G(iBp) ( 1 << (iBp * 2 + 1) )
365%define X86_DR7_L_G(iBp) ( 3 << (iBp * 2) )
366%define X86_DR7_RW_EO 0
367%define X86_DR7_RW_WO 1
368%define X86_DR7_RW_IO 2
369%define X86_DR7_RW_RW 3
370%define X86_DR7_RW(iBp, fRw) ( (fRw) << ((iBp) * 4 + 16) )
371%define X86_DR7_GET_RW(uDR7, iBp) ( ( (uDR7) >> ((iBp) * 4 + 16) ) & 3 )
372%define X86_DR7_RW_ALL_MASKS 0x33330000
373%ifndef VBOX_FOR_DTRACE_LIB
374 %define X86_DR7_ANY_RW_IO(uDR7) \
375 ( ( 0x22220000 & (uDR7) )
376%endif
377%define X86_DR7_LEN_BYTE 0
378%define X86_DR7_LEN_WORD 1
379%define X86_DR7_LEN_QWORD 2
380%define X86_DR7_LEN_DWORD 3
381%define X86_DR7_LEN(iBp, cb) ( (cb) << ((iBp) * 4 + 18) )
382%define X86_DR7_GET_LEN(uDR7, iBp) ( ( (uDR7) >> ((iBp) * 4 + 18) ) & 0x3 )
383%define X86_DR7_ENABLED_MASK 0x000000ff
384%define X86_DR7_LEN_ALL_MASKS 0xcccc0000
385%define X86_DR7_RW_LEN_ALL_MASKS 0xffff0000
386%define X86_DR7_INIT_VAL 0x400
387%define MSR_P5_MC_ADDR 0x00000000
388%define MSR_P5_MC_TYPE 0x00000001
389%define MSR_IA32_TSC 0x10
390%define MSR_IA32_CESR 0x00000011
391%define MSR_IA32_CTR0 0x00000012
392%define MSR_IA32_CTR1 0x00000013
393%define MSR_IA32_PLATFORM_ID 0x17
394%ifndef MSR_IA32_APICBASE
395 %define MSR_IA32_APICBASE 0x1b
396 %define MSR_IA32_APICBASE_EN RT_BIT_64(11)
397 %define MSR_IA32_APICBASE_EXTD RT_BIT_64(10)
398 %define MSR_IA32_APICBASE_BSP RT_BIT_64(8)
399 %define MSR_IA32_APICBASE_BASE_MIN 0x0000000ffffff000
400 %define MSR_IA32_APICBASE_ADDR 0x00000000fee00000
401 %define MSR_IA32_APICBASE_GET_ADDR(a_Msr) ((a_Msr) & X86_PAGE_4K_BASE_MASK)
402%endif
403%define MSR_CORE_THREAD_COUNT 0x35
404%define MSR_IA32_FEATURE_CONTROL 0x3A
405%define MSR_IA32_FEATURE_CONTROL_LOCK RT_BIT_64(0)
406%define MSR_IA32_FEATURE_CONTROL_SMX_VMXON RT_BIT_64(1)
407%define MSR_IA32_FEATURE_CONTROL_VMXON RT_BIT_64(2)
408%define MSR_IA32_FEATURE_CONTROL_SENTER_LOCAL_FN_0 RT_BIT_64(8)
409%define MSR_IA32_FEATURE_CONTROL_SENTER_LOCAL_FN_1 RT_BIT_64(9)
410%define MSR_IA32_FEATURE_CONTROL_SENTER_LOCAL_FN_2 RT_BIT_64(10)
411%define MSR_IA32_FEATURE_CONTROL_SENTER_LOCAL_FN_3 RT_BIT_64(11)
412%define MSR_IA32_FEATURE_CONTROL_SENTER_LOCAL_FN_4 RT_BIT_64(12)
413%define MSR_IA32_FEATURE_CONTROL_SENTER_LOCAL_FN_5 RT_BIT_64(13)
414%define MSR_IA32_FEATURE_CONTROL_SENTER_LOCAL_FN_6 RT_BIT_64(14)
415%define MSR_IA32_FEATURE_CONTROL_SENTER_GLOBAL_EN RT_BIT_64(15)
416%define MSR_IA32_FEATURE_CONTROL_SGX_LAUNCH_EN RT_BIT_64(17)
417%define MSR_IA32_FEATURE_CONTROL_SGX_GLOBAL_EN RT_BIT_64(18)
418%define MSR_IA32_FEATURE_CONTROL_LMCE RT_BIT_64(20)
419%define MSR_IA32_TSC_ADJUST 0x3B
420%define MSR_IA32_SPEC_CTRL 0x48
421%define MSR_IA32_SPEC_CTRL_F_IBRS RT_BIT_32(0)
422%define MSR_IA32_SPEC_CTRL_F_STIBP RT_BIT_32(1)
423%define MSR_IA32_PRED_CMD 0x49
424%define MSR_IA32_PRED_CMD_F_IBPB RT_BIT_32(0)
425%define MSR_IA32_BIOS_UPDT_TRIG 0x79
426%define MSR_IA32_BIOS_SIGN_ID 0x8B
427%define MSR_IA32_SMM_MONITOR_CTL 0x9B
428%define MSR_IA32_SMM_MONITOR_VALID RT_BIT_64(0)
429%define MSR_IA32_SMM_MONITOR_VMXOFF_UNBLOCK_SMI RT_BIT_64(2)
430%define MSR_IA32_SMM_MONITOR_MSGEG_PHYSADDR(a) (((a) >> 12) & 0xfffff)
431%define MSR_IA32_SMBASE 0x9E
432%define MSR_IA32_PMC0 0xC1
433%define MSR_IA32_PMC1 0xC2
434%define MSR_IA32_PMC2 0xC3
435%define MSR_IA32_PMC3 0xC4
436%define MSR_IA32_PLATFORM_INFO 0xCE
437%define MSR_IA32_FSB_CLOCK_STS 0xCD
438%define MSR_PKG_CST_CONFIG_CONTROL 0x000000e2
439%define MSR_IA32_MPERF 0xE7
440%define MSR_IA32_APERF 0xE8
441%define MSR_IA32_MTRR_CAP 0xFE
442%define MSR_IA32_ARCH_CAPABILITIES 0x10a
443%define MSR_IA32_ARCH_CAP_F_RDCL_NO RT_BIT_32(0)
444%define MSR_IA32_ARCH_CAP_F_IBRS_ALL RT_BIT_32(1)
445%define MSR_IA32_ARCH_CAP_F_RSBO RT_BIT_32(2)
446%define MSR_IA32_ARCH_CAP_F_VMM_NEED_NOT_FLUSH_L1D RT_BIT_32(3)
447%define MSR_IA32_FLUSH_CMD 0x10b
448%define MSR_IA32_FLUSH_CMD_F_L1D RT_BIT_32(0)
449%define MSR_BBL_CR_CTL3 0x11e
450%ifndef MSR_IA32_SYSENTER_CS
451%define MSR_IA32_SYSENTER_CS 0x174
452%define MSR_IA32_SYSENTER_ESP 0x175
453%define MSR_IA32_SYSENTER_EIP 0x176
454%endif
455%define MSR_IA32_MCG_CAP 0x179
456%define MSR_IA32_MCG_STATUS 0x17A
457%define MSR_IA32_MCG_CTRL 0x17B
458%define MSR_IA32_CR_PAT 0x277
459%define MSR_IA32_CR_PAT_INIT_VAL 0x0007040600070406
460%define MSR_IA32_PERFEVTSEL0 0x186
461%define MSR_IA32_PERFEVTSEL1 0x187
462%define MSR_FLEX_RATIO 0x194
463%define MSR_IA32_PERF_STATUS 0x198
464%define MSR_IA32_PERF_CTL 0x199
465%define MSR_IA32_THERM_STATUS 0x19c
466%define MSR_IA32_MISC_ENABLE 0x1A0
467%define MSR_IA32_MISC_ENABLE_FAST_STRINGS RT_BIT_64(0)
468%define MSR_IA32_MISC_ENABLE_TCC RT_BIT_64(3)
469%define MSR_IA32_MISC_ENABLE_PERF_MON RT_BIT_64(7)
470%define MSR_IA32_MISC_ENABLE_BTS_UNAVAIL RT_BIT_64(11)
471%define MSR_IA32_MISC_ENABLE_PEBS_UNAVAIL RT_BIT_64(12)
472%define MSR_IA32_MISC_ENABLE_SST_ENABLE RT_BIT_64(16)
473%define MSR_IA32_MISC_ENABLE_MONITOR RT_BIT_64(18)
474%define MSR_IA32_MISC_ENABLE_LIMIT_CPUID RT_BIT_64(22)
475%define MSR_IA32_MISC_ENABLE_XTPR_MSG_DISABLE RT_BIT_64(23)
476%define MSR_IA32_MISC_ENABLE_XD_DISABLE RT_BIT_64(34)
477%define MSR_IA32_DEBUGCTL 0x000001d9
478%define MSR_IA32_DEBUGCTL_LBR RT_BIT_64(0)
479%define MSR_IA32_DEBUGCTL_BTF RT_BIT_64(1)
480%define MSR_IA32_DEBUGCTL_PB0 RT_BIT_64(2)
481%define MSR_IA32_DEBUGCTL_PB1 RT_BIT_64(3)
482%define MSR_IA32_DEBUGCTL_PB2 RT_BIT_64(4)
483%define MSR_IA32_DEBUGCTL_PB3 RT_BIT_64(5)
484%define MSR_IA32_DEBUGCTL_TR RT_BIT_64(6)
485%define MSR_IA32_DEBUGCTL_BTS RT_BIT_64(7)
486%define MSR_IA32_DEBUGCTL_BTINT RT_BIT_64(8)
487%define MSR_IA32_DEBUGCTL_BTS_OFF_OS RT_BIT_64(9)
488%define MSR_IA32_DEBUGCTL_BTS_OFF_USER RT_BIT_64(10)
489%define MSR_IA32_DEBUGCTL_FREEZE_LBR_ON_PMI RT_BIT_64(11)
490%define MSR_IA32_DEBUGCTL_FREEZE_PERFMON_ON_PMI RT_BIT_64(12)
491%define MSR_IA32_DEBUGCTL_FREEZE_WHILE_SMM_EM RT_BIT_64(14)
492%define MSR_IA32_DEBUGCTL_RTM RT_BIT_64(15)
493%define MSR_IA32_DEBUGCTL_VALID_MASK_INTEL ( MSR_IA32_DEBUGCTL_LBR | MSR_IA32_DEBUGCTL_BTF | MSR_IA32_DEBUGCTL_TR \
494 | MSR_IA32_DEBUGCTL_BTS | MSR_IA32_DEBUGCTL_BTINT | MSR_IA32_DEBUGCTL_BTS_OFF_OS \
495 | MSR_IA32_DEBUGCTL_BTS_OFF_USER | MSR_IA32_DEBUGCTL_FREEZE_LBR_ON_PMI \
496 | MSR_IA32_DEBUGCTL_FREEZE_PERFMON_ON_PMI | MSR_IA32_DEBUGCTL_FREEZE_WHILE_SMM_EM \
497 | MSR_IA32_DEBUGCTL_RTM)
498%define MSR_P4_LASTBRANCH_TOS 0x000001da
499%define MSR_P4_LASTBRANCH_0 0x000001db
500%define MSR_P4_LASTBRANCH_1 0x000001dc
501%define MSR_P4_LASTBRANCH_2 0x000001dd
502%define MSR_P4_LASTBRANCH_3 0x000001de
503%define IA32_MTRR_PHYSBASE0 0x200
504%define IA32_MTRR_PHYSMASK0 0x201
505%define IA32_MTRR_PHYSBASE1 0x202
506%define IA32_MTRR_PHYSMASK1 0x203
507%define IA32_MTRR_PHYSBASE2 0x204
508%define IA32_MTRR_PHYSMASK2 0x205
509%define IA32_MTRR_PHYSBASE3 0x206
510%define IA32_MTRR_PHYSMASK3 0x207
511%define IA32_MTRR_PHYSBASE4 0x208
512%define IA32_MTRR_PHYSMASK4 0x209
513%define IA32_MTRR_PHYSBASE5 0x20a
514%define IA32_MTRR_PHYSMASK5 0x20b
515%define IA32_MTRR_PHYSBASE6 0x20c
516%define IA32_MTRR_PHYSMASK6 0x20d
517%define IA32_MTRR_PHYSBASE7 0x20e
518%define IA32_MTRR_PHYSMASK7 0x20f
519%define IA32_MTRR_PHYSBASE8 0x210
520%define IA32_MTRR_PHYSMASK8 0x211
521%define IA32_MTRR_PHYSBASE9 0x212
522%define IA32_MTRR_PHYSMASK9 0x213
523%define IA32_MTRR_FIX64K_00000 0x250
524%define IA32_MTRR_FIX16K_80000 0x258
525%define IA32_MTRR_FIX16K_A0000 0x259
526%define IA32_MTRR_FIX4K_C0000 0x268
527%define IA32_MTRR_FIX4K_C8000 0x269
528%define IA32_MTRR_FIX4K_D0000 0x26a
529%define IA32_MTRR_FIX4K_D8000 0x26b
530%define IA32_MTRR_FIX4K_E0000 0x26c
531%define IA32_MTRR_FIX4K_E8000 0x26d
532%define IA32_MTRR_FIX4K_F0000 0x26e
533%define IA32_MTRR_FIX4K_F8000 0x26f
534%define MSR_IA32_MTRR_DEF_TYPE 0x2FF
535%define MSR_IA32_PERF_GLOBAL_STATUS 0x38E
536%define MSR_IA32_PERF_GLOBAL_CTRL 0x38F
537%define MSR_IA32_PERF_GLOBAL_OVF_CTRL 0x390
538%define MSR_IA32_PEBS_ENABLE 0x3F1
539%define MSR_IA32_MC0_CTL 0x400
540%define MSR_IA32_MC0_STATUS 0x401
541%define MSR_IA32_VMX_BASIC 0x480
542%define MSR_IA32_VMX_PINBASED_CTLS 0x481
543%define MSR_IA32_VMX_PROCBASED_CTLS 0x482
544%define MSR_IA32_VMX_EXIT_CTLS 0x483
545%define MSR_IA32_VMX_ENTRY_CTLS 0x484
546%define MSR_IA32_VMX_MISC 0x485
547%define MSR_IA32_VMX_CR0_FIXED0 0x486
548%define MSR_IA32_VMX_CR0_FIXED1 0x487
549%define MSR_IA32_VMX_CR4_FIXED0 0x488
550%define MSR_IA32_VMX_CR4_FIXED1 0x489
551%define MSR_IA32_VMX_VMCS_ENUM 0x48A
552%define MSR_IA32_VMX_PROCBASED_CTLS2 0x48B
553%define MSR_IA32_VMX_EPT_VPID_CAP 0x48C
554%define MSR_IA32_VMX_TRUE_PINBASED_CTLS 0x48D
555%define MSR_IA32_VMX_TRUE_PROCBASED_CTLS 0x48E
556%define MSR_IA32_VMX_TRUE_EXIT_CTLS 0x48F
557%define MSR_IA32_VMX_TRUE_ENTRY_CTLS 0x490
558%define MSR_IA32_VMX_VMFUNC 0x491
559%define MSR_IA32_RTIT_CTL 0x570
560%define MSR_IA32_DS_AREA 0x600
561%define MSR_RAPL_POWER_UNIT 0x606
562%define MSR_IA32_X2APIC_START 0x800
563%define MSR_IA32_X2APIC_ID 0x802
564%define MSR_IA32_X2APIC_VERSION 0x803
565%define MSR_IA32_X2APIC_TPR 0x808
566%define MSR_IA32_X2APIC_PPR 0x80A
567%define MSR_IA32_X2APIC_EOI 0x80B
568%define MSR_IA32_X2APIC_LDR 0x80D
569%define MSR_IA32_X2APIC_SVR 0x80F
570%define MSR_IA32_X2APIC_ISR0 0x810
571%define MSR_IA32_X2APIC_ISR1 0x811
572%define MSR_IA32_X2APIC_ISR2 0x812
573%define MSR_IA32_X2APIC_ISR3 0x813
574%define MSR_IA32_X2APIC_ISR4 0x814
575%define MSR_IA32_X2APIC_ISR5 0x815
576%define MSR_IA32_X2APIC_ISR6 0x816
577%define MSR_IA32_X2APIC_ISR7 0x817
578%define MSR_IA32_X2APIC_TMR0 0x818
579%define MSR_IA32_X2APIC_TMR1 0x819
580%define MSR_IA32_X2APIC_TMR2 0x81A
581%define MSR_IA32_X2APIC_TMR3 0x81B
582%define MSR_IA32_X2APIC_TMR4 0x81C
583%define MSR_IA32_X2APIC_TMR5 0x81D
584%define MSR_IA32_X2APIC_TMR6 0x81E
585%define MSR_IA32_X2APIC_TMR7 0x81F
586%define MSR_IA32_X2APIC_IRR0 0x820
587%define MSR_IA32_X2APIC_IRR1 0x821
588%define MSR_IA32_X2APIC_IRR2 0x822
589%define MSR_IA32_X2APIC_IRR3 0x823
590%define MSR_IA32_X2APIC_IRR4 0x824
591%define MSR_IA32_X2APIC_IRR5 0x825
592%define MSR_IA32_X2APIC_IRR6 0x826
593%define MSR_IA32_X2APIC_IRR7 0x827
594%define MSR_IA32_X2APIC_ESR 0x828
595%define MSR_IA32_X2APIC_LVT_CMCI 0x82F
596%define MSR_IA32_X2APIC_ICR 0x830
597%define MSR_IA32_X2APIC_LVT_TIMER 0x832
598%define MSR_IA32_X2APIC_LVT_THERMAL 0x833
599%define MSR_IA32_X2APIC_LVT_PERF 0x834
600%define MSR_IA32_X2APIC_LVT_LINT0 0x835
601%define MSR_IA32_X2APIC_LVT_LINT1 0x836
602%define MSR_IA32_X2APIC_LVT_ERROR 0x837
603%define MSR_IA32_X2APIC_TIMER_ICR 0x838
604%define MSR_IA32_X2APIC_TIMER_CCR 0x839
605%define MSR_IA32_X2APIC_TIMER_DCR 0x83E
606%define MSR_IA32_X2APIC_SELF_IPI 0x83F
607%define MSR_IA32_X2APIC_END 0xBFF
608%define MSR_IA32_X2APIC_LVT_START MSR_IA32_X2APIC_LVT_TIMER
609%define MSR_IA32_X2APIC_LVT_END MSR_IA32_X2APIC_LVT_ERROR
610%define MSR_K6_EFER 0xc0000080
611%define MSR_K6_EFER_SCE RT_BIT_32(0)
612%define MSR_K6_EFER_LME RT_BIT_32(8)
613%define MSR_K6_EFER_BIT_LME 8
614%define MSR_K6_EFER_LMA RT_BIT_32(10)
615%define MSR_K6_EFER_BIT_LMA 10
616%define MSR_K6_EFER_NXE RT_BIT_32(11)
617%define MSR_K6_EFER_BIT_NXE 11
618%define MSR_K6_EFER_SVME RT_BIT_32(12)
619%define MSR_K6_EFER_LMSLE RT_BIT_32(13)
620%define MSR_K6_EFER_FFXSR RT_BIT_32(14)
621%define MSR_K6_EFER_TCE RT_BIT_32(15)
622%define MSR_K6_STAR 0xc0000081
623%define MSR_K6_STAR_SYSRET_CS_SS_SHIFT 48
624%define MSR_K6_STAR_SYSCALL_CS_SS_SHIFT 32
625%define MSR_K6_STAR_SEL_MASK 0xffff
626%define MSR_K6_STAR_SYSCALL_EIP_MASK 0xffffffff
627%define MSR_K6_WHCR 0xc0000082
628%define MSR_K6_UWCCR 0xc0000085
629%define MSR_K6_PSOR 0xc0000087
630%define MSR_K6_PFIR 0xc0000088
631%define MSR_K7_EVNTSEL0 0xc0010000
632%define MSR_K7_EVNTSEL1 0xc0010001
633%define MSR_K7_EVNTSEL2 0xc0010002
634%define MSR_K7_EVNTSEL3 0xc0010003
635%define MSR_K7_PERFCTR0 0xc0010004
636%define MSR_K7_PERFCTR1 0xc0010005
637%define MSR_K7_PERFCTR2 0xc0010006
638%define MSR_K7_PERFCTR3 0xc0010007
639%define MSR_K8_LSTAR 0xc0000082
640%define MSR_K8_CSTAR 0xc0000083
641%define MSR_K8_SF_MASK 0xc0000084
642%define MSR_K8_FS_BASE 0xc0000100
643%define MSR_K8_GS_BASE 0xc0000101
644%define MSR_K8_KERNEL_GS_BASE 0xc0000102
645%define MSR_K8_TSC_AUX 0xc0000103
646%define MSR_K8_SYSCFG 0xc0010010
647%define MSR_K8_HWCR 0xc0010015
648%define MSR_K8_IORRBASE0 0xc0010016
649%define MSR_K8_IORRMASK0 0xc0010017
650%define MSR_K8_IORRBASE1 0xc0010018
651%define MSR_K8_IORRMASK1 0xc0010019
652%define MSR_K8_TOP_MEM1 0xc001001a
653%define MSR_K8_TOP_MEM2 0xc001001d
654%define MSR_K8_NB_CFG 0xc001001f
655%define MSR_K8_INT_PENDING 0xc0010055
656%define MSR_K8_VM_CR 0xc0010114
657%define MSR_K8_VM_CR_DPD RT_BIT_32(0)
658%define MSR_K8_VM_CR_R_INIT RT_BIT_32(1)
659%define MSR_K8_VM_CR_DIS_A20M RT_BIT_32(2)
660%define MSR_K8_VM_CR_LOCK RT_BIT_32(3)
661%define MSR_K8_VM_CR_SVM_DISABLE RT_BIT_32(4)
662%define MSR_K8_IGNNE 0xc0010115
663%define MSR_K8_SMM_CTL 0xc0010116
664%define MSR_K8_VM_HSAVE_PA 0xc0010117
665%define X86_PG_ENTRIES 1024
666%define X86_PG_PAE_ENTRIES 512
667%define X86_PG_PAE_PDPE_ENTRIES 4
668%define X86_PG_AMD64_ENTRIES X86_PG_PAE_ENTRIES
669%define X86_PG_AMD64_PDPE_ENTRIES X86_PG_AMD64_ENTRIES
670%define X86_PAGE_SIZE X86_PAGE_4K_SIZE
671%define X86_PAGE_SHIFT X86_PAGE_4K_SHIFT
672%define X86_PAGE_OFFSET_MASK X86_PAGE_4K_OFFSET_MASK
673%define X86_PAGE_BASE_MASK X86_PAGE_4K_BASE_MASK
674%define X86_PAGE_BASE_MASK_32 X86_PAGE_4K_BASE_MASK_32
675%define X86_PAGE_4K_SIZE _4K
676%define X86_PAGE_4K_SHIFT 12
677%define X86_PAGE_4K_OFFSET_MASK 0xfff
678%define X86_PAGE_4K_BASE_MASK 0xfffffffffffff000
679%define X86_PAGE_4K_BASE_MASK_32 0xfffff000
680%define X86_PAGE_2M_SIZE _2M
681%define X86_PAGE_2M_SHIFT 21
682%define X86_PAGE_2M_OFFSET_MASK 0x001fffff
683%define X86_PAGE_2M_BASE_MASK 0xffffffffffe00000
684%define X86_PAGE_2M_BASE_MASK_32 0xffe00000
685%define X86_PAGE_4M_SIZE _4M
686%define X86_PAGE_4M_SHIFT 22
687%define X86_PAGE_4M_OFFSET_MASK 0x003fffff
688%define X86_PAGE_4M_BASE_MASK 0xffffffffffc00000
689%define X86_PAGE_4M_BASE_MASK_32 0xffc00000
690%define X86_PAGE_1G_SIZE _1G
691%define X86_PAGE_1G_SHIFT 30
692%define X86_PAGE_1G_OFFSET_MASK 0x3fffffff
693%define X86_PAGE_1G_BASE_MASK 0xffffffffc0000000
694%define X86_IS_CANONICAL(a_u64Addr) ((uint64_t)(a_u64Addr) + 0x800000000000 < UINT64_C(0x1000000000000))
695%define X86_PTE_BIT_P 0
696%define X86_PTE_BIT_RW 1
697%define X86_PTE_BIT_US 2
698%define X86_PTE_BIT_PWT 3
699%define X86_PTE_BIT_PCD 4
700%define X86_PTE_BIT_A 5
701%define X86_PTE_BIT_D 6
702%define X86_PTE_BIT_PAT 7
703%define X86_PTE_BIT_G 8
704%define X86_PTE_PAE_BIT_NX 63
705%define X86_PTE_P RT_BIT_32(0)
706%define X86_PTE_RW RT_BIT_32(1)
707%define X86_PTE_US RT_BIT_32(2)
708%define X86_PTE_PWT RT_BIT_32(3)
709%define X86_PTE_PCD RT_BIT_32(4)
710%define X86_PTE_A RT_BIT_32(5)
711%define X86_PTE_D RT_BIT_32(6)
712%define X86_PTE_PAT RT_BIT_32(7)
713%define X86_PTE_G RT_BIT_32(8)
714%define X86_PTE_AVL_MASK (RT_BIT_32(9) | RT_BIT_32(10) | RT_BIT_32(11))
715%define X86_PTE_PG_MASK ( 0xfffff000 )
716%define X86_PTE_PAE_PG_MASK 0x000ffffffffff000
717%define X86_PTE_PAE_NX RT_BIT_64(63)
718%define X86_PTE_PAE_MBZ_MASK_NX 0x7ff0000000000000
719%define X86_PTE_PAE_MBZ_MASK_NO_NX 0xfff0000000000000
720%define X86_PTE_LM_MBZ_MASK_NX 0x0000000000000000
721%define X86_PTE_LM_MBZ_MASK_NO_NX 0x8000000000000000
722%ifndef VBOX_FOR_DTRACE_LIB
723%endif
724%ifndef VBOX_FOR_DTRACE_LIB
725%endif
726%ifndef VBOX_FOR_DTRACE_LIB
727%endif
728%ifndef VBOX_FOR_DTRACE_LIB
729%endif
730%ifndef VBOX_FOR_DTRACE_LIB
731%endif
732%define X86_PT_SHIFT 12
733%define X86_PT_MASK 0x3ff
734%ifndef VBOX_FOR_DTRACE_LIB
735%endif
736%define X86_PT_PAE_SHIFT 12
737%define X86_PT_PAE_MASK 0x1ff
738%define X86_PDE_P RT_BIT_32(0)
739%define X86_PDE_RW RT_BIT_32(1)
740%define X86_PDE_US RT_BIT_32(2)
741%define X86_PDE_PWT RT_BIT_32(3)
742%define X86_PDE_PCD RT_BIT_32(4)
743%define X86_PDE_A RT_BIT_32(5)
744%define X86_PDE_PS RT_BIT_32(7)
745%define X86_PDE_AVL_MASK (RT_BIT_32(9) | RT_BIT_32(10) | RT_BIT_32(11))
746%define X86_PDE_PG_MASK ( 0xfffff000 )
747%define X86_PDE_PAE_PG_MASK 0x000ffffffffff000
748%define X86_PDE_PAE_NX RT_BIT_64(63)
749%define X86_PDE_PAE_MBZ_MASK_NX 0x7ff0000000000080
750%define X86_PDE_PAE_MBZ_MASK_NO_NX 0xfff0000000000080
751%define X86_PDE_LM_MBZ_MASK_NX 0x0000000000000080
752%define X86_PDE_LM_MBZ_MASK_NO_NX 0x8000000000000080
753%ifndef VBOX_FOR_DTRACE_LIB
754%endif
755%ifndef VBOX_FOR_DTRACE_LIB
756%endif
757%define X86_PDE4M_P RT_BIT_32(0)
758%define X86_PDE4M_RW RT_BIT_32(1)
759%define X86_PDE4M_US RT_BIT_32(2)
760%define X86_PDE4M_PWT RT_BIT_32(3)
761%define X86_PDE4M_PCD RT_BIT_32(4)
762%define X86_PDE4M_A RT_BIT_32(5)
763%define X86_PDE4M_D RT_BIT_32(6)
764%define X86_PDE4M_PS RT_BIT_32(7)
765%define X86_PDE4M_G RT_BIT_32(8)
766%define X86_PDE4M_AVL (RT_BIT_32(9) | RT_BIT_32(10) | RT_BIT_32(11))
767%define X86_PDE4M_PAT RT_BIT_32(12)
768%define X86_PDE4M_PAT_SHIFT (12 - 7)
769%define X86_PDE4M_PG_MASK ( 0xffc00000 )
770%define X86_PDE4M_PG_HIGH_MASK ( 0x001fe000 )
771%define X86_PDE4M_PG_HIGH_SHIFT 19
772%define X86_PDE4M_MBZ_MASK RT_BIT_32(21)
773%define X86_PDE2M_PAE_PG_MASK 0x000fffffffe00000
774%define X86_PDE2M_PAE_NX RT_BIT_64(63)
775%define X86_PDE2M_PAE_MBZ_MASK_NX 0x7ff00000001fe000
776%define X86_PDE2M_PAE_MBZ_MASK_NO_NX 0xfff00000001fe000
777%define X86_PDE2M_LM_MBZ_MASK_NX 0x00000000001fe000
778%define X86_PDE2M_LM_MBZ_MASK_NO_NX 0x80000000001fe000
779%ifndef VBOX_FOR_DTRACE_LIB
780%endif
781%ifndef VBOX_FOR_DTRACE_LIB
782%endif
783%ifndef VBOX_FOR_DTRACE_LIB
784%endif
785%ifndef VBOX_FOR_DTRACE_LIB
786%endif
787%ifndef VBOX_FOR_DTRACE_LIB
788%endif
789%define X86_PD_SHIFT 22
790%define X86_PD_MASK 0x3ff
791%ifndef VBOX_FOR_DTRACE_LIB
792%endif
793%define X86_PD_PAE_SHIFT 21
794%define X86_PD_PAE_MASK 0x1ff
795%define X86_PDPE_P RT_BIT_32(0)
796%define X86_PDPE_RW RT_BIT_32(1)
797%define X86_PDPE_US RT_BIT_32(2)
798%define X86_PDPE_PWT RT_BIT_32(3)
799%define X86_PDPE_PCD RT_BIT_32(4)
800%define X86_PDPE_A RT_BIT_32(5)
801%define X86_PDPE_LM_PS RT_BIT_32(7)
802%define X86_PDPE_AVL_MASK (RT_BIT_32(9) | RT_BIT_32(10) | RT_BIT_32(11))
803%define X86_PDPE_PG_MASK 0x000ffffffffff000
804%define X86_PDPE_PAE_MBZ_MASK 0xfff00000000001e6
805%define X86_PDPE_LM_NX RT_BIT_64(63)
806%define X86_PDPE_LM_MBZ_MASK_NX 0x0000000000000180
807%define X86_PDPE_LM_MBZ_MASK_NO_NX 0x8000000000000180
808%define X86_PDPE1G_LM_MBZ_MASK_NX 0x000000003fffe000
809%define X86_PDPE1G_LM_MBZ_MASK_NO_NX 0x800000003fffe000
810%ifndef VBOX_FOR_DTRACE_LIB
811%endif
812%ifndef VBOX_FOR_DTRACE_LIB
813%endif
814%ifndef VBOX_FOR_DTRACE_LIB
815%endif
816%ifndef VBOX_FOR_DTRACE_LIB
817%endif
818%ifndef VBOX_FOR_DTRACE_LIB
819%endif
820%define X86_PDPT_SHIFT 30
821%define X86_PDPT_MASK_PAE 0x3
822%define X86_PDPT_MASK_AMD64 0x1ff
823%define X86_PML4E_P RT_BIT_32(0)
824%define X86_PML4E_RW RT_BIT_32(1)
825%define X86_PML4E_US RT_BIT_32(2)
826%define X86_PML4E_PWT RT_BIT_32(3)
827%define X86_PML4E_PCD RT_BIT_32(4)
828%define X86_PML4E_A RT_BIT_32(5)
829%define X86_PML4E_AVL_MASK (RT_BIT_32(9) | RT_BIT_32(10) | RT_BIT_32(11))
830%define X86_PML4E_PG_MASK 0x000ffffffffff000
831%define X86_PML4E_MBZ_MASK_NX 0x0000000000000080
832%define X86_PML4E_MBZ_MASK_NO_NX 0x8000000000000080
833%define X86_PML4E_NX RT_BIT_64(63)
834%ifndef VBOX_FOR_DTRACE_LIB
835%endif
836%ifndef VBOX_FOR_DTRACE_LIB
837%endif
838%ifndef VBOX_FOR_DTRACE_LIB
839%endif
840%define X86_PML4_SHIFT 39
841%define X86_PML4_MASK 0x1ff
842%define X86_INVPCID_TYPE_INDV_ADDR 0
843%define X86_INVPCID_TYPE_SINGLE_CONTEXT 1
844%define X86_INVPCID_TYPE_ALL_CONTEXT_INCL_GLOBAL 2
845%define X86_INVPCID_TYPE_ALL_CONTEXT_EXCL_GLOBAL 3
846%define X86_INVPCID_TYPE_MAX_VALID X86_INVPCID_TYPE_ALL_CONTEXT_EXCL_GLOBAL
847%ifndef VBOX_FOR_DTRACE_LIB
848%endif
849%ifndef VBOX_FOR_DTRACE_LIB
850%endif
851%ifndef VBOX_FOR_DTRACE_LIB
852%endif
853%ifndef VBOX_FOR_DTRACE_LIB
854%endif
855%ifndef VBOX_FOR_DTRACE_LIB
856%endif
857%ifndef VBOX_FOR_DTRACE_LIB
858%endif
859%define X86_OFF_FXSTATE_RSVD 0x1d0
860%define X86_FXSTATE_RSVD_32BIT_MAGIC 0x32b3232b
861%ifndef VBOX_FOR_DTRACE_LIB
862%endif
863%define X86_FSW_IE RT_BIT_32(0)
864%define X86_FSW_DE RT_BIT_32(1)
865%define X86_FSW_ZE RT_BIT_32(2)
866%define X86_FSW_OE RT_BIT_32(3)
867%define X86_FSW_UE RT_BIT_32(4)
868%define X86_FSW_PE RT_BIT_32(5)
869%define X86_FSW_SF RT_BIT_32(6)
870%define X86_FSW_ES RT_BIT_32(7)
871%define X86_FSW_XCPT_MASK 0x007f
872%define X86_FSW_XCPT_ES_MASK 0x00ff
873%define X86_FSW_C0 RT_BIT_32(8)
874%define X86_FSW_C1 RT_BIT_32(9)
875%define X86_FSW_C2 RT_BIT_32(10)
876%define X86_FSW_TOP_MASK 0x3800
877%define X86_FSW_TOP_SHIFT 11
878%define X86_FSW_TOP_SMASK 0x0007
879%define X86_FSW_TOP_GET(a_uFsw) (((a_uFsw) >> X86_FSW_TOP_SHIFT) & X86_FSW_TOP_SMASK)
880%define X86_FSW_C3 RT_BIT_32(14)
881%define X86_FSW_C_MASK 0x4700
882%define X86_FSW_B RT_BIT_32(15)
883%define X86_FCW_IM RT_BIT_32(0)
884%define X86_FCW_DM RT_BIT_32(1)
885%define X86_FCW_ZM RT_BIT_32(2)
886%define X86_FCW_OM RT_BIT_32(3)
887%define X86_FCW_UM RT_BIT_32(4)
888%define X86_FCW_PM RT_BIT_32(5)
889%define X86_FCW_MASK_ALL 0x007f
890%define X86_FCW_XCPT_MASK 0x003f
891%define X86_FCW_PC_MASK 0x0300
892%define X86_FCW_PC_24 0x0000
893%define X86_FCW_PC_RSVD 0x0100
894%define X86_FCW_PC_53 0x0200
895%define X86_FCW_PC_64 0x0300
896%define X86_FCW_RC_MASK 0x0c00
897%define X86_FCW_RC_NEAREST 0x0000
898%define X86_FCW_RC_DOWN 0x0400
899%define X86_FCW_RC_UP 0x0800
900%define X86_FCW_RC_ZERO 0x0c00
901%define X86_FCW_ZERO_MASK 0xf080
902%define X86_MXCSR_IE RT_BIT_32(0)
903%define X86_MXCSR_DE RT_BIT_32(1)
904%define X86_MXCSR_ZE RT_BIT_32(2)
905%define X86_MXCSR_OE RT_BIT_32(3)
906%define X86_MXCSR_UE RT_BIT_32(4)
907%define X86_MXCSR_PE RT_BIT_32(5)
908%define X86_MXCSR_DAZ RT_BIT_32(6)
909%define X86_MXCSR_IM RT_BIT_32(7)
910%define X86_MXCSR_DM RT_BIT_32(8)
911%define X86_MXCSR_ZM RT_BIT_32(9)
912%define X86_MXCSR_OM RT_BIT_32(10)
913%define X86_MXCSR_UM RT_BIT_32(11)
914%define X86_MXCSR_PM RT_BIT_32(12)
915%define X86_MXCSR_RC_MASK 0x6000
916%define X86_MXCSR_RC_NEAREST 0x0000
917%define X86_MXCSR_RC_DOWN 0x2000
918%define X86_MXCSR_RC_UP 0x4000
919%define X86_MXCSR_RC_ZERO 0x6000
920%define X86_MXCSR_FZ RT_BIT_32(15)
921%define X86_MXCSR_MM RT_BIT_32(17)
922%ifndef VBOX_FOR_DTRACE_LIB
923%endif
924%ifndef VBOX_FOR_DTRACE_LIB
925%endif
926%ifndef VBOX_FOR_DTRACE_LIB
927%endif
928%ifndef VBOX_FOR_DTRACE_LIB
929%endif
930%ifndef VBOX_FOR_DTRACE_LIB
931%endif
932%ifndef VBOX_FOR_DTRACE_LIB
933%endif
934%ifndef VBOX_FOR_DTRACE_LIB
935%endif
936%ifndef VBOX_FOR_DTRACE_LIB
937%endif
938%ifndef VBOX_FOR_DTRACE_LIB
939%endif
940%define XSAVE_C_X87_BIT 0
941%define XSAVE_C_X87 RT_BIT_64(XSAVE_C_X87_BIT)
942%define XSAVE_C_SSE_BIT 1
943%define XSAVE_C_SSE RT_BIT_64(XSAVE_C_SSE_BIT)
944%define XSAVE_C_YMM_BIT 2
945%define XSAVE_C_YMM RT_BIT_64(XSAVE_C_YMM_BIT)
946%define XSAVE_C_BNDREGS_BIT 3
947%define XSAVE_C_BNDREGS RT_BIT_64(XSAVE_C_BNDREGS_BIT)
948%define XSAVE_C_BNDCSR_BIT 4
949%define XSAVE_C_BNDCSR RT_BIT_64(XSAVE_C_BNDCSR_BIT)
950%define XSAVE_C_OPMASK_BIT 5
951%define XSAVE_C_OPMASK RT_BIT_64(XSAVE_C_OPMASK_BIT)
952%define XSAVE_C_ZMM_HI256_BIT 6
953%define XSAVE_C_ZMM_HI256 RT_BIT_64(XSAVE_C_ZMM_HI256_BIT)
954%define XSAVE_C_ZMM_16HI_BIT 7
955%define XSAVE_C_ZMM_16HI RT_BIT_64(XSAVE_C_ZMM_16HI_BIT)
956%define XSAVE_C_PKRU_BIT 9
957%define XSAVE_C_PKRU RT_BIT_64(XSAVE_C_PKRU_BIT)
958%define XSAVE_C_LWP_BIT 62
959%define XSAVE_C_LWP RT_BIT_64(XSAVE_C_LWP_BIT)
960%define XSAVE_C_X_BIT 63
961%define XSAVE_C_X RT_BIT_64(XSAVE_C_X_BIT)
962%ifndef VBOX_FOR_DTRACE_LIB
963%endif
964%define X86DESCATTR_TYPE 0x0000000f
965%define X86DESCATTR_DT 0x00000010
966%define X86DESCATTR_DPL 0x00000060
967%define X86DESCATTR_DPL_SHIFT 5
968%define X86DESCATTR_P 0x00000080
969%define X86DESCATTR_LIMIT_HIGH 0x00000f00
970%define X86DESCATTR_AVL 0x00001000
971%define X86DESCATTR_L 0x00002000
972%define X86DESCATTR_D 0x00004000
973%define X86DESCATTR_G 0x00008000
974%define X86DESCATTR_UNUSABLE 0x00010000
975%ifndef VBOX_FOR_DTRACE_LIB
976%endif
977%ifndef VBOX_FOR_DTRACE_LIB
978%define X86DESCGENERIC_BIT_OFF_LIMIT_LOW (0)
979%define X86DESCGENERIC_BIT_OFF_BASE_LOW (16)
980%define X86DESCGENERIC_BIT_OFF_BASE_HIGH1 (32)
981%define X86DESCGENERIC_BIT_OFF_TYPE (40)
982%define X86DESCGENERIC_BIT_OFF_DESC_TYPE (44)
983%define X86DESCGENERIC_BIT_OFF_DPL (45)
984%define X86DESCGENERIC_BIT_OFF_PRESENT (47)
985%define X86DESCGENERIC_BIT_OFF_LIMIT_HIGH (48)
986%define X86DESCGENERIC_BIT_OFF_AVAILABLE (52)
987%define X86DESCGENERIC_BIT_OFF_LONG (53)
988%define X86DESCGENERIC_BIT_OFF_DEF_BIG (54)
989%define X86DESCGENERIC_BIT_OFF_GRANULARITY (55)
990%define X86DESCGENERIC_BIT_OFF_BASE_HIGH2 (56)
991%define X86LAR_F_TYPE 0x0f00
992%define X86LAR_F_DT 0x1000
993%define X86LAR_F_DPL 0x6000
994%define X86LAR_F_DPL_SHIFT 13
995%define X86LAR_F_P 0x8000
996%define X86LAR_F_AVL 0x00100000
997%define X86LAR_F_L 0x00200000
998%define X86LAR_F_D 0x00400000
999%define X86LAR_F_G 0x00800000
1000%endif
1001%ifndef VBOX_FOR_DTRACE_LIB
1002%endif
1003%ifndef VBOX_FOR_DTRACE_LIB
1004%endif
1005%ifndef VBOX_FOR_DTRACE_LIB
1006%endif
1007%ifndef VBOX_FOR_DTRACE_LIB
1008%endif
1009%ifndef VBOX_FOR_DTRACE_LIB
1010%endif
1011%if HC_ARCH_BITS == 64
1012%else
1013%endif
1014%if HC_ARCH_BITS == 64
1015%else
1016%endif
1017%if HC_ARCH_BITS == 64
1018%else
1019%endif
1020%define X86_SEL_TYPE_CODE 8
1021%define X86_SEL_TYPE_MEMORY RT_BIT_32(4)
1022%define X86_SEL_TYPE_ACCESSED 1
1023%define X86_SEL_TYPE_DOWN 4
1024%define X86_SEL_TYPE_CONF 4
1025%define X86_SEL_TYPE_WRITE 2
1026%define X86_SEL_TYPE_READ 2
1027%define X86_SEL_TYPE_READ_BIT 1
1028%define X86_SEL_TYPE_RO 0
1029%define X86_SEL_TYPE_RO_ACC (0 | X86_SEL_TYPE_ACCESSED)
1030%define X86_SEL_TYPE_RW 2
1031%define X86_SEL_TYPE_RW_ACC (2 | X86_SEL_TYPE_ACCESSED)
1032%define X86_SEL_TYPE_RO_DOWN 4
1033%define X86_SEL_TYPE_RO_DOWN_ACC (4 | X86_SEL_TYPE_ACCESSED)
1034%define X86_SEL_TYPE_RW_DOWN 6
1035%define X86_SEL_TYPE_RW_DOWN_ACC (6 | X86_SEL_TYPE_ACCESSED)
1036%define X86_SEL_TYPE_EO (0 | X86_SEL_TYPE_CODE)
1037%define X86_SEL_TYPE_EO_ACC (0 | X86_SEL_TYPE_CODE | X86_SEL_TYPE_ACCESSED)
1038%define X86_SEL_TYPE_ER (2 | X86_SEL_TYPE_CODE)
1039%define X86_SEL_TYPE_ER_ACC (2 | X86_SEL_TYPE_CODE | X86_SEL_TYPE_ACCESSED)
1040%define X86_SEL_TYPE_EO_CONF (4 | X86_SEL_TYPE_CODE)
1041%define X86_SEL_TYPE_EO_CONF_ACC (4 | X86_SEL_TYPE_CODE | X86_SEL_TYPE_ACCESSED)
1042%define X86_SEL_TYPE_ER_CONF (6 | X86_SEL_TYPE_CODE)
1043%define X86_SEL_TYPE_ER_CONF_ACC (6 | X86_SEL_TYPE_CODE | X86_SEL_TYPE_ACCESSED)
1044%define X86_SEL_TYPE_SYS_TSS_BUSY_MASK 2
1045%define X86_SEL_TYPE_SYS_UNDEFINED 0
1046%define X86_SEL_TYPE_SYS_286_TSS_AVAIL 1
1047%define X86_SEL_TYPE_SYS_LDT 2
1048%define X86_SEL_TYPE_SYS_286_TSS_BUSY 3
1049%define X86_SEL_TYPE_SYS_286_CALL_GATE 4
1050%define X86_SEL_TYPE_SYS_TASK_GATE 5
1051%define X86_SEL_TYPE_SYS_286_INT_GATE 6
1052%define X86_SEL_TYPE_SYS_286_TRAP_GATE 7
1053%define X86_SEL_TYPE_SYS_UNDEFINED2 8
1054%define X86_SEL_TYPE_SYS_386_TSS_AVAIL 9
1055%define X86_SEL_TYPE_SYS_UNDEFINED3 0xA
1056%define X86_SEL_TYPE_SYS_386_TSS_BUSY 0xB
1057%define X86_SEL_TYPE_SYS_386_CALL_GATE 0xC
1058%define X86_SEL_TYPE_SYS_UNDEFINED4 0xD
1059%define X86_SEL_TYPE_SYS_386_INT_GATE 0xE
1060%define X86_SEL_TYPE_SYS_386_TRAP_GATE 0xF
1061%define AMD64_SEL_TYPE_SYS_LDT 2
1062%define AMD64_SEL_TYPE_SYS_TSS_AVAIL 9
1063%define AMD64_SEL_TYPE_SYS_TSS_BUSY 0xB
1064%define AMD64_SEL_TYPE_SYS_CALL_GATE 0xC
1065%define AMD64_SEL_TYPE_SYS_INT_GATE 0xE
1066%define AMD64_SEL_TYPE_SYS_TRAP_GATE 0xF
1067%define X86_DESC_TYPE_MASK (RT_BIT_32(8) | RT_BIT_32(9) | RT_BIT_32(10) | RT_BIT_32(11))
1068%define X86_DESC_S RT_BIT_32(12)
1069%define X86_DESC_DPL (RT_BIT_32(13) | RT_BIT_32(14))
1070%define X86_DESC_P RT_BIT_32(15)
1071%define X86_DESC_AVL RT_BIT_32(20)
1072%define X86_DESC_DB RT_BIT_32(22)
1073%define X86_DESC_G RT_BIT_32(23)
1074%define X86_SEL_TYPE_SYS_286_TSS_LIMIT_MIN 0x2b
1075%define X86_SEL_TYPE_SYS_386_TSS_LIMIT_MIN 0x67
1076%ifndef VBOX_FOR_DTRACE_LIB
1077%endif
1078%ifndef VBOX_FOR_DTRACE_LIB
1079%endif
1080%ifndef VBOX_FOR_DTRACE_LIB
1081%endif
1082%define X86_SEL_SHIFT 3
1083%define X86_SEL_MASK 0xfff8
1084%define X86_SEL_MASK_OFF_RPL 0xfffc
1085%define X86_SEL_LDT 0x0004
1086%define X86_SEL_RPL 0x0003
1087%define X86_SEL_RPL_LDT 0x0007
1088%define X86_XCPT_LAST 0x1f
1089%define X86_TRAP_ERR_EXTERNAL 1
1090%define X86_TRAP_ERR_IDT 2
1091%define X86_TRAP_ERR_TI 4
1092%define X86_TRAP_ERR_SEL_MASK 0xfff8
1093%define X86_TRAP_ERR_SEL_SHIFT 3
1094%define X86_TRAP_PF_P RT_BIT_32(0)
1095%define X86_TRAP_PF_RW RT_BIT_32(1)
1096%define X86_TRAP_PF_US RT_BIT_32(2)
1097%define X86_TRAP_PF_RSVD RT_BIT_32(3)
1098%define X86_TRAP_PF_ID RT_BIT_32(4)
1099%define X86_TRAP_PF_PK RT_BIT_32(5)
1100%ifndef VBOX_FOR_DTRACE_LIB
1101%else
1102%endif
1103%ifndef VBOX_FOR_DTRACE_LIB
1104%else
1105%endif
1106%define X86_MODRM_RM_MASK 0x07
1107%define X86_MODRM_REG_MASK 0x38
1108%define X86_MODRM_REG_SMASK 0x07
1109%define X86_MODRM_REG_SHIFT 3
1110%define X86_MODRM_MOD_MASK 0xc0
1111%define X86_MODRM_MOD_SMASK 0x03
1112%define X86_MODRM_MOD_SHIFT 6
1113%ifndef VBOX_FOR_DTRACE_LIB
1114 %define X86_MODRM_MAKE(a_Mod, a_Reg, a_RegMem) (((a_Mod) << X86_MODRM_MOD_SHIFT) | ((a_Reg) << X86_MODRM_REG_SHIFT) | (a_RegMem))
1115%endif
1116%define X86_SIB_BASE_MASK 0x07
1117%define X86_SIB_INDEX_MASK 0x38
1118%define X86_SIB_INDEX_SMASK 0x07
1119%define X86_SIB_INDEX_SHIFT 3
1120%define X86_SIB_SCALE_MASK 0xc0
1121%define X86_SIB_SCALE_SMASK 0x03
1122%define X86_SIB_SCALE_SHIFT 6
1123%ifndef VBOX_FOR_DTRACE_LIB
1124%endif
1125%define X86_GREG_xAX 0
1126%define X86_GREG_xCX 1
1127%define X86_GREG_xDX 2
1128%define X86_GREG_xBX 3
1129%define X86_GREG_xSP 4
1130%define X86_GREG_xBP 5
1131%define X86_GREG_xSI 6
1132%define X86_GREG_xDI 7
1133%define X86_GREG_x8 8
1134%define X86_GREG_x9 9
1135%define X86_GREG_x10 10
1136%define X86_GREG_x11 11
1137%define X86_GREG_x12 12
1138%define X86_GREG_x13 13
1139%define X86_GREG_x14 14
1140%define X86_GREG_x15 15
1141%define X86_SREG_ES 0
1142%define X86_SREG_CS 1
1143%define X86_SREG_SS 2
1144%define X86_SREG_DS 3
1145%define X86_SREG_FS 4
1146%define X86_SREG_GS 5
1147%define X86_SREG_COUNT 6
1148%define X86_OP_PRF_CS 0x2e
1149%define X86_OP_PRF_SS 0x36
1150%define X86_OP_PRF_DS 0x3e
1151%define X86_OP_PRF_ES 0x26
1152%define X86_OP_PRF_FS 0x64
1153%define X86_OP_PRF_GS 0x65
1154%define X86_OP_PRF_SIZE_OP 0x66
1155%define X86_OP_PRF_SIZE_ADDR 0x67
1156%define X86_OP_PRF_LOCK 0xf0
1157%define X86_OP_PRF_REPZ 0xf3
1158%define X86_OP_PRF_REPNZ 0xf2
1159%define X86_OP_REX_B 0x41
1160%define X86_OP_REX_X 0x42
1161%define X86_OP_REX_R 0x44
1162%define X86_OP_REX_W 0x48
1163%endif
1164%include "iprt/x86extra.mac"
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette