VirtualBox

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

Last change on this file since 53420 was 52465, checked in by vboxsync, 10 years ago

VMM: Fix IEM FXSAVE implementation to match the logic in HM/raw-mode FPU handling.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 37.9 KB
Line 
1%ifndef ___iprt_x86_h
2%define ___iprt_x86_h
3%ifndef VBOX_FOR_DTRACE_LIB
4%else
5%endif
6%ifdef RT_OS_SOLARIS
7%endif
8%ifndef VBOX_FOR_DTRACE_LIB
9%endif
10%ifndef VBOX_FOR_DTRACE_LIB
11%endif
12%ifndef VBOX_FOR_DTRACE_LIB
13%endif
14%define X86_EFL_CF RT_BIT(0)
15%define X86_EFL_CF_BIT 0
16%define X86_EFL_1 RT_BIT(1)
17%define X86_EFL_PF RT_BIT(2)
18%define X86_EFL_AF RT_BIT(4)
19%define X86_EFL_AF_BIT 4
20%define X86_EFL_ZF RT_BIT(6)
21%define X86_EFL_ZF_BIT 6
22%define X86_EFL_SF RT_BIT(7)
23%define X86_EFL_SF_BIT 7
24%define X86_EFL_TF RT_BIT(8)
25%define X86_EFL_IF RT_BIT(9)
26%define X86_EFL_DF RT_BIT(10)
27%define X86_EFL_OF RT_BIT(11)
28%define X86_EFL_OF_BIT 11
29%define X86_EFL_IOPL (RT_BIT(12) | RT_BIT(13))
30%define X86_EFL_NT RT_BIT(14)
31%define X86_EFL_RF RT_BIT(16)
32%define X86_EFL_VM RT_BIT(17)
33%define X86_EFL_AC RT_BIT(18)
34%define X86_EFL_VIF RT_BIT(19)
35%define X86_EFL_VIP RT_BIT(20)
36%define X86_EFL_ID RT_BIT(21)
37%define X86_EFL_LIVE_MASK 0x003f7fd5
38%define X86_EFL_RA1_MASK RT_BIT_32(1)
39%define X86_EFL_IOPL_SHIFT 12
40%define X86_EFL_GET_IOPL(efl) (((efl) >> X86_EFL_IOPL_SHIFT) & 3)
41%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 \
42 | X86_EFL_DF | X86_EFL_OF | X86_EFL_IOPL | X86_EFL_NT | X86_EFL_AC | X86_EFL_ID )
43%define X86_EFL_STATUS_BITS ( X86_EFL_CF | X86_EFL_PF | X86_EFL_AF | X86_EFL_ZF | X86_EFL_SF | X86_EFL_OF )
44%ifndef VBOX_FOR_DTRACE_LIB
45%else
46%endif
47%ifndef VBOX_FOR_DTRACE_LIB
48%else
49%endif
50%define X86_CPUID_VENDOR_INTEL_EBX 0x756e6547
51%define X86_CPUID_VENDOR_INTEL_ECX 0x6c65746e
52%define X86_CPUID_VENDOR_INTEL_EDX 0x49656e69
53%define X86_CPUID_VENDOR_AMD_EBX 0x68747541
54%define X86_CPUID_VENDOR_AMD_ECX 0x444d4163
55%define X86_CPUID_VENDOR_AMD_EDX 0x69746e65
56%define X86_CPUID_VENDOR_VIA_EBX 0x746e6543
57%define X86_CPUID_VENDOR_VIA_ECX 0x736c7561
58%define X86_CPUID_VENDOR_VIA_EDX 0x48727561
59%define X86_CPUID_FEATURE_ECX_SSE3 RT_BIT(0)
60%define X86_CPUID_FEATURE_ECX_PCLMUL RT_BIT(1)
61%define X86_CPUID_FEATURE_ECX_DTES64 RT_BIT(2)
62%define X86_CPUID_FEATURE_ECX_MONITOR RT_BIT(3)
63%define X86_CPUID_FEATURE_ECX_CPLDS RT_BIT(4)
64%define X86_CPUID_FEATURE_ECX_VMX RT_BIT(5)
65%define X86_CPUID_FEATURE_ECX_SMX RT_BIT(6)
66%define X86_CPUID_FEATURE_ECX_EST RT_BIT(7)
67%define X86_CPUID_FEATURE_ECX_TM2 RT_BIT(8)
68%define X86_CPUID_FEATURE_ECX_SSSE3 RT_BIT(9)
69%define X86_CPUID_FEATURE_ECX_CNTXID RT_BIT(10)
70%define X86_CPUID_FEATURE_ECX_FMA RT_BIT(12)
71%define X86_CPUID_FEATURE_ECX_CX16 RT_BIT(13)
72%define X86_CPUID_FEATURE_ECX_TPRUPDATE RT_BIT(14)
73%define X86_CPUID_FEATURE_ECX_PDCM RT_BIT(15)
74%define X86_CPUID_FEATURE_ECX_PCID RT_BIT(17)
75%define X86_CPUID_FEATURE_ECX_DCA RT_BIT(18)
76%define X86_CPUID_FEATURE_ECX_SSE4_1 RT_BIT(19)
77%define X86_CPUID_FEATURE_ECX_SSE4_2 RT_BIT(20)
78%define X86_CPUID_FEATURE_ECX_X2APIC RT_BIT(21)
79%define X86_CPUID_FEATURE_ECX_MOVBE RT_BIT(22)
80%define X86_CPUID_FEATURE_ECX_POPCNT RT_BIT(23)
81%define X86_CPUID_FEATURE_ECX_TSCDEADL RT_BIT(24)
82%define X86_CPUID_FEATURE_ECX_AES RT_BIT(25)
83%define X86_CPUID_FEATURE_ECX_XSAVE RT_BIT(26)
84%define X86_CPUID_FEATURE_ECX_OSXSAVE RT_BIT(27)
85%define X86_CPUID_FEATURE_ECX_AVX RT_BIT(28)
86%define X86_CPUID_FEATURE_ECX_F16C RT_BIT(29)
87%define X86_CPUID_FEATURE_ECX_RDRAND RT_BIT(30)
88%define X86_CPUID_FEATURE_ECX_HVP RT_BIT(31)
89%define X86_CPUID_FEATURE_EDX_FPU RT_BIT(0)
90%define X86_CPUID_FEATURE_EDX_VME RT_BIT(1)
91%define X86_CPUID_FEATURE_EDX_DE RT_BIT(2)
92%define X86_CPUID_FEATURE_EDX_PSE RT_BIT(3)
93%define X86_CPUID_FEATURE_EDX_TSC RT_BIT(4)
94%define X86_CPUID_FEATURE_EDX_MSR RT_BIT(5)
95%define X86_CPUID_FEATURE_EDX_PAE RT_BIT(6)
96%define X86_CPUID_FEATURE_EDX_MCE RT_BIT(7)
97%define X86_CPUID_FEATURE_EDX_CX8 RT_BIT(8)
98%define X86_CPUID_FEATURE_EDX_APIC RT_BIT(9)
99%define X86_CPUID_FEATURE_EDX_SEP RT_BIT(11)
100%define X86_CPUID_FEATURE_EDX_MTRR RT_BIT(12)
101%define X86_CPUID_FEATURE_EDX_PGE RT_BIT(13)
102%define X86_CPUID_FEATURE_EDX_MCA RT_BIT(14)
103%define X86_CPUID_FEATURE_EDX_CMOV RT_BIT(15)
104%define X86_CPUID_FEATURE_EDX_PAT RT_BIT(16)
105%define X86_CPUID_FEATURE_EDX_PSE36 RT_BIT(17)
106%define X86_CPUID_FEATURE_EDX_PSN RT_BIT(18)
107%define X86_CPUID_FEATURE_EDX_CLFSH RT_BIT(19)
108%define X86_CPUID_FEATURE_EDX_DS RT_BIT(21)
109%define X86_CPUID_FEATURE_EDX_ACPI RT_BIT(22)
110%define X86_CPUID_FEATURE_EDX_MMX RT_BIT(23)
111%define X86_CPUID_FEATURE_EDX_FXSR RT_BIT(24)
112%define X86_CPUID_FEATURE_EDX_SSE RT_BIT(25)
113%define X86_CPUID_FEATURE_EDX_SSE2 RT_BIT(26)
114%define X86_CPUID_FEATURE_EDX_SS RT_BIT(27)
115%define X86_CPUID_FEATURE_EDX_HTT RT_BIT(28)
116%define X86_CPUID_FEATURE_EDX_TM RT_BIT(29)
117%define X86_CPUID_FEATURE_EDX_PBE RT_BIT(31)
118%define X86_CPUID_MWAIT_ECX_EXT RT_BIT(0)
119%define X86_CPUID_MWAIT_ECX_BREAKIRQIF0 RT_BIT(1)
120%define X86_CPUID_EXT_FEATURE_ECX_LAHF_SAHF RT_BIT(0)
121%define X86_CPUID_EXT_FEATURE_EDX_SYSCALL RT_BIT(11)
122%define X86_CPUID_EXT_FEATURE_EDX_NX RT_BIT(20)
123%define X86_CPUID_EXT_FEATURE_EDX_PAGE1GB RT_BIT(26)
124%define X86_CPUID_EXT_FEATURE_EDX_RDTSCP RT_BIT(27)
125%define X86_CPUID_EXT_FEATURE_EDX_LONG_MODE RT_BIT(29)
126%define X86_CPUID_AMD_FEATURE_EDX_FPU RT_BIT(0)
127%define X86_CPUID_AMD_FEATURE_EDX_VME RT_BIT(1)
128%define X86_CPUID_AMD_FEATURE_EDX_DE RT_BIT(2)
129%define X86_CPUID_AMD_FEATURE_EDX_PSE RT_BIT(3)
130%define X86_CPUID_AMD_FEATURE_EDX_TSC RT_BIT(4)
131%define X86_CPUID_AMD_FEATURE_EDX_MSR RT_BIT(5)
132%define X86_CPUID_AMD_FEATURE_EDX_PAE RT_BIT(6)
133%define X86_CPUID_AMD_FEATURE_EDX_MCE RT_BIT(7)
134%define X86_CPUID_AMD_FEATURE_EDX_CX8 RT_BIT(8)
135%define X86_CPUID_AMD_FEATURE_EDX_APIC RT_BIT(9)
136%define X86_CPUID_AMD_FEATURE_EDX_MTRR RT_BIT(12)
137%define X86_CPUID_AMD_FEATURE_EDX_PGE RT_BIT(13)
138%define X86_CPUID_AMD_FEATURE_EDX_MCA RT_BIT(14)
139%define X86_CPUID_AMD_FEATURE_EDX_CMOV RT_BIT(15)
140%define X86_CPUID_AMD_FEATURE_EDX_PAT RT_BIT(16)
141%define X86_CPUID_AMD_FEATURE_EDX_PSE36 RT_BIT(17)
142%define X86_CPUID_AMD_FEATURE_EDX_AXMMX RT_BIT(22)
143%define X86_CPUID_AMD_FEATURE_EDX_MMX RT_BIT(23)
144%define X86_CPUID_AMD_FEATURE_EDX_FXSR RT_BIT(24)
145%define X86_CPUID_AMD_FEATURE_EDX_FFXSR RT_BIT(25)
146%define X86_CPUID_AMD_FEATURE_EDX_3DNOW_EX RT_BIT(30)
147%define X86_CPUID_AMD_FEATURE_EDX_3DNOW RT_BIT(31)
148%define X86_CPUID_AMD_FEATURE_ECX_CMPL RT_BIT(1)
149%define X86_CPUID_AMD_FEATURE_ECX_SVM RT_BIT(2)
150%define X86_CPUID_AMD_FEATURE_ECX_EXT_APIC RT_BIT(3)
151%define X86_CPUID_AMD_FEATURE_ECX_CR8L RT_BIT(4)
152%define X86_CPUID_AMD_FEATURE_ECX_ABM RT_BIT(5)
153%define X86_CPUID_AMD_FEATURE_ECX_SSE4A RT_BIT(6)
154%define X86_CPUID_AMD_FEATURE_ECX_MISALNSSE RT_BIT(7)
155%define X86_CPUID_AMD_FEATURE_ECX_3DNOWPRF RT_BIT(8)
156%define X86_CPUID_AMD_FEATURE_ECX_OSVW RT_BIT(9)
157%define X86_CPUID_AMD_FEATURE_ECX_IBS RT_BIT(10)
158%define X86_CPUID_AMD_FEATURE_ECX_SSE5 RT_BIT(11)
159%define X86_CPUID_AMD_FEATURE_ECX_SKINIT RT_BIT(12)
160%define X86_CPUID_AMD_FEATURE_ECX_WDT RT_BIT(13)
161%define X86_CPUID_AMD_ADVPOWER_EDX_TS RT_BIT(0)
162%define X86_CPUID_AMD_ADVPOWER_EDX_FID RT_BIT(1)
163%define X86_CPUID_AMD_ADVPOWER_EDX_VID RT_BIT(2)
164%define X86_CPUID_AMD_ADVPOWER_EDX_TTP RT_BIT(3)
165%define X86_CPUID_AMD_ADVPOWER_EDX_TM RT_BIT(4)
166%define X86_CPUID_AMD_ADVPOWER_EDX_STC RT_BIT(5)
167%define X86_CPUID_AMD_ADVPOWER_EDX_MC RT_BIT(6)
168%define X86_CPUID_AMD_ADVPOWER_EDX_HWPSTATE RT_BIT(7)
169%define X86_CPUID_AMD_ADVPOWER_EDX_TSCINVAR RT_BIT(8)
170%define X86_CR0_PE RT_BIT(0)
171%define X86_CR0_PROTECTION_ENABLE RT_BIT(0)
172%define X86_CR0_MP RT_BIT(1)
173%define X86_CR0_MONITOR_COPROCESSOR RT_BIT(1)
174%define X86_CR0_EM RT_BIT(2)
175%define X86_CR0_EMULATE_FPU RT_BIT(2)
176%define X86_CR0_TS RT_BIT(3)
177%define X86_CR0_TASK_SWITCH RT_BIT(3)
178%define X86_CR0_ET RT_BIT(4)
179%define X86_CR0_EXTENSION_TYPE RT_BIT(4)
180%define X86_CR0_NE RT_BIT(5)
181%define X86_CR0_NUMERIC_ERROR RT_BIT(5)
182%define X86_CR0_WP RT_BIT(16)
183%define X86_CR0_WRITE_PROTECT RT_BIT(16)
184%define X86_CR0_AM RT_BIT(18)
185%define X86_CR0_ALIGMENT_MASK RT_BIT(18)
186%define X86_CR0_NW RT_BIT(29)
187%define X86_CR0_NOT_WRITE_THROUGH RT_BIT(29)
188%define X86_CR0_CD RT_BIT(30)
189%define X86_CR0_CACHE_DISABLE RT_BIT(30)
190%define X86_CR0_PG RT_BIT(31)
191%define X86_CR0_PAGING RT_BIT(31)
192%define X86_CR3_PWT RT_BIT(3)
193%define X86_CR3_PCD RT_BIT(4)
194%define X86_CR3_PAGE_MASK (0xfffff000)
195%define X86_CR3_PAE_PAGE_MASK (0xffffffe0)
196%define X86_CR3_AMD64_PAGE_MASK 0x000ffffffffff000
197%define X86_CR4_VME RT_BIT(0)
198%define X86_CR4_PVI RT_BIT(1)
199%define X86_CR4_TSD RT_BIT(2)
200%define X86_CR4_DE RT_BIT(3)
201%define X86_CR4_PSE RT_BIT(4)
202%define X86_CR4_PAE RT_BIT(5)
203%define X86_CR4_MCE RT_BIT(6)
204%define X86_CR4_PGE RT_BIT(7)
205%define X86_CR4_PCE RT_BIT(8)
206%define X86_CR4_OSFSXR RT_BIT(9)
207%define X86_CR4_OSXMMEEXCPT RT_BIT(10)
208%define X86_CR4_VMXE RT_BIT(13)
209%define X86_CR4_SMXE RT_BIT(14)
210%define X86_CR4_PCIDE RT_BIT(17)
211%define X86_CR4_OSXSAVE RT_BIT(18)
212%define X86_CR4_SMEP RT_BIT(20)
213%define X86_CR4_SMAP RT_BIT(21)
214%define X86_DR6_B0 RT_BIT(0)
215%define X86_DR6_B1 RT_BIT(1)
216%define X86_DR6_B2 RT_BIT(2)
217%define X86_DR6_B3 RT_BIT(3)
218%define X86_DR6_B_MASK 0x0000000f
219%define X86_DR6_BD RT_BIT(13)
220%define X86_DR6_BS RT_BIT(14)
221%define X86_DR6_BT RT_BIT(15)
222%define X86_DR6_INIT_VAL 0xFFFF0FF0
223%define X86_DR6_RA1_MASK 0xffff0ff0
224%define X86_DR6_RAZ_MASK RT_BIT_64(12)
225%define X86_DR6_MBZ_MASK 0xffffffff00000000
226%define X86_DR6_B(iBp) RT_BIT_64(iBp)
227%define X86_DR7_L0 RT_BIT(0)
228%define X86_DR7_G0 RT_BIT(1)
229%define X86_DR7_L1 RT_BIT(2)
230%define X86_DR7_G1 RT_BIT(3)
231%define X86_DR7_L2 RT_BIT(4)
232%define X86_DR7_G2 RT_BIT(5)
233%define X86_DR7_L3 RT_BIT(6)
234%define X86_DR7_G3 RT_BIT(7)
235%define X86_DR7_LE RT_BIT(8)
236%define X86_DR7_GE RT_BIT(9)
237%define X86_DR7_LE_ALL 0x0000000000000055
238%define X86_DR7_GE_ALL 0x00000000000000aa
239%define X86_DR7_GD RT_BIT(13)
240%define X86_DR7_RW0_MASK (3 << 16)
241%define X86_DR7_LEN0_MASK (3 << 18)
242%define X86_DR7_RW1_MASK (3 << 20)
243%define X86_DR7_LEN1_MASK (3 << 22)
244%define X86_DR7_RW2_MASK (3 << 24)
245%define X86_DR7_LEN2_MASK (3 << 26)
246%define X86_DR7_RW3_MASK (3 << 28)
247%define X86_DR7_LEN3_MASK (3 << 30)
248%define X86_DR7_RA1_MASK (RT_BIT(10))
249%define X86_DR7_RAZ_MASK 0x0000d800
250%define X86_DR7_MBZ_MASK 0xffffffff00000000
251%define X86_DR7_L(iBp) ( 1 << (iBp * 2) )
252%define X86_DR7_G(iBp) ( 1 << (iBp * 2 + 1) )
253%define X86_DR7_L_G(iBp) ( 3 << (iBp * 2) )
254%define X86_DR7_RW_EO 0
255%define X86_DR7_RW_WO 1
256%define X86_DR7_RW_IO 2
257%define X86_DR7_RW_RW 3
258%define X86_DR7_RW(iBp, fRw) ( (fRw) << ((iBp) * 4 + 16) )
259%define X86_DR7_GET_RW(uDR7, iBp) ( ( (uDR7) >> ((iBp) * 4 + 16) ) & 3 )
260%define X86_DR7_RW_ALL_MASKS 0x33330000
261%define X86_DR7_ANY_RW_IO(uDR7) \
262 ( ( 0x22220000 & (uDR7) )
263%define X86_DR7_LEN_BYTE 0
264%define X86_DR7_LEN_WORD 1
265%define X86_DR7_LEN_QWORD 2
266%define X86_DR7_LEN_DWORD 3
267%define X86_DR7_LEN(iBp, cb) ( (cb) << ((iBp) * 4 + 18) )
268%define X86_DR7_GET_LEN(uDR7, iBp) ( ( (uDR7) >> ((iBp) * 4 + 18) ) & 0x3 )
269%define X86_DR7_ENABLED_MASK 0x000000ff
270%define X86_DR7_LEN_ALL_MASKS 0xcccc0000
271%define X86_DR7_RW_LEN_ALL_MASKS 0xffff0000
272%define X86_DR7_INIT_VAL 0x400
273%define X86_OFF_FXSTATE_RSVD 0x1d0
274%define X86_FXSTATE_RSVD_32BIT_MAGIC 0x32b3232b
275%define MSR_P5_MC_ADDR 0x00000000
276%define MSR_P5_MC_TYPE 0x00000001
277%define MSR_IA32_TSC 0x10
278%define MSR_IA32_CESR 0x00000011
279%define MSR_IA32_CTR0 0x00000012
280%define MSR_IA32_CTR1 0x00000013
281%define MSR_IA32_PLATFORM_ID 0x17
282%ifndef MSR_IA32_APICBASE
283 %define MSR_IA32_APICBASE 0x1b
284 %define MSR_IA32_APICBASE_EN RT_BIT_64(11)
285 %define MSR_IA32_APICBASE_EXTD RT_BIT_64(10)
286 %define MSR_IA32_APICBASE_BSP RT_BIT_64(8)
287 %define MSR_IA32_APICBASE_BASE_MIN 0x0000000ffffff000
288%endif
289%define MSR_CORE_THREAD_COUNT 0x35
290%define MSR_IA32_FEATURE_CONTROL 0x3A
291%define MSR_IA32_FEATURE_CONTROL_LOCK RT_BIT(0)
292%define MSR_IA32_FEATURE_CONTROL_SMX_VMXON RT_BIT(1)
293%define MSR_IA32_FEATURE_CONTROL_VMXON RT_BIT(2)
294%define MSR_IA32_BIOS_UPDT_TRIG 0x79
295%define MSR_IA32_BIOS_SIGN_ID 0x8B
296%define MSR_IA32_PMC0 0xC1
297%define MSR_IA32_PMC1 0xC2
298%define MSR_IA32_PMC2 0xC3
299%define MSR_IA32_PMC3 0xC4
300%define MSR_IA32_PLATFORM_INFO 0xCE
301%define MSR_IA32_FSB_CLOCK_STS 0xCD
302%define MSR_PKG_CST_CONFIG_CONTROL 0x000000e2
303%define MSR_IA32_MPERF 0xE7
304%define MSR_IA32_APERF 0xE8
305%define MSR_IA32_MTRR_CAP 0xFE
306%define MSR_BBL_CR_CTL3 0x11e
307%ifndef MSR_IA32_SYSENTER_CS
308%define MSR_IA32_SYSENTER_CS 0x174
309%define MSR_IA32_SYSENTER_ESP 0x175
310%define MSR_IA32_SYSENTER_EIP 0x176
311%endif
312%define MSR_IA32_MCG_CAP 0x179
313%define MSR_IA32_MCG_STATUS 0x17A
314%define MSR_IA32_MCG_CTRL 0x17B
315%define MSR_IA32_CR_PAT 0x277
316%define MSR_IA32_PERFEVTSEL0 0x186
317%define MSR_IA32_PERFEVTSEL1 0x187
318%define MSR_FLEX_RATIO 0x194
319%define MSR_IA32_PERF_STATUS 0x198
320%define MSR_IA32_PERF_CTL 0x199
321%define MSR_IA32_THERM_STATUS 0x19c
322%define MSR_IA32_MISC_ENABLE 0x1A0
323%define MSR_IA32_MISC_ENABLE_FAST_STRINGS RT_BIT_64(0)
324%define MSR_IA32_MISC_ENABLE_TCC RT_BIT_64(3)
325%define MSR_IA32_MISC_ENABLE_PERF_MON RT_BIT_64(7)
326%define MSR_IA32_MISC_ENABLE_BTS_UNAVAIL RT_BIT_64(11)
327%define MSR_IA32_MISC_ENABLE_PEBS_UNAVAIL RT_BIT_64(12)
328%define MSR_IA32_MISC_ENABLE_SST_ENABLE RT_BIT_64(16)
329%define MSR_IA32_MISC_ENABLE_MONITOR RT_BIT_64(18)
330%define MSR_IA32_MISC_ENABLE_LIMIT_CPUID RT_BIT_64(22)
331%define MSR_IA32_MISC_ENABLE_XTPR_MSG_DISABLE RT_BIT_64(23)
332%define MSR_IA32_MISC_ENABLE_XD_DISABLE RT_BIT_64(34)
333%define MSR_IA32_DEBUGCTL 0x000001d9
334%define MSR_P4_LASTBRANCH_TOS 0x000001da
335%define MSR_P4_LASTBRANCH_0 0x000001db
336%define MSR_P4_LASTBRANCH_1 0x000001dc
337%define MSR_P4_LASTBRANCH_2 0x000001dd
338%define MSR_P4_LASTBRANCH_3 0x000001de
339%define IA32_MTRR_PHYSBASE0 0x200
340%define IA32_MTRR_PHYSMASK0 0x201
341%define IA32_MTRR_PHYSBASE1 0x202
342%define IA32_MTRR_PHYSMASK1 0x203
343%define IA32_MTRR_PHYSBASE2 0x204
344%define IA32_MTRR_PHYSMASK2 0x205
345%define IA32_MTRR_PHYSBASE3 0x206
346%define IA32_MTRR_PHYSMASK3 0x207
347%define IA32_MTRR_PHYSBASE4 0x208
348%define IA32_MTRR_PHYSMASK4 0x209
349%define IA32_MTRR_PHYSBASE5 0x20a
350%define IA32_MTRR_PHYSMASK5 0x20b
351%define IA32_MTRR_PHYSBASE6 0x20c
352%define IA32_MTRR_PHYSMASK6 0x20d
353%define IA32_MTRR_PHYSBASE7 0x20e
354%define IA32_MTRR_PHYSMASK7 0x20f
355%define IA32_MTRR_PHYSBASE8 0x210
356%define IA32_MTRR_PHYSMASK8 0x211
357%define IA32_MTRR_PHYSBASE9 0x212
358%define IA32_MTRR_PHYSMASK9 0x213
359%define IA32_MTRR_FIX64K_00000 0x250
360%define IA32_MTRR_FIX16K_80000 0x258
361%define IA32_MTRR_FIX16K_A0000 0x259
362%define IA32_MTRR_FIX4K_C0000 0x268
363%define IA32_MTRR_FIX4K_C8000 0x269
364%define IA32_MTRR_FIX4K_D0000 0x26a
365%define IA32_MTRR_FIX4K_D8000 0x26b
366%define IA32_MTRR_FIX4K_E0000 0x26c
367%define IA32_MTRR_FIX4K_E8000 0x26d
368%define IA32_MTRR_FIX4K_F0000 0x26e
369%define IA32_MTRR_FIX4K_F8000 0x26f
370%define MSR_IA32_MTRR_DEF_TYPE 0x2FF
371%define MSR_IA32_MC0_CTL 0x400
372%define MSR_IA32_MC0_STATUS 0x401
373%define MSR_IA32_VMX_BASIC_INFO 0x480
374%define MSR_IA32_VMX_PINBASED_CTLS 0x481
375%define MSR_IA32_VMX_PROCBASED_CTLS 0x482
376%define MSR_IA32_VMX_EXIT_CTLS 0x483
377%define MSR_IA32_VMX_ENTRY_CTLS 0x484
378%define MSR_IA32_VMX_MISC 0x485
379%define MSR_IA32_VMX_CR0_FIXED0 0x486
380%define MSR_IA32_VMX_CR0_FIXED1 0x487
381%define MSR_IA32_VMX_CR4_FIXED0 0x488
382%define MSR_IA32_VMX_CR4_FIXED1 0x489
383%define MSR_IA32_VMX_VMCS_ENUM 0x48A
384%define MSR_IA32_VMX_VMFUNC 0x491
385%define MSR_IA32_VMX_PROCBASED_CTLS2 0x48B
386%define MSR_IA32_VMX_EPT_VPID_CAP 0x48C
387%define MSR_IA32_DS_AREA 0x600
388%define MSR_RAPL_POWER_UNIT 0x606
389%define MSR_IA32_X2APIC_START 0x800
390%define MSR_IA32_X2APIC_TPR 0x808
391%define MSR_IA32_X2APIC_END 0xBFF
392%define MSR_K6_EFER 0xc0000080
393%define MSR_K6_EFER_SCE RT_BIT(0)
394%define MSR_K6_EFER_LME RT_BIT(8)
395%define MSR_K6_EFER_LMA RT_BIT(10)
396%define MSR_K6_EFER_NXE RT_BIT(11)
397%define MSR_K6_EFER_SVME RT_BIT(12)
398%define MSR_K6_EFER_LMSLE RT_BIT(13)
399%define MSR_K6_EFER_FFXSR RT_BIT(14)
400%define MSR_K6_STAR 0xc0000081
401%define MSR_K6_STAR_SYSRET_CS_SS_SHIFT 48
402%define MSR_K6_STAR_SYSCALL_CS_SS_SHIFT 32
403%define MSR_K6_STAR_SEL_MASK 0xffff
404%define MSR_K6_STAR_SYSCALL_EIP_MASK 0xffffffff
405%define MSR_K6_WHCR 0xc0000082
406%define MSR_K6_UWCCR 0xc0000085
407%define MSR_K6_PSOR 0xc0000087
408%define MSR_K6_PFIR 0xc0000088
409%define MSR_K7_EVNTSEL0 0xc0010000
410%define MSR_K7_EVNTSEL1 0xc0010001
411%define MSR_K7_EVNTSEL2 0xc0010002
412%define MSR_K7_EVNTSEL3 0xc0010003
413%define MSR_K7_PERFCTR0 0xc0010004
414%define MSR_K7_PERFCTR1 0xc0010005
415%define MSR_K7_PERFCTR2 0xc0010006
416%define MSR_K7_PERFCTR3 0xc0010007
417%define MSR_K8_LSTAR 0xc0000082
418%define MSR_K8_CSTAR 0xc0000083
419%define MSR_K8_SF_MASK 0xc0000084
420%define MSR_K8_FS_BASE 0xc0000100
421%define MSR_K8_GS_BASE 0xc0000101
422%define MSR_K8_KERNEL_GS_BASE 0xc0000102
423%define MSR_K8_TSC_AUX 0xc0000103
424%define MSR_K8_SYSCFG 0xc0010010
425%define MSR_K8_HWCR 0xc0010015
426%define MSR_K8_IORRBASE0 0xc0010016
427%define MSR_K8_IORRMASK0 0xc0010017
428%define MSR_K8_IORRBASE1 0xc0010018
429%define MSR_K8_IORRMASK1 0xc0010019
430%define MSR_K8_TOP_MEM1 0xc001001a
431%define MSR_K8_TOP_MEM2 0xc001001d
432%define MSR_K8_NB_CFG 0xc001001f
433%define MSR_K8_INT_PENDING 0xc0010055
434%define MSR_K8_VM_CR 0xc0010114
435%define MSR_K8_VM_CR_SVM_DISABLE RT_BIT(4)
436%define MSR_K8_IGNNE 0xc0010115
437%define MSR_K8_SMM_CTL 0xc0010116
438%define MSR_K8_VM_HSAVE_PA 0xc0010117
439%define X86_PG_ENTRIES 1024
440%define X86_PG_PAE_ENTRIES 512
441%define X86_PG_PAE_PDPE_ENTRIES 4
442%define X86_PG_AMD64_ENTRIES X86_PG_PAE_ENTRIES
443%define X86_PG_AMD64_PDPE_ENTRIES X86_PG_AMD64_ENTRIES
444%define X86_PAGE_4K_SIZE _4K
445%define X86_PAGE_4K_SHIFT 12
446%define X86_PAGE_4K_OFFSET_MASK 0xfff
447%define X86_PAGE_4K_BASE_MASK 0xfffffffffffff000
448%define X86_PAGE_4K_BASE_MASK_32 0xfffff000
449%define X86_PAGE_2M_SIZE _2M
450%define X86_PAGE_2M_SHIFT 21
451%define X86_PAGE_2M_OFFSET_MASK 0x001fffff
452%define X86_PAGE_2M_BASE_MASK 0xffffffffffe00000
453%define X86_PAGE_2M_BASE_MASK_32 0xffe00000
454%define X86_PAGE_4M_SIZE _4M
455%define X86_PAGE_4M_SHIFT 22
456%define X86_PAGE_4M_OFFSET_MASK 0x003fffff
457%define X86_PAGE_4M_BASE_MASK 0xffffffffffc00000
458%define X86_PAGE_4M_BASE_MASK_32 0xffc00000
459%define X86_IS_CANONICAL(a_u64Addr) ((uint64_t)(a_u64Addr) + 0x800000000000 < UINT64_C(0x1000000000000))
460%define X86_PTE_BIT_P 0
461%define X86_PTE_BIT_RW 1
462%define X86_PTE_BIT_US 2
463%define X86_PTE_BIT_PWT 3
464%define X86_PTE_BIT_PCD 4
465%define X86_PTE_BIT_A 5
466%define X86_PTE_BIT_D 6
467%define X86_PTE_BIT_PAT 7
468%define X86_PTE_BIT_G 8
469%define X86_PTE_P RT_BIT(0)
470%define X86_PTE_RW RT_BIT(1)
471%define X86_PTE_US RT_BIT(2)
472%define X86_PTE_PWT RT_BIT(3)
473%define X86_PTE_PCD RT_BIT(4)
474%define X86_PTE_A RT_BIT(5)
475%define X86_PTE_D RT_BIT(6)
476%define X86_PTE_PAT RT_BIT(7)
477%define X86_PTE_G RT_BIT(8)
478%define X86_PTE_AVL_MASK (RT_BIT(9) | RT_BIT(10) | RT_BIT(11))
479%define X86_PTE_PG_MASK ( 0xfffff000 )
480%define X86_PTE_PAE_PG_MASK 0x000ffffffffff000
481%define X86_PTE_PAE_NX RT_BIT_64(63)
482%define X86_PTE_PAE_MBZ_MASK_NX 0x7ff0000000000000
483%define X86_PTE_PAE_MBZ_MASK_NO_NX 0xfff0000000000000
484%define X86_PTE_LM_MBZ_MASK_NX 0x0000000000000000
485%define X86_PTE_LM_MBZ_MASK_NO_NX 0x8000000000000000
486%define X86_PT_SHIFT 12
487%define X86_PT_MASK 0x3ff
488%define X86_PT_PAE_SHIFT 12
489%define X86_PT_PAE_MASK 0x1ff
490%define X86_PDE_P RT_BIT(0)
491%define X86_PDE_RW RT_BIT(1)
492%define X86_PDE_US RT_BIT(2)
493%define X86_PDE_PWT RT_BIT(3)
494%define X86_PDE_PCD RT_BIT(4)
495%define X86_PDE_A RT_BIT(5)
496%define X86_PDE_PS RT_BIT(7)
497%define X86_PDE_AVL_MASK (RT_BIT(9) | RT_BIT(10) | RT_BIT(11))
498%define X86_PDE_PG_MASK ( 0xfffff000 )
499%define X86_PDE_PAE_PG_MASK 0x000ffffffffff000
500%define X86_PDE_PAE_NX RT_BIT_64(63)
501%define X86_PDE_PAE_MBZ_MASK_NX 0x7ff0000000000080
502%define X86_PDE_PAE_MBZ_MASK_NO_NX 0xfff0000000000080
503%define X86_PDE_LM_MBZ_MASK_NX 0x0000000000000080
504%define X86_PDE_LM_MBZ_MASK_NO_NX 0x8000000000000080
505%define X86_PDE4M_P RT_BIT(0)
506%define X86_PDE4M_RW RT_BIT(1)
507%define X86_PDE4M_US RT_BIT(2)
508%define X86_PDE4M_PWT RT_BIT(3)
509%define X86_PDE4M_PCD RT_BIT(4)
510%define X86_PDE4M_A RT_BIT(5)
511%define X86_PDE4M_D RT_BIT(6)
512%define X86_PDE4M_PS RT_BIT(7)
513%define X86_PDE4M_G RT_BIT(8)
514%define X86_PDE4M_AVL (RT_BIT(9) | RT_BIT(10) | RT_BIT(11))
515%define X86_PDE4M_PAT RT_BIT(12)
516%define X86_PDE4M_PAT_SHIFT (12 - 7)
517%define X86_PDE4M_PG_MASK ( 0xffc00000 )
518%define X86_PDE4M_PG_HIGH_MASK ( 0x001fe000 )
519%define X86_PDE4M_PG_HIGH_SHIFT 19
520%define X86_PDE4M_MBZ_MASK RT_BIT_32(21)
521%define X86_PDE2M_PAE_PG_MASK 0x000fffffffe00000
522%define X86_PDE2M_PAE_NX RT_BIT_64(63)
523%define X86_PDE2M_PAE_MBZ_MASK_NX 0x7ff00000001fe000
524%define X86_PDE2M_PAE_MBZ_MASK_NO_NX 0xfff00000001fe000
525%define X86_PDE2M_LM_MBZ_MASK_NX 0x00000000001fe000
526%define X86_PDE2M_LM_MBZ_MASK_NO_NX 0x80000000001fe000
527%define X86_PD_SHIFT 22
528%define X86_PD_MASK 0x3ff
529%define X86_PD_PAE_SHIFT 21
530%define X86_PD_PAE_MASK 0x1ff
531%define X86_PDPE_P RT_BIT(0)
532%define X86_PDPE_RW RT_BIT(1)
533%define X86_PDPE_US RT_BIT(2)
534%define X86_PDPE_PWT RT_BIT(3)
535%define X86_PDPE_PCD RT_BIT(4)
536%define X86_PDPE_A RT_BIT(5)
537%define X86_PDPE_LM_PS RT_BIT(7)
538%define X86_PDPE_AVL_MASK (RT_BIT(9) | RT_BIT(10) | RT_BIT(11))
539%define X86_PDPE_PG_MASK 0x000ffffffffff000
540%define X86_PDPE_PAE_MBZ_MASK 0xfff00000000001e6
541%define X86_PDPE_LM_NX RT_BIT_64(63)
542%define X86_PDPE_LM_MBZ_MASK_NX 0x0000000000000180
543%define X86_PDPE_LM_MBZ_MASK_NO_NX 0x8000000000000180
544%define X86_PDPE1G_LM_MBZ_MASK_NX 0x000000003fffe000
545%define X86_PDPE1G_LM_MBZ_MASK_NO_NX 0x800000003fffe000
546%define X86_PDPT_SHIFT 30
547%define X86_PDPT_MASK_PAE 0x3
548%define X86_PDPT_MASK_AMD64 0x1ff
549%define X86_PML4E_P RT_BIT(0)
550%define X86_PML4E_RW RT_BIT(1)
551%define X86_PML4E_US RT_BIT(2)
552%define X86_PML4E_PWT RT_BIT(3)
553%define X86_PML4E_PCD RT_BIT(4)
554%define X86_PML4E_A RT_BIT(5)
555%define X86_PML4E_AVL_MASK (RT_BIT(9) | RT_BIT(10) | RT_BIT(11))
556%define X86_PML4E_PG_MASK 0x000ffffffffff000
557%define X86_PML4E_MBZ_MASK_NX 0x0000000000000080
558%define X86_PML4E_MBZ_MASK_NO_NX 0x8000000000000080
559%define X86_PML4E_NX RT_BIT_64(63)
560%define X86_PML4_SHIFT 39
561%define X86_PML4_MASK 0x1ff
562%define X86_FSW_IE RT_BIT(0)
563%define X86_FSW_DE RT_BIT(1)
564%define X86_FSW_ZE RT_BIT(2)
565%define X86_FSW_OE RT_BIT(3)
566%define X86_FSW_UE RT_BIT(4)
567%define X86_FSW_PE RT_BIT(5)
568%define X86_FSW_SF RT_BIT(6)
569%define X86_FSW_ES RT_BIT(7)
570%define X86_FSW_XCPT_MASK 0x007f
571%define X86_FSW_XCPT_ES_MASK 0x00ff
572%define X86_FSW_C0 RT_BIT(8)
573%define X86_FSW_C1 RT_BIT(9)
574%define X86_FSW_C2 RT_BIT(10)
575%define X86_FSW_TOP_MASK 0x3800
576%define X86_FSW_TOP_SHIFT 11
577%define X86_FSW_TOP_SMASK 0x0007
578%define X86_FSW_TOP_GET(a_uFsw) (((a_uFsw) >> X86_FSW_TOP_SHIFT) & X86_FSW_TOP_SMASK)
579%define X86_FSW_C3 RT_BIT(14)
580%define X86_FSW_C_MASK 0x4700
581%define X86_FSW_B RT_BIT(15)
582%define X86_FCW_IM RT_BIT(0)
583%define X86_FCW_DM RT_BIT(1)
584%define X86_FCW_ZM RT_BIT(2)
585%define X86_FCW_OM RT_BIT(3)
586%define X86_FCW_UM RT_BIT(4)
587%define X86_FCW_PM RT_BIT(5)
588%define X86_FCW_MASK_ALL 0x007f
589%define X86_FCW_XCPT_MASK 0x003f
590%define X86_FCW_PC_MASK 0x0300
591%define X86_FCW_PC_24 0x0000
592%define X86_FCW_PC_RSVD 0x0100
593%define X86_FCW_PC_53 0x0200
594%define X86_FCW_PC_64 0x0300
595%define X86_FCW_RC_MASK 0x0c00
596%define X86_FCW_RC_NEAREST 0x0000
597%define X86_FCW_RC_DOWN 0x0400
598%define X86_FCW_RC_UP 0x0800
599%define X86_FCW_RC_ZERO 0x0c00
600%define X86_FCW_ZERO_MASK 0xf080
601%define X86_MSXCR_IE RT_BIT(0)
602%define X86_MSXCR_DE RT_BIT(1)
603%define X86_MSXCR_ZE RT_BIT(2)
604%define X86_MSXCR_OE RT_BIT(3)
605%define X86_MSXCR_UE RT_BIT(4)
606%define X86_MSXCR_PE RT_BIT(5)
607%define X86_MSXCR_DAZ RT_BIT(6)
608%define X86_MSXCR_IM RT_BIT(7)
609%define X86_MSXCR_DM RT_BIT(8)
610%define X86_MSXCR_ZM RT_BIT(9)
611%define X86_MSXCR_OM RT_BIT(10)
612%define X86_MSXCR_UM RT_BIT(11)
613%define X86_MSXCR_PM RT_BIT(12)
614%define X86_MSXCR_RC_MASK 0x6000
615%define X86_MSXCR_RC_NEAREST 0x0000
616%define X86_MSXCR_RC_DOWN 0x2000
617%define X86_MSXCR_RC_UP 0x4000
618%define X86_MSXCR_RC_ZERO 0x6000
619%define X86_MSXCR_FZ RT_BIT(15)
620%define X86_MSXCR_MM RT_BIT(16)
621%ifndef VBOX_FOR_DTRACE_LIB
622%endif
623%define X86DESCATTR_TYPE 0x0000000f
624%define X86DESCATTR_DT 0x00000010
625%define X86DESCATTR_DPL 0x00000060
626%define X86DESCATTR_DPL_SHIFT 5
627%define X86DESCATTR_P 0x00000080
628%define X86DESCATTR_LIMIT_HIGH 0x00000f00
629%define X86DESCATTR_AVL 0x00001000
630%define X86DESCATTR_L 0x00002000
631%define X86DESCATTR_D 0x00004000
632%define X86DESCATTR_G 0x00008000
633%define X86DESCATTR_UNUSABLE 0x00010000
634%ifndef VBOX_FOR_DTRACE_LIB
635%endif
636%ifndef VBOX_FOR_DTRACE_LIB
637%define X86DESCGENERIC_BIT_OFF_LIMIT_LOW (0)
638%define X86DESCGENERIC_BIT_OFF_BASE_LOW (16)
639%define X86DESCGENERIC_BIT_OFF_BASE_HIGH1 (32)
640%define X86DESCGENERIC_BIT_OFF_TYPE (40)
641%define X86DESCGENERIC_BIT_OFF_DESC_TYPE (44)
642%define X86DESCGENERIC_BIT_OFF_DPL (45)
643%define X86DESCGENERIC_BIT_OFF_PRESENT (47)
644%define X86DESCGENERIC_BIT_OFF_LIMIT_HIGH (48)
645%define X86DESCGENERIC_BIT_OFF_AVAILABLE (52)
646%define X86DESCGENERIC_BIT_OFF_LONG (53)
647%define X86DESCGENERIC_BIT_OFF_DEF_BIG (54)
648%define X86DESCGENERIC_BIT_OFF_GRANULARITY (55)
649%define X86DESCGENERIC_BIT_OFF_BASE_HIGH2 (56)
650%endif
651%ifndef VBOX_FOR_DTRACE_LIB
652%endif
653%ifndef VBOX_FOR_DTRACE_LIB
654%endif
655%ifndef VBOX_FOR_DTRACE_LIB
656%endif
657%ifndef VBOX_FOR_DTRACE_LIB
658%endif
659%ifndef VBOX_FOR_DTRACE_LIB
660%endif
661%if HC_ARCH_BITS == 64
662%else
663%endif
664%if HC_ARCH_BITS == 64
665%else
666%endif
667%if HC_ARCH_BITS == 64
668%else
669%endif
670%define X86_SEL_TYPE_CODE 8
671%define X86_SEL_TYPE_MEMORY RT_BIT(4)
672%define X86_SEL_TYPE_ACCESSED 1
673%define X86_SEL_TYPE_DOWN 4
674%define X86_SEL_TYPE_CONF 4
675%define X86_SEL_TYPE_WRITE 2
676%define X86_SEL_TYPE_READ 2
677%define X86_SEL_TYPE_READ_BIT 1
678%define X86_SEL_TYPE_RO 0
679%define X86_SEL_TYPE_RO_ACC (0 | X86_SEL_TYPE_ACCESSED)
680%define X86_SEL_TYPE_RW 2
681%define X86_SEL_TYPE_RW_ACC (2 | X86_SEL_TYPE_ACCESSED)
682%define X86_SEL_TYPE_RO_DOWN 4
683%define X86_SEL_TYPE_RO_DOWN_ACC (4 | X86_SEL_TYPE_ACCESSED)
684%define X86_SEL_TYPE_RW_DOWN 6
685%define X86_SEL_TYPE_RW_DOWN_ACC (6 | X86_SEL_TYPE_ACCESSED)
686%define X86_SEL_TYPE_EO (0 | X86_SEL_TYPE_CODE)
687%define X86_SEL_TYPE_EO_ACC (0 | X86_SEL_TYPE_CODE | X86_SEL_TYPE_ACCESSED)
688%define X86_SEL_TYPE_ER (2 | X86_SEL_TYPE_CODE)
689%define X86_SEL_TYPE_ER_ACC (2 | X86_SEL_TYPE_CODE | X86_SEL_TYPE_ACCESSED)
690%define X86_SEL_TYPE_EO_CONF (4 | X86_SEL_TYPE_CODE)
691%define X86_SEL_TYPE_EO_CONF_ACC (4 | X86_SEL_TYPE_CODE | X86_SEL_TYPE_ACCESSED)
692%define X86_SEL_TYPE_ER_CONF (6 | X86_SEL_TYPE_CODE)
693%define X86_SEL_TYPE_ER_CONF_ACC (6 | X86_SEL_TYPE_CODE | X86_SEL_TYPE_ACCESSED)
694%define X86_SEL_TYPE_SYS_TSS_BUSY_MASK 2
695%define X86_SEL_TYPE_SYS_UNDEFINED 0
696%define X86_SEL_TYPE_SYS_286_TSS_AVAIL 1
697%define X86_SEL_TYPE_SYS_LDT 2
698%define X86_SEL_TYPE_SYS_286_TSS_BUSY 3
699%define X86_SEL_TYPE_SYS_286_CALL_GATE 4
700%define X86_SEL_TYPE_SYS_TASK_GATE 5
701%define X86_SEL_TYPE_SYS_286_INT_GATE 6
702%define X86_SEL_TYPE_SYS_286_TRAP_GATE 7
703%define X86_SEL_TYPE_SYS_UNDEFINED2 8
704%define X86_SEL_TYPE_SYS_386_TSS_AVAIL 9
705%define X86_SEL_TYPE_SYS_UNDEFINED3 0xA
706%define X86_SEL_TYPE_SYS_386_TSS_BUSY 0xB
707%define X86_SEL_TYPE_SYS_386_CALL_GATE 0xC
708%define X86_SEL_TYPE_SYS_UNDEFINED4 0xD
709%define X86_SEL_TYPE_SYS_386_INT_GATE 0xE
710%define X86_SEL_TYPE_SYS_386_TRAP_GATE 0xF
711%define AMD64_SEL_TYPE_SYS_LDT 2
712%define AMD64_SEL_TYPE_SYS_TSS_AVAIL 9
713%define AMD64_SEL_TYPE_SYS_TSS_BUSY 0xB
714%define AMD64_SEL_TYPE_SYS_CALL_GATE 0xC
715%define AMD64_SEL_TYPE_SYS_INT_GATE 0xE
716%define AMD64_SEL_TYPE_SYS_TRAP_GATE 0xF
717%define X86_DESC_TYPE_MASK (RT_BIT(8) | RT_BIT(9) | RT_BIT(10) | RT_BIT(11))
718%define X86_DESC_S RT_BIT(12)
719%define X86_DESC_DPL (RT_BIT(13) | RT_BIT(14))
720%define X86_DESC_P RT_BIT(15)
721%define X86_DESC_AVL RT_BIT(20)
722%define X86_DESC_DB RT_BIT(22)
723%define X86_DESC_G RT_BIT(23)
724%ifndef VBOX_FOR_DTRACE_LIB
725%endif
726%ifndef VBOX_FOR_DTRACE_LIB
727%endif
728%define X86_SEL_SHIFT 3
729%define X86_SEL_MASK 0xfff8
730%define X86_SEL_MASK_OFF_RPL 0xfffc
731%define X86_SEL_LDT 0x0004
732%define X86_SEL_RPL 0x0003
733%define X86_SEL_RPL_LDT 0x0007
734%define X86_XCPT_MAX (X86_XCPT_SX)
735%define X86_TRAP_ERR_EXTERNAL 1
736%define X86_TRAP_ERR_IDT 2
737%define X86_TRAP_ERR_TI 4
738%define X86_TRAP_ERR_SEL_MASK 0xfff8
739%define X86_TRAP_ERR_SEL_SHIFT 3
740%define X86_TRAP_PF_P RT_BIT(0)
741%define X86_TRAP_PF_RW RT_BIT(1)
742%define X86_TRAP_PF_US RT_BIT(2)
743%define X86_TRAP_PF_RSVD RT_BIT(3)
744%define X86_TRAP_PF_ID RT_BIT(4)
745%ifndef VBOX_FOR_DTRACE_LIB
746%else
747%endif
748%ifndef VBOX_FOR_DTRACE_LIB
749%else
750%endif
751%define X86_MODRM_RM_MASK 0x07
752%define X86_MODRM_REG_MASK 0x38
753%define X86_MODRM_REG_SMASK 0x07
754%define X86_MODRM_REG_SHIFT 3
755%define X86_MODRM_MOD_MASK 0xc0
756%define X86_MODRM_MOD_SMASK 0x03
757%define X86_MODRM_MOD_SHIFT 6
758%ifndef VBOX_FOR_DTRACE_LIB
759%endif
760%define X86_SIB_BASE_MASK 0x07
761%define X86_SIB_INDEX_MASK 0x38
762%define X86_SIB_INDEX_SMASK 0x07
763%define X86_SIB_INDEX_SHIFT 3
764%define X86_SIB_SCALE_MASK 0xc0
765%define X86_SIB_SCALE_SMASK 0x03
766%define X86_SIB_SCALE_SHIFT 6
767%ifndef VBOX_FOR_DTRACE_LIB
768%endif
769%define X86_GREG_xAX 0
770%define X86_GREG_xCX 1
771%define X86_GREG_xDX 2
772%define X86_GREG_xBX 3
773%define X86_GREG_xSP 4
774%define X86_GREG_xBP 5
775%define X86_GREG_xSI 6
776%define X86_GREG_xDI 7
777%define X86_GREG_x8 8
778%define X86_GREG_x9 9
779%define X86_GREG_x10 10
780%define X86_GREG_x11 11
781%define X86_GREG_x12 12
782%define X86_GREG_x13 13
783%define X86_GREG_x14 14
784%define X86_GREG_x15 15
785%define X86_SREG_ES 0
786%define X86_SREG_CS 1
787%define X86_SREG_SS 2
788%define X86_SREG_DS 3
789%define X86_SREG_FS 4
790%define X86_SREG_GS 5
791%define X86_SREG_COUNT 6
792%define X86_OP_PRF_CS 0x2e
793%define X86_OP_PRF_SS 0x36
794%define X86_OP_PRF_DS 0x3e
795%define X86_OP_PRF_ES 0x26
796%define X86_OP_PRF_FS 0x64
797%define X86_OP_PRF_GS 0x65
798%define X86_OP_PRF_SIZE_OP 0x66
799%define X86_OP_PRF_SIZE_ADDR 0x67
800%define X86_OP_PRF_LOCK 0xf0
801%define X86_OP_PRF_REPZ 0xf2
802%define X86_OP_PRF_REPNZ 0xf3
803%define X86_OP_REX_B 0x41
804%define X86_OP_REX_X 0x42
805%define X86_OP_REX_R 0x44
806%define X86_OP_REX_W 0x48
807%endif
808%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