VirtualBox

source: vbox/trunk/src/VBox/Devices/Bus/DevIommuAmd.cpp@ 83185

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

scm fix, suprisingly wasn't detected by tinderbox

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 40.0 KB
Line 
1/* $Id: DevIommuAmd.cpp 83185 2020-03-02 17:28:14Z vboxsync $ */
2/** @file
3 * IOMMU - Input/Output Memory Management Unit - AMD implementation.
4 */
5
6/*
7 * Copyright (C) 2020 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18
19/*********************************************************************************************************************************
20* Header Files *
21*********************************************************************************************************************************/
22#define LOG_GROUP LOG_GROUP_DEV_IOMMU
23#include <VBox/vmm/pdmdev.h>
24
25#include "VBoxDD.h"
26
27
28/*********************************************************************************************************************************
29* Defined Constants And Macros *
30*********************************************************************************************************************************/
31/**
32 * @name Commands.
33 * In accordance with the AMD spec.
34 * @{
35 */
36#define IOMMU_CMD_COMPLETION_WAIT 0x01
37#define IOMMU_CMD_INV_DEVTAB_ENTRY 0x02
38#define IOMMU_CMD_INV_IOMMU_PAGES 0x03
39#define IOMMU_CMD_INV_IOTLB_PAGES 0x04
40#define IOMMU_CMD_INV_INTR_TABLE 0x05
41#define IOMMU_CMD_PREFETCH_IOMMU_PAGES 0x06
42#define IOMMU_CMD_COMPLETE_PPR_REQ 0x07
43#define IOMMU_CMD_INV_IOMMU_ALL 0x08
44/** @} */
45
46/**
47 * @name Event codes.
48 * In accordance with the AMD spec.
49 * @{
50 */
51#define IOMMU_EVT_ILLEGAL_DEV_TAB_ENTRY 0x01
52#define IOMMU_EVT_IO_PAGE_FAULT 0x02
53#define IOMMU_EVT_DEV_TAB_HARDWARE_ERROR 0x03
54#define IOMMU_EVT_PAGE_TAB_HARDWARE_ERROR 0x04
55#define IOMMU_EVT_ILLEGAL_COMMAND_ERROR 0x05
56#define IOMMU_EVT_COMMAND_HARDWARE_ERROR 0x06
57#define IOMMU_EVT_IOTLB_INV_TIMEOUT 0x07
58#define IOMMU_EVT_INVALID_DEVICE_REQUEST 0x08
59#define IOMMU_EVT_INVALID_PPR_REQUEST 0x09
60#define IOMMU_EVT_EVENT_COUNTER_ZERO 0x10
61#define IOMMU_EVT_GUEST_EVENT_FAULT 0x11
62/** @} */
63
64/**
65 * @name Capability Header.
66 * In accordance with the AMD spec.
67 * @{
68 */
69/** CapId: Capability ID. */
70#define IOMMU_BF_CAPHDR_CAP_ID_SHIFT 0
71#define IOMMU_BF_CAPHDR_CAP_ID_MASK UINT32_C(0x000000ff)
72/** CapPtr: Capability Pointer. */
73#define IOMMU_BF_CAPHDR_CAP_PTR_SHIFT 8
74#define IOMMU_BF_CAPHDR_CAP_PTR_MASK UINT32_C(0x0000ff00)
75/** CapType: Capability Type. */
76#define IOMMU_BF_CAPHDR_CAP_TYPE_SHIFT 16
77#define IOMMU_BF_CAPHDR_CAP_TYPE_MASK UINT32_C(0x00070000)
78/** CapRev: Capability Revision. */
79#define IOMMU_BF_CAPHDR_CAP_REV_SHIFT 19
80#define IOMMU_BF_CAPHDR_CAP_REV_MASK UINT32_C(0x00f80000)
81/** IoTlbSup: IO TLB Support. */
82#define IOMMU_BF_CAPHDR_IOTLB_SUP_SHIFT 24
83#define IOMMU_BF_CAPHDR_IOTLB_SUP_MASK UINT32_C(0x01000000)
84/** HtTunnel: HyperTransport Tunnel translation support. */
85#define IOMMU_BF_CAPHDR_HT_TUNNEL_SHIFT 25
86#define IOMMU_BF_CAPHDR_HT_TUNNEL_MASK UINT32_C(0x02000000)
87/** NpCache: Not Present table entries Cached. */
88#define IOMMU_BF_CAPHDR_NP_CACHE_SHIFT 26
89#define IOMMU_BF_CAPHDR_NP_CACHE_MASK UINT32_C(0x04000000)
90/** EFRSup: Extended Feature Register (EFR) Supported. */
91#define IOMMU_BF_CAPHDR_EFR_SUP_SHIFT 27
92#define IOMMU_BF_CAPHDR_EFR_SUP_MASK UINT32_C(0x08000000)
93/** CapExt: Miscellaneous Information Register Supported . */
94#define IOMMU_BF_CAPHDR_CAP_EXT_SHIFT 28
95#define IOMMU_BF_CAPHDR_CAP_EXT_MASK UINT32_C(0x10000000)
96/** Bits 31:29 reserved. */
97#define IOMMU_BF_CAPHDR_RSVD_29_31_SHIFT 29
98#define IOMMU_BF_CAPHDR_RSVD_29_31_MASK UINT32_C(0xe0000000)
99RT_BF_ASSERT_COMPILE_CHECKS(IOMMU_BF_CAPHDR_, UINT32_C(0), UINT32_MAX,
100 (CAP_ID, CAP_PTR, CAP_TYPE, CAP_REV, IOTLB_SUP, HT_TUNNEL, NP_CACHE, EFR_SUP, CAP_EXT, RSVD_29_31));
101/** @} */
102
103/**
104 * @name Base Address Low Register.
105 * In accordance with the AMD spec.
106 * @{
107 */
108/** Enable: Enables access to the address specified in the Base Address Register. */
109#define IOMMU_BF_BASEADDR_LO_ENABLE_SHIFT 0
110#define IOMMU_BF_BASEADDR_LO_ENABLE_MASK UINT32_C(0x00000001)
111/** Bits 13:1 reserved. */
112#define IOMMU_BF_BASEADDR_LO_RSVD_1_13_SHIFT 1
113#define IOMMU_BF_BASEADDR_LO_RSVD_1_13_MASK UINT32_C(0x00003ffe)
114/** Base Address[18:14]: Low Base address (Lo) of IOMMU control registers. */
115#define IOMMU_BF_BASEADDR_LO_ADDR_LO_SHIFT 14
116#define IOMMU_BF_BASEADDR_LO_ADDR_LO_MASK UINT32_C(0x0007c000)
117/** Base Address[31:19]: Low Base address (Hi) of IOMMU control registers. */
118#define IOMMU_BF_BASEADDR_LO_ADDR_HI_SHIFT 19
119#define IOMMU_BF_BASEADDR_LO_ADDR_HI_MASK UINT32_C(0xfff80000)
120RT_BF_ASSERT_COMPILE_CHECKS(IOMMU_BF_BASEADDR_LO_, UINT32_C(0), UINT32_MAX,
121 (ENABLE, RSVD_1_13, ADDR_LO, ADDR_HI));
122/** @} */
123
124/**
125 * @name Range Register.
126 * In accordance with the AMD spec.
127 * @{
128 */
129/** UnitID: HyperTransport Unit ID. */
130#define IOMMU_BF_RANGE_UNIT_ID_SHIFT 0
131#define IOMMU_BF_RANGE_UNIT_ID_MASK UINT32_C(0x0000000f)
132/** Bits 6:5 reserved. */
133#define IOMMU_BF_RANGE_RSVD_6_5_SHIFT 5
134#define IOMMU_BF_RANGE_RSVD_6_5_MASK UINT32_C(0x00000060)
135/** RngValid: Range valid. */
136#define IOMMU_BF_RANGE_VALID_SHIFT 7
137#define IOMMU_BF_RANGE_VALID_MASK UINT32_C(0x00000080)
138/** BusNumber: Device range bus number. */
139#define IOMMU_BF_RANGE_BUS_NUMBER_SHIFT 8
140#define IOMMU_BF_RANGE_BUS_NUMBER_MASK UINT32_C(0x0000ff00)
141/** First Device. */
142#define IOMMU_BF_RANGE_FIRST_DEVICE_SHIFT 16
143#define IOMMU_BF_RANGE_FIRST_DEVICE_MASK UINT32_C(0x00ff0000)
144/** Last Device. */
145#define IOMMU_BF_RANGE_LAST_DEVICE_SHIFT 24
146#define IOMMU_BF_RANGE_LAST_DEVICE_MASK UINT32_C(0xff000000)
147RT_BF_ASSERT_COMPILE_CHECKS(IOMMU_BF_RANGE_, UINT32_C(0), UINT32_MAX,
148 (UNIT_ID, RSVD_6_15, VALID, BUS_NUMBER, FIRST_DEVICE, LAST_DEVICE));
149/** @} */
150
151/**
152 * @name Miscellaneous Information Register 0.
153 * In accordance with the AMD spec.
154 * @{
155 */
156/** MsiNum: MSI message number. */
157#define IOMMU_BF_MISCINFO_0_MSI_NUM_SHIFT 0
158#define IOMMU_BF_MISCINFO_0_MSI_NUM_MASK UINT32_C(0x0000000f)
159/** GvaSize: Guest Virtual Address Size. */
160#define IOMMU_BF_MISCINFO_0_GVA_SIZE_SHIFT 5
161#define IOMMU_BF_MISCINFO_0_GVA_SIZE_MASK UINT32_C(0x000000e0)
162/** PaSize: Physical Address Size. */
163#define IOMMU_BF_MISCINFO_0_PA_SIZE_SHIFT 8
164#define IOMMU_BF_MISCINFO_0_PA_SIZE_MASK UINT32_C(0x00007f00)
165/** VaSize: Virtual Address Size. */
166#define IOMMU_BF_MISCINFO_0_VA_SIZE_SHIFT 15
167#define IOMMU_BF_MISCINFO_0_VA_SIZE_MASK UINT32_C(0x003f8000)
168/** HtAtsResv: HyperTransport ATS Response Address range Reserved. */
169#define IOMMU_BF_MISCINFO_0_HT_ATS_RESV_SHIFT 22
170#define IOMMU_BF_MISCINFO_0_HT_ATS_RESV_MASK UINT32_C(0x00400000)
171/** Bits 26:23 reserved. */
172#define IOMMU_BF_MISCINFO_0_RSVD_23_26_SHIFT 23
173#define IOMMU_BF_MISCINFO_0_RSVD_23_26_MASK UINT32_C(0x07800000)
174/** MsiNumPPR: Peripheral Page Request MSI message number. */
175#define IOMMU_BF_MISCINFO_0_MSI_NUM_PPR_SHIFT 27
176#define IOMMU_BF_MISCINFO_0_MSI_NUM_PPR_MASK UINT32_C(0xf8000000)
177RT_BF_ASSERT_COMPILE_CHECKS(IOMMU_BF_MISCINFO_0_, UINT32_C(0), UINT32_MAX,
178 (MSI_NUM, GVA_SIZE, PA_SIZE, VA_SIZE, HTS_ATS_RESV, RSVD_23_26, MSI_NUM_PPR));
179/** @} */
180
181/**
182 * @name Miscellaneous Information Register 1.
183 * In accordance with the AMD spec.
184 * @{
185 */
186/** MsiNumGA: MSI message number for guest vAPIC. */
187#define IOMMU_BF_MISCINFO_1_MSI_NUM_GA_SHIFT 0
188#define IOMMU_BF_MISCINFO_1_MSI_NUM_GA_MASK UINT32_C(0x0000000f)
189/** Bits 31:5 reserved. */
190#define IOMMU_BF_MISCINFO_1_RSVD_5_31_SHIFT 5
191#define IOMMU_BF_MISCINFO_1_RSVD_5_31_MASK UINT32_C(0xffffffe0)
192RT_BF_ASSERT_COMPILE_CHECKS(IOMMU_BF_MISCINFO_1_, UINT32_C(0), UINT32_MAX,
193 (NUM_GA, RSVD_5_31));
194/** @} */
195
196
197/*********************************************************************************************************************************
198* Structures and Typedefs *
199*********************************************************************************************************************************/
200/**
201 * The Device ID.
202 * In accordance with the AMD spec.
203 */
204typedef union
205{
206 struct
207 {
208 uint16_t uFunction : 3; /**< Bits 2:0 - Function. */
209 uint16_t uDevice : 5; /**< Bits 7:3 - Device. */
210 uint16_t uBus : 8; /**< Bits 15:8 - Bus. */
211 } n;
212 /** The unsigned integer view. */
213 uint16_t u;
214} DEVICE_ID_T;
215AssertCompileSize(DEVICE_ID_T, 2);
216
217/**
218 * Device Table Entry (DTE).
219 * In accordance with the AMD spec.
220 */
221typedef union
222{
223 struct
224 {
225 uint32_t u1Valid : 1; /**< Bit 0 - V: Valid. */
226 uint32_t u1TranslationValid : 1; /**< Bit 1 - TV: Translation information Valid. */
227 uint32_t u5Rsvd0 : 5; /**< Bits 6:2 - Reserved. */
228 uint32_t u2Had : 2; /**< Bits 8:7 - HAD: Host Access Dirty. */
229 uint32_t u3Mode : 3; /**< Bits 11:9 - Mode: Paging mode. */
230 uint32_t u20PageTableRootPtrLo : 20; /**< Bits 31:12 - Page Table Root Pointer (Lo). */
231 uint32_t u40PageTableRootPtrHi : 40; /**< Bits 51:32 - Page Table Root Pointer (Hi). */
232 uint32_t u1Ppr : 1; /**< Bit 52 - PPR: Peripheral Page Request. */
233 uint32_t u1Grpr : 1; /**< Bit 53 - GRPR: Guest PPR Response with PASID. */
234 uint32_t u1GIov : 1; /**< Bit 54 - GIoV: Guest I/O Protection Valid. */
235 uint32_t u1GValid : 1; /**< Bit 55 - GV: Guest translation Valid. */
236 uint32_t u2Glx : 2; /**< Bits 57:56 - GLX: Guest Levels Translated. */
237 uint32_t u3GCr3TableRootPtrLo : 2; /**< Bits 60:58 - GCR3 TRP: Guest CR3 Table Root Pointer (Lo). */
238 uint32_t u1IoRead : 1; /**< Bit 61 - IR: I/O Read permission. */
239 uint32_t u1IoWrite : 1; /**< Bit 62 - IW: I/O Write permission. */
240 uint32_t u1Rsvd0 : 1; /**< Bit 63 - Reserved. */
241 uint32_t u16DomainId : 1; /**< Bits 79:64 - Domain ID. */
242 uint32_t u16GCr3TableRootPtrMed : 16; /**< Bits 95:80 - GCR3 TRP: Guest CR3 Table Root Pointer (Mid). */
243 uint32_t u1IotlbEnable : 1; /**< Bit 96 - IOTLB Enable. */
244 uint32_t u1SuppressPfEvents : 1; /**< Bit 97 - SE: Supress Page-fault events. */
245 uint32_t u1SuppressAllPfEvents : 1; /**< Bit 98 - SA: Supress All Page-fault events. */
246 uint32_t u2IoCtl : 1; /**< Bits 100:99 - IoCtl: Port I/O Control. */
247 uint32_t u1Cache : 1; /**< Bit 101 - Cache: IOTLB Cache Hint. */
248 uint32_t u1SnoopDisable : 1; /**< Bit 102 - SD: Snoop Disable. */
249 uint32_t u1AllowExclusion : 1; /**< Bit 103 - EX: Allow Exclusion. */
250 uint32_t u2SysMgt : 2; /**< Bits 105:104 - SysMgt: System Management message enable. */
251 uint32_t u1Rsvd1 : 1; /**< Bit 106 - Reserved. */
252 uint32_t u21Gcr3TableRootPtrHi : 21; /**< Bits 127:107 - GCR3 TRP: Guest CR3 Table Root Pointer (Hi). */
253 uint32_t u1IntrMapValid : 1; /**< Bit 128 - IV: Interrupt map Valid. */
254 uint32_t u4IntrTableLength : 4; /**< Bits 132:129 - IntTabLen: Interrupt Table Length. */
255 uint32_t u1IgnoreUnmappedIntrs : 1; /**< Bits 133 - IG: Ignore unmapped interrupts. */
256 uint32_t u26IntrTableRootPtr : 26; /**< Bits 159:134 - Interrupt Root Table Pointer (Lo). */
257 uint32_t u20IntrTableRootPtr : 20; /**< Bits 179:160 - Interrupt Root Table Pointer (Hi). */
258 uint32_t u4Rsvd0 : 4; /**< Bits 183:180 - Reserved. */
259 uint32_t u1InitPassthru : 1; /**< Bits 184 - INIT Pass-through. */
260 uint32_t u1ExtIntPassthru : 1; /**< Bits 185 - External Interrupt Pass-through. */
261 uint32_t u1NmiPassthru : 1; /**< Bits 186 - NMI Pass-through. */
262 uint32_t u1Rsvd2 : 1; /**< Bits 187 - Reserved. */
263 uint32_t u2IntrCtrl : 2; /**< Bits 189:188 - IntCtl: Interrupt Control. */
264 uint32_t u1Lint0Passthru : 1; /**< Bit 190 - Lint0Pass: LINT0 (Legacy PIC NMI) Pass-thru. */
265 uint32_t u1Lint1Passthru : 1; /**< Bit 191 - Lint1Pass: LINT1 (Legacy PIC NMI) Pass-thru. */
266 uint32_t u32Rsvd0; /**< Bits 223:192 - Reserved. */
267 uint32_t u22Rsvd0 : 22; /**< Bits 245:224 - Reserved. */
268 uint32_t u1AttrOverride : 1; /**< Bit 246 - AttrV: Attribute Override. */
269 uint32_t u1Mode0FC: 1; /**< Bit 247 - Mode0FC. */
270 uint32_t u8SnoopAttr: 1; /**< Bits 255:248 - Snoop Attribute. */
271 } n;
272 /** The 32-bit unsigned integer view. */
273 uint32_t au32[8];
274} DEV_TAB_ENTRY_T;
275AssertCompileSize(DEV_TAB_ENTRY_T, 32);
276
277/**
278 * I/O Page Table Entry.
279 * In accordance with the AMD spec.
280 */
281typedef union
282{
283 struct
284 {
285 RT_GCC_EXTENSION uint64_t u1Present : 1; /**< Bit 0 - PR: Present. */
286 RT_GCC_EXTENSION uint64_t u4Ign0 : 4; /**< Bits 4:1 - Ignored. */
287 RT_GCC_EXTENSION uint64_t u1Accessed : 1; /**< Bit 5 - A: Accessed. */
288 RT_GCC_EXTENSION uint64_t u1Dirty : 1; /**< Bit 6 - D: Dirty. */
289 RT_GCC_EXTENSION uint64_t u2Ign0 : 2; /**< Bits 8:7 - Ignored. */
290 RT_GCC_EXTENSION uint64_t u3NextLevel : 3; /**< Bits 11:9 - Next Level: Next page translation level. */
291 RT_GCC_EXTENSION uint64_t u40PageAddr : 40; /**< Bits 51:12 - Page address. */
292 RT_GCC_EXTENSION uint64_t u7Rsvd0 : 7; /**< Bits 58:52 - Reserved. */
293 RT_GCC_EXTENSION uint64_t u1UntranslatedAccess : 1; /**< Bit 59 - U: Untranslated Access Only. */
294 RT_GCC_EXTENSION uint64_t u1ForceCoherent : 1; /**< Bit 60 - FC: Force Coherent. */
295 RT_GCC_EXTENSION uint64_t u1IoRead : 1; /**< Bit 61 - IR: I/O Read permission. */
296 RT_GCC_EXTENSION uint64_t u1IoWrite : 1; /**< Bit 62 - IW: I/O Wead permission. */
297 RT_GCC_EXTENSION uint64_t u1Ign0 : 1; /**< Bit 63 - Ignored. */
298 } n;
299 /** The 64-bit unsigned integer view. */
300 uint64_t u;
301} IOPTE_T;
302AssertCompileSize(IOPTE_T, 8);
303
304/**
305 * I/O Page Directory Entry.
306 * In accordance with the AMD spec.
307 */
308typedef union
309{
310 struct
311 {
312 RT_GCC_EXTENSION uint64_t u1Present : 1; /**< Bit 0 - PR: Present. */
313 RT_GCC_EXTENSION uint64_t u4Ign0 : 4; /**< Bits 4:1 - Ignored. */
314 RT_GCC_EXTENSION uint64_t u1Accessed : 1; /**< Bit 5 - A: Accessed. */
315 RT_GCC_EXTENSION uint64_t u3Ign0 : 3; /**< Bits 8:6 - Ignored. */
316 RT_GCC_EXTENSION uint64_t u3NextLevel : 3; /**< Bits 11:9 - Next Level: Next page translation level. */
317 RT_GCC_EXTENSION uint64_t u40PageAddr : 40; /**< Bits 51:12 - Page address (Next Table Address). */
318 RT_GCC_EXTENSION uint64_t u9Rsvd0 : 9; /**< Bits 60:52 - Reserved. */
319 RT_GCC_EXTENSION uint64_t u1IoRead : 1; /**< Bit 61 - IR: I/O Read permission. */
320 RT_GCC_EXTENSION uint64_t u1IoWrite : 1; /**< Bit 62 - IW: I/O Wead permission. */
321 RT_GCC_EXTENSION uint64_t u1Ign0 : 1; /**< Bit 63 - Ignored. */
322 } n;
323 /** The 64-bit unsigned integer view. */
324 uint64_t u;
325} IOPDE_T;
326AssertCompileSize(IOPDE_T, 8);
327
328/**
329 * Interrupt Remapping Table Entry.
330 * In accordance with the AMD spec.
331 */
332typedef union
333{
334 struct
335 {
336 uint32_t u1RemapEnable : 1; /**< Bit 0 - RemapEn: Remap enable. */
337 uint32_t u1SuppressPf : 1; /**< Bit 1 - SupIOPF: Supress I/O Page Fault. */
338 uint32_t u3IntrType : 1; /**< Bits 4:2 - IntType: Interrupt Type. */
339 uint32_t u1ReqEoi : 1; /**< Bit 5 - RqEoi: Request EOI. */
340 uint32_t u1DstMode : 1; /**< Bit 6 - DM: Destination Mode. */
341 uint32_t u1GuestMode : 1; /**< Bit 7 - GuestMode. */
342 uint32_t u8Dst : 8; /**< Bits 15:8 - Destination. */
343 uint32_t u8Vector : 8; /**< Bits 23:16 - Vector. */
344 uint32_t u8Rsvd0 : 8; /**< Bits 31:24 - Reserved. */
345 } n;
346 /** The 32-bit unsigned integer view. */
347 uint32_t u;
348} IRTE_T;
349AssertCompileSize(IRTE_T, 4);
350
351/**
352 * Command: Generic Command Buffer Entry.
353 * In accordance with the AMD spec.
354 */
355typedef union
356{
357 struct
358 {
359 uint32_t u32Operand1Lo; /**< Bits 31:0 - Operand 1 (Lo). */
360 uint32_t u32Operand1Hi : 28; /**< Bits 59:32 - Operand 1 (Hi). */
361 uint32_t u4Opcode : 4; /**< Bits 63:60 - Op Code. */
362 uint64_t u64Operand2; /**< Bits 127:64 - Operand 2. */
363 } n;
364 /** The 64-bit unsigned integer view. */
365 uint64_t au64[2];
366} CMD_GENERIC_T;
367AssertCompileSize(CMD_GENERIC_T, 16);
368
369/**
370 * Command: COMPLETION_WAIT.
371 * In accordance with the AMD spec.
372 */
373typedef union
374{
375 struct
376 {
377 RT_GCC_EXTENSION uint64_t u1Store; /**< Bit 0 - S: Completion Store. */
378 RT_GCC_EXTENSION uint64_t u1Interrupt; /**< Bit 1 - I: Completion Interrupt. */
379 RT_GCC_EXTENSION uint64_t u1Flush; /**< Bit 2 - F: Flush Queue. */
380 RT_GCC_EXTENSION uint64_t u48StoreAddr : 48; /**< Bits 51:3 - Store Address. */
381 RT_GCC_EXTENSION uint64_t u8Rsvd0 : 8; /**< Bits 59:52 - Reserved. */
382 RT_GCC_EXTENSION uint64_t u4OpCode : 4; /**< Bits 63:60 - OpCode (Command). */
383 uint64_t u64StoreData; /**< Bits 127:64 - Store Data. */
384 } n;
385 /** The 64-bit unsigned integer view. */
386 uint64_t au64[2];
387} CMD_COMPLETION_WAIT_T;
388AssertCompileSize(CMD_COMPLETION_WAIT_T, 16);
389
390/**
391 * Command: INVALIDATE_DEVTAB_ENTRY.
392 * In accordance with the AMD spec.
393 */
394typedef union
395{
396 struct
397 {
398 uint16_t u16DeviceId; /**< Bits 15:0 - DeviceID. */
399 uint16_t u16Rsvd0; /**< Bits 31:16 - Reserved. */
400 uint32_t u28Rsvd0 : 28; /**< Bits 59:32 - Reserved. */
401 uint32_t u4OpCode : 4; /**< Bits 63:60 - Op Code (Command). */
402 uint64_t u64Rsvd0; /**< Bits 127:64 - Reserved. */
403 } n;
404 /** The 64-bit unsigned integer view. */
405 uint64_t au64[2];
406} CMD_INV_DEV_TAB_ENTRY_T;
407AssertCompileSize(CMD_INV_DEV_TAB_ENTRY_T, 16);
408
409/**
410 * Command: INVALIDATE_IOMMU_PAGES.
411 * In accordance with the AMD spec.
412 */
413typedef union
414{
415 struct
416 {
417 uint32_t u20Pasid : 20; /**< Bits 19:0 - PASID: Process Address-Space ID. */
418 uint32_t u12Rsvd0 : 12; /**< Bits 31:20 - Reserved. */
419 uint32_t u16DomainId : 16; /**< Bits 47:32 - Domain ID. */
420 uint32_t u12Rsvd1 : 12; /**< Bits 59:48 - Reserved. */
421 uint32_t u4OpCode : 4; /**< Bits 63:60 - Op Code (Command). */
422 uint32_t u1Size : 1; /**< Bit 64 - S: Size. */
423 uint32_t u1PageDirEntries : 1; /**< Bit 65 - PDE: Page Directory Entries. */
424 uint32_t u1GuestOrNested : 1; /**< Bit 66 - GN: Guest (GPA) or Nested (GVA). */
425 uint32_t u9Rsvd0 : 9; /**< Bits 75:67 - Reserved. */
426 uint32_t u20AddrLo : 20; /**< Bits 95:76 - Address (Lo). */
427 uint32_t u32AddrHi; /**< Bits 127:96 - Address (Hi). */
428 } n;
429 /** The 64-bit unsigned integer view. */
430 uint64_t au64[2];
431} CMD_INV_IOMMU_PAGES_T;
432AssertCompileSize(CMD_INV_IOMMU_PAGES_T, 16);
433
434/**
435 * Command: INVALIDATE_IOTLB_PAGES.
436 * In accordance with the AMD spec.
437 */
438typedef union
439{
440 struct
441 {
442 uint16_t u16DeviceId; /**< Bits 15:0 - Device ID. */
443 uint8_t u8PasidLo; /**< Bits 23:16 - PASID: Process Address-Space ID (Lo). */
444 uint8_t u8MaxPend; /**< Bits 31:24 - Maxpend: Maximum simultaneous in-flight transactions. */
445 uint32_t u16QueueId : 16; /**< Bits 47:32 - Queue ID. */
446 uint32_t u12PasidHi : 12; /**< Bits 59:48 - PASID: Process Address-Space ID (Hi). */
447 uint32_t u4OpCode : 4; /**< Bits 63:60 - Op Code (Command). */
448 uint32_t u1Size : 1; /**< Bit 64 - S: Size. */
449 uint32_t u1Rsvd0: 1; /**< Bit 65 - Reserved. */
450 uint32_t u1GuestOrNested : 1; /**< Bit 66 - GN: Guest (GPA) or Nested (GVA). */
451 uint32_t u1Rsvd1 : 1; /**< Bit 67 - Reserved. */
452 uint32_t u2Type : 2; /**< Bit 69:68 - Type. */
453 uint32_t u6Rsvd0 : 6; /**< Bits 75:70 - Reserved. */
454 uint32_t u20AddrLo : 20; /**< Bits 95:76 - Address (Lo). */
455 uint32_t u32AddrHi; /**< Bits 127:96 - Address (Hi). */
456 } n;
457 /** The 64-bit unsigned integer view. */
458 uint64_t au64[2];
459} CMD_INV_IOTLB_PAGES_T;
460AssertCompileSize(CMD_INV_IOTLB_PAGES_T, 16);
461
462/**
463 * Command: INVALIDATE_INTR_TABLE.
464 * In accordance with the AMD spec.
465 */
466typedef union
467{
468 struct
469 {
470 uint16_t u16DeviceId; /**< Bits 15:0 - Device ID. */
471 uint16_t u16Rsvd0; /**< Bits 31:16 - Reserved. */
472 uint32_t u32Rsvd0 : 28; /**< Bits 59:32 - Reserved. */
473 uint32_t u4OpCode : 4; /**< Bits 63:60 - Op Code (Command). */
474 uint64_t u64Rsvd0; /**< Bits 127:64 - Reserved. */
475 } u;
476 /** The 64-bit unsigned integer view. */
477 uint64_t au64[2];
478} CMD_INV_INTR_TABLE_T;
479AssertCompileSize(CMD_INV_INTR_TABLE_T, 16);
480
481/**
482 * Command: COMPLETE_PPR_REQ.
483 * In accordance with the AMD spec.
484 */
485typedef union
486{
487 struct
488 {
489 uint16_t u16DeviceId; /**< Bits 15:0 - Device ID. */
490 uint16_t u16Rsvd0; /**< Bits 31:16 - Reserved. */
491 uint32_t u20Pasid; /**< Bits 51:32 - PASID: Process Address-Space ID. */
492 uint32_t u8Rsvd0; /**< Bits 59:52 - Reserved. */
493 uint32_t u4OpCode; /**< Bits 63:60 - Op Code (Command). */
494 uint32_t u2Rsvd0 : 2; /**< Bits 65:64 - Reserved. */
495 uint32_t u1GuestOrNested : 1; /**< Bit 66 - GN: Guest (GPA) or Nested (GVA). */
496 uint32_t u29Rsvd0 : 29; /**< Bits 95:67 - Reserved. */
497 uint16_t u16CompletionTag; /**< Bits 111:96 - Completion Tag. */
498 uint16_t u16Rsvd0; /**< Bits 127:112 - Reserved. */
499 } n;
500 /** The 64-bit unsigned integer view. */
501 uint64_t au64[2];
502} CMD_COMPLETE_PPR_REQ_T;
503AssertCompileSize(CMD_COMPLETE_PPR_REQ_T, 16);
504
505/**
506 * Command: INV_IOMMU_ALL.
507 * In accordance with the AMD spec.
508 */
509typedef union
510{
511 struct
512 {
513 uint32_t u32Rsvd0; /**< Bits 31:0 - Reserved. */
514 uint32_t u28Rsvd0 : 28; /**< Bits 59:32 - Reserved. */
515 uint32_t u4OpCode : 4; /**< Bits 63:60 - Op Code (Command). */
516 uint64_t u64Rsvd0; /**< Bits 127:64 - Reserved. */
517 } n;
518 /** The 64-bit unsigned integer view. */
519 uint64_t au64[2];
520} CMD_IOMMU_ALL_T;
521AssertCompileSize(CMD_IOMMU_ALL_T, 16);
522
523/**
524 * Event Log Entry: Generic.
525 * In accordance with the AMD spec.
526 */
527typedef union
528{
529 struct
530 {
531 uint32_t u32Operand1Lo; /**< Bits 31:0 - Operand 1 (Lo). */
532 uint32_t u32Operand1Hi : 28; /**< Bits 59:32 - Operand 1 (Hi). */
533 uint32_t u4EventCode : 4; /**< Bits 63:60 - Event code. */
534 uint32_t u32Operand2Lo; /**< Bits 95:64 - Operand 2 (Lo). */
535 uint32_t u32Operand2Hi; /**< Bits 127:96 - Operand 2 (Hi). */
536 } n;
537 /** The 32-bit unsigned integer view. */
538 uint32_t au32[4];
539} EVT_GENERIC_T;
540AssertCompileSize(EVT_GENERIC_T, 16);
541
542/**
543 * Event Log Entry: ILLEGAL_DEV_TAB_ENTRY.
544 * In accordance with the AMD spec.
545 */
546typedef union
547{
548 struct
549 {
550 uint16_t u16DeviceId; /**< Bits 15:0 - Device ID. */
551 uint16_t u4PasidHi : 4; /**< Bits 19:16 - PASID: Process Address-Space ID (Hi). */
552 uint16_t u12Rsvd0 : 12; /**< Bits 31:20 - Reserved. */
553 uint16_t u16PasidLo; /**< Bits 47:32 - PASID: Process Address-Space ID (Lo). */
554 uint16_t u1GuestOrNested : 1; /**< Bit 48 - GN: Guest (GPA) or Nested (GVA). */
555 uint16_t u2Rsvd0 : 2; /**< Bits 50:49 - Reserved. */
556 uint16_t u1Interrupt : 1; /**< Bit 51 - I: Interrupt. */
557 uint16_t u1Rsvd0 : 1; /**< Bit 52 - Reserved. */
558 uint16_t u1ReadWrite : 1; /**< Bit 53 - RW: Read/Write. */
559 uint16_t u1Rsvd0 : 1; /**< Bit 54 - Reserved. */
560 uint16_t u1RsvdZero : 1; /**< Bit 55 - RZ: Reserved bit not Zero or invalid level encoding. */
561 uint16_t u1Translation : 1; /**< Bit 56 - TN: Translation. */
562 uint16_t u3Rsvd0 : 3; /**< Bits 59:57 - Reserved. */
563 uint16_t u4EventCode : 4; /**< Bits 63:60 - Event code. */
564 uint32_t u2Rsvd1 : 2; /**< Bits 65:64 - Reserved. */
565 uint32_t u30AddrLo : 2; /**< Bits 95:66 - Address: Device Virtual Address (Lo). */
566 uint32_t u30AddrHi; /**< Bits 127:96 - Address: Device Virtual Address (Hi). */
567 } n;
568 /** The 32-bit unsigned integer view. */
569 uint32_t au32[4];
570} EVT_ILLEGAL_DEV_TAB_ENTRY_T;
571AssertCompileSize(EVT_ILLEGAL_DEV_TAB_ENTRY_T, 16);
572
573/**
574 * Event Log Entry: IO_PAGE_FAULT_EVENT.
575 * In accordance with the AMD spec.
576 */
577typedef union
578{
579 struct
580 {
581 uint16_t u16DeviceId; /**< Bits 15:0 - Device ID. */
582 uint16_t u4PasidHi : 4; /**< Bits 19:16 - PASID: Process Address-Space ID (Hi). */
583 uint16_t u16DomainOrPasidLo; /**< Bits 47:32 - D/P: Domain ID or Process Address-Space ID (Lo). */
584 uint16_t u1GuestOrNested : 1; /**< Bit 48 - GN: Guest (GPA) or Nested (GVA). */
585 uint16_t u1NoExecute : 1; /**< Bit 49 - NX: No Execute. */
586 uint16_t u1User : 1; /**< Bit 50 - US: User/Supervisor. */
587 uint16_t u1Interrupt : 1; /**< Bit 51 - I: Interrupt. */
588 uint16_t u1Present : 1; /**< Bit 52 - PR: Present. */
589 uint16_t u1ReadWrite : 1; /**< Bit 53 - RW: Read/Write. */
590 uint16_t u1Perm : 1; /**< Bit 54 - PE: Permission Indicator. */
591 uint16_t u1RsvdZero : 1; /**< Bit 55 - RZ: Reserved bit not Zero or invalid level encoding. */
592 uint16_t u1Translation : 1; /**< Bit 56 - TN: Translation. */
593 uint16_t u3Rsvd0 : 3; /**< Bit 59:57 - Reserved. */
594 uint16_t u4EventCode : 4; /**< Bits 63:60 - Event code. */
595 uint64_t u64Addr; /**< Bits 127:64 - Address: Device Virtual Address. */
596 } n;
597 /** The 32-bit unsigned integer view. */
598 uint32_t au32[4];
599} EVT_IO_PAGE_FAULT_T;
600AssertCompileSize(EVT_IO_PAGE_FAULT_T, 16);
601
602/**
603 * Event Log Entry: DEV_TAB_HARDWARE_ERROR.
604 * In accordance with the AMD spec.
605 */
606typedef union
607{
608 struct
609 {
610 uint16_t u16DeviceId; /**< Bits 15:0 - Device ID. */
611 uint16_t u16Rsvd0; /**< Bits 31:16 - Reserved. */
612 uint32_t u19Rsvd0 : 19; /**< Bits 50:32 - Reserved. */
613 uint32_t u1Intr : 1; /**< Bit 51 - I: Interrupt. */
614 uint32_t u1Rsvd0 : 1; /**< Bit 52 - Reserved. */
615 uint32_t u1ReadWrite : 1; /**< Bit 53 - RW: Read/Write. */
616 uint32_t u2Rsvd0 : 2; /**< Bits 55:54 - Reserved. */
617 uint32_t u1Translation : 1; /**< Bit 56 - TR: Translation. */
618 uint32_t u2Type : 2; /**< Bits 58:57 - Type: The type of hardware error. */
619 uint32_t u1Rsvd1 : 1; /**< Bit 59 - Reserved. */
620 uint16_t u4EventCode : 4; /**< Bits 63:60 - Event code. */
621 uint32_t u4Rsvd0 : 4; /**< Bits 67:64 - Reserved. */
622 uint32_t u28AddrLo : 28; /**< Bits 95:68 - Address: System Physical Address (Lo). */
623 uint32_t u32AddrHi; /**< Bits 127:96 - Address: System Physical Address (Hi). */
624 } n;
625 /** The 32-bit unsigned integer view. */
626 uint32_t au32[4];
627} EVT_DEV_TAB_HARDWARE_ERROR;
628AssertCompileSize(EVT_DEV_TAB_HARDWARE_ERROR, 16);
629
630/**
631 * Event Log Entry: EVT_PAGE_TAB_HARDWARE_ERROR.
632 * In accordance with the AMD spec.
633 */
634typedef union
635{
636 struct
637 {
638 uint16_t u16DeviceId; /**< Bits 15:0 - Device ID. */
639 uint16_t u16Rsvd0; /**< Bits 31:16 - Reserved. */
640 uint32_t u16DomainOrPasidLo : 16; /**< Bits 47:32 - D/P: Domain ID or Process Address-Space ID (Lo). */
641 uint32_t u1GuestOrNested : 1; /**< Bit 48 - GN: Guest (GPA) or Nested (GVA). */
642 uint32_t u2Rsvd0 : 2; /**< Bits 50:49 - Reserved. */
643 uint32_t u1Interrupt : 1; /**< Bit 51 - I: Interrupt. */
644 uint32_t u1Rsvd0 : 1; /**< Bit 52 - Reserved. */
645 uint32_t u1ReadWrite : 1; /**< Bit 53 - RW: Read/Write. */
646 uint32_t u2Rsvd1 : 2; /**< Bit 55:54 - Reserved. */
647 uint32_t u1Translation : 1; /**< Bit 56 - TR: Translation. */
648 uint32_t u2Type : 2; /**< Bits 58:57 - Type: The type of hardware error. */
649 uint32_t u1Rsvd1 : 1; /**< Bit 59 - Reserved. */
650 uint32_t u4EventCode : 4; /**< Bit 63:60 - Event code. */
651 /** @todo r=ramshankar: Figure 55: PAGE_TAB_HARDWARE_ERROR says Addr[31:3] but
652 * table 58 mentions Addr[31:4]. Looks like a typo in the figure. Use
653 * table as it makes more sense and matches address size in
654 * EVT_DEV_TAB_HARDWARE_ERROR. See AMD AMD IOMMU spec (3.05-PUB, Jan
655 * 2020). */
656 uint32_t u4Rsvd0 : 4; /**< Bits 67:64 - Reserved. */
657 uint32_t u28AddrLo : 28; /**< Bits 95:68 - Address: SPA of page table entry (Lo). */
658 uint32_t u32AddrHi; /**< Bits 127:96 - Address: SPA of page table entry (Hi). */
659 } n;
660 /** The 32-bit unsigned integer view. */
661 uint32_t au32[4];
662} EVT_PAGE_TAB_HARDWARE_ERROR;
663AssertCompileSize(EVT_PAGE_TAB_HARDWARE_ERROR, 16);
664
665/**
666 * Event Log Entry: ILLEGAL_COMMAND_ERROR.
667 * In accordance with the AMD spec.
668 */
669typedef union
670{
671 struct
672 {
673 uint32_t u32Rsvd0; /**< Bits 31:0 - Reserved. */
674 uint32_t u28Rsvd0 : 28; /**< Bits 47:32 - Reserved. */
675 uint32_t u4EventCode : 4; /**< Bits 63:60 - Event code. */
676 uint32_t u4Rsvd0 : 4; /**< Bits 67:64 - Reserved. */
677 uint32_t u28AddrLo : 28; /**< Bits 95:68 - Address: SPA of the invalid command (Lo). */
678 uint32_t u32AddrHi; /**< Bits 127:96 - Address: SPA of the invalid command (Hi). */
679 } n;
680 /** The 32-bit unsigned integer view. */
681 uint32_t au32[4];
682} EVT_ILLEGAL_COMMAND_ENTRY;
683AssertCompileSize(EVT_ILLEGAL_COMMAND_ENTRY, 16);
684
685/**
686 * Event Log Entry: COMMAND_HARDWARE_ERROR.
687 * In accordance with the AMD spec.
688 */
689typedef union
690{
691 struct
692 {
693 uint32_t u32Rsvd0; /**< Bits 31:0 - Reserved. */
694 uint32_t u4Rsvd0 : 4; /**< Bits 35:32 - Reserved. */
695 uint32_t u28AddrLo : 28; /**< Bits 63:36 - Address: SPA of the attempted access (Lo). */
696 uint32_t u32AddrHi; /**< Bits 95:64 - Address: SPA of the attempted access (Hi). */
697 } n;
698 /** The 32-bit unsigned integer view. */
699 uint32_t au32[3];
700} EVT_COMMAND_HARDWARE_ERROR;
701AssertCompileSize(EVT_COMMAND_HARDWARE_ERROR, 12);
702
703/**
704 * Event Log Entry: IOTLB_INV_TIMEOUT.
705 * In accordance with the AMD spec.
706 */
707typedef union
708{
709 struct
710 {
711 uint16_t u16DeviceId; /**< Bits 15:0 - Device ID. */
712 uint16_t u16Rsvd0; /**< Bits 31:16 - Reserved.*/
713 uint32_t u28Rsvd0 : 28; /**< Bits 59:32 - Reserved. */
714 uint32_t u4EventCode : 4; /**< Bits 63:60 - Event code. */
715 uint32_t u4Rsvd0 : 4; /**< Bits 67:64 - Reserved. */
716 uint32_t u28AddrLo : 28; /**< Bits 95:68 - Address: SPA of the invalidation command that timedout (Lo). */
717 uint32_t u32AddrHi; /**< Bits 127:96 - Address: SPA of the invalidation command that timedout (Hi). */
718 } n;
719 /** The 32-bit unsigned integer view. */
720 uint32_t au32[4];
721} EVT_IOTLB_INV_TIMEOUT;
722AssertCompileSize(EVT_IOTLB_INV_TIMEOUT, 16);
723
724/**
725 * Event Log Entry: INVALID_DEVICE_REQUEST.
726 * In accordance with the AMD spec.
727 */
728typedef union
729{
730 struct
731 {
732 uint32_t u16DeviceId : 16; /***< Bits 15:0 - Device ID. */
733 uint32_t u4PasidHi : 4; /***< Bits 19:16 - PASID: Process Address-Space ID (Hi). */
734 uint32_t u12Rsvd0 : 12; /***< Bits 31:20 - Reserved. */
735 uint32_t u16PasidLo : 16; /***< Bits 47:32 - PASID: Process Address-Space ID (Lo). */
736 uint32_t u1GuestOrNested : 1; /***< Bit 48 - GN: Guest (GPA) or Nested (GVA). */
737 uint32_t u1User : 1; /***< Bit 49 - US: User/Supervisor. */
738 uint32_t u6Rsvd0 : 6; /***< Bits 55:50 - Reserved. */
739 uint32_t u1Translation: 1; /***< Bit 56 - TR: Translation. */
740 uint32_t u3Type: 3; /***< Bits 59:57 - Type: The type of hardware error. */
741 uint32_t u4EventCode : 4; /***< Bits 63:60 - Event code. */
742 uint64_t u64Addr; /***< Bits 127:64 - Address: Translation or access address. */
743 } n;
744 /** The 32-bit unsigned integer view. */
745 uint32_t au32[4];
746} EVT_INVALID_DEVICE_REQUEST;
747AssertCompileSize(EVT_INVALID_DEVICE_REQUEST, 16);
748
749/**
750 * Event Log Entry: EVENT_COUNTER_ZERO.
751 * In accordance with the AMD spec.
752 */
753typedef union
754{
755 struct
756 {
757 uint32_t u32Rsvd0; /**< Bits 31:0 - Reserved. */
758 uint32_t u28Rsvd0 : 28; /**< Bits 59:32 - Reserved. */
759 uint32_t u4EventCode : 4; /**< Bits 63:60 - Event code. */
760 uint32_t u20CounterNoteHi : 20; /**< Bits 83:64 - CounterNote: Counter value for the event counter register (Hi). */
761 uint32_t u12Rsvd0 : 12; /**< Bits 95:84 - Reserved. */
762 uint32_t u32CounterNoteLo; /**< Bits 127:96 - CounterNote: Counter value for the event cuonter register (Lo). */
763 } n;
764 /** The 32-bit unsigned integer view. */
765 uint32_t au32[4];
766} EVT_EVENT_COUNTER_ZERO;
767AssertCompileSize(EVT_EVENT_COUNTER_ZERO, 16);
768
769
770#ifndef VBOX_DEVICE_STRUCT_TESTCASE
771/**
772 * The device registration structure.
773 */
774const PDMDEVREG g_DeviceIommu =
775{
776 /* .u32Version = */ PDM_DEVREG_VERSION,
777 /* .uReserved0 = */ 0,
778 /* .szName = */ "iommu",
779 /* .fFlags = */ /** @todo IOMMU: figure out flags. */,
780 /* .fClass = */ PDM_DEVREG_CLASS_ARCH, /** @todo IOMMU: We want to be instantiated
781 before PDM_DEVREG_CLASS_BUS_PCI? Maybe doesn't matter? */
782 /* .cMaxInstances = */ ~0U,
783 /* .uSharedVersion = */ 42,
784 /* .cbInstanceShared = */ sizeof(), /** @todo IOMMU: compute. */
785 /* .cbInstanceCC = */ sizeof(), /** @todo IOMMU: compute. */
786 /* .cbInstanceRC = */ sizeof(), /** @todo IOMMU: compute. */
787 /* .cMaxPciDevices = */ 1,
788 /* .cMaxMsixVectors = */ 0,
789 /* .pszDescription = */ "IOMMU (AMD)",
790#if defined(IN_RING3)
791 /* .pszRCMod = */ "VBoxDDRC.rc",
792 /* .pszR0Mod = */ "VBoxDDR0.r0",
793 /* .pfnConstruct = */ iommuR3Construct,
794 /* .pfnDestruct = */ iommuR3Destruct,
795 /* .pfnRelocate = */ NULL,
796 /* .pfnMemSetup = */ NULL,
797 /* .pfnPowerOn = */ NULL,
798 /* .pfnReset = */ iommuR3Reset,
799 /* .pfnSuspend = */ iommuR3Suspend,
800 /* .pfnResume = */ NULL,
801 /* .pfnAttach = */ iommuR3Attach,
802 /* .pfnDetach = */ iommuR3Detach,
803 /* .pfnQueryInterface = */ NULL,
804 /* .pfnInitComplete = */ NULL,
805 /* .pfnPowerOff = */ iommuR3PowerOff,
806 /* .pfnSoftReset = */ NULL,
807 /* .pfnReserved0 = */ NULL,
808 /* .pfnReserved1 = */ NULL,
809 /* .pfnReserved2 = */ NULL,
810 /* .pfnReserved3 = */ NULL,
811 /* .pfnReserved4 = */ NULL,
812 /* .pfnReserved5 = */ NULL,
813 /* .pfnReserved6 = */ NULL,
814 /* .pfnReserved7 = */ NULL,
815#elif defined(IN_RING0)
816 /* .pfnEarlyConstruct = */ NULL,
817 /* .pfnConstruct = */ iommuRZConstruct,
818 /* .pfnDestruct = */ NULL,
819 /* .pfnFinalDestruct = */ NULL,
820 /* .pfnRequest = */ NULL,
821 /* .pfnReserved0 = */ NULL,
822 /* .pfnReserved1 = */ NULL,
823 /* .pfnReserved2 = */ NULL,
824 /* .pfnReserved3 = */ NULL,
825 /* .pfnReserved4 = */ NULL,
826 /* .pfnReserved5 = */ NULL,
827 /* .pfnReserved6 = */ NULL,
828 /* .pfnReserved7 = */ NULL,
829#elif defined(IN_RC)
830 /* .pfnConstruct = */ iommuRZConstruct,
831 /* .pfnReserved0 = */ NULL,
832 /* .pfnReserved1 = */ NULL,
833 /* .pfnReserved2 = */ NULL,
834 /* .pfnReserved3 = */ NULL,
835 /* .pfnReserved4 = */ NULL,
836 /* .pfnReserved5 = */ NULL,
837 /* .pfnReserved6 = */ NULL,
838 /* .pfnReserved7 = */ NULL,
839#else
840# error "Not in IN_RING3, IN_RING0 or IN_RC!"
841#endif
842 /* .u32VersionEnd = */ PDM_DEVREG_VERSION
843};
844
845#endif /* !VBOX_DEVICE_STRUCT_TESTCASE */
Note: See TracBrowser for help on using the repository browser.

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