xref: /qemu/include/hw/i386/intel_iommu.h (revision 642ba89672279fbdd14016a90da239c85e845d18)
11da12ec4SLe Tan /*
21da12ec4SLe Tan  * QEMU emulation of an Intel IOMMU (VT-d)
31da12ec4SLe Tan  *   (DMA Remapping device)
41da12ec4SLe Tan  *
51da12ec4SLe Tan  * Copyright (C) 2013 Knut Omang, Oracle <knut.omang@oracle.com>
61da12ec4SLe Tan  * Copyright (C) 2014 Le Tan, <tamlokveer@gmail.com>
71da12ec4SLe Tan  *
81da12ec4SLe Tan  * This program is free software; you can redistribute it and/or modify
91da12ec4SLe Tan  * it under the terms of the GNU General Public License as published by
101da12ec4SLe Tan  * the Free Software Foundation; either version 2 of the License, or
111da12ec4SLe Tan  * (at your option) any later version.
121da12ec4SLe Tan 
131da12ec4SLe Tan  * This program is distributed in the hope that it will be useful,
141da12ec4SLe Tan  * but WITHOUT ANY WARRANTY; without even the implied warranty of
151da12ec4SLe Tan  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
161da12ec4SLe Tan  * GNU General Public License for more details.
171da12ec4SLe Tan 
181da12ec4SLe Tan  * You should have received a copy of the GNU General Public License along
191da12ec4SLe Tan  * with this program; if not, see <http://www.gnu.org/licenses/>.
201da12ec4SLe Tan  */
211da12ec4SLe Tan 
221da12ec4SLe Tan #ifndef INTEL_IOMMU_H
231da12ec4SLe Tan #define INTEL_IOMMU_H
24a27bd6c7SMarkus Armbruster 
251c7955c4SPeter Xu #include "hw/i386/x86-iommu.h"
2663b88968SPeter Xu #include "qemu/iova-tree.h"
27db1015e9SEduardo Habkost #include "qom/object.h"
281da12ec4SLe Tan 
291da12ec4SLe Tan #define TYPE_INTEL_IOMMU_DEVICE "intel-iommu"
308063396bSEduardo Habkost OBJECT_DECLARE_SIMPLE_TYPE(IntelIOMMUState, INTEL_IOMMU_DEVICE)
311da12ec4SLe Tan 
321221a474SAlexey Kardashevskiy #define TYPE_INTEL_IOMMU_MEMORY_REGION "intel-iommu-iommu-memory-region"
331221a474SAlexey Kardashevskiy 
341da12ec4SLe Tan /* DMAR Hardware Unit Definition address (IOMMU unit) */
351da12ec4SLe Tan #define Q35_HOST_BRIDGE_IOMMU_ADDR  0xfed90000ULL
361da12ec4SLe Tan 
371da12ec4SLe Tan #define VTD_PCI_BUS_MAX             256
381da12ec4SLe Tan #define VTD_PCI_SLOT_MAX            32
391da12ec4SLe Tan #define VTD_PCI_FUNC_MAX            8
401da12ec4SLe Tan #define VTD_PCI_SLOT(devfn)         (((devfn) >> 3) & 0x1f)
411da12ec4SLe Tan #define VTD_PCI_FUNC(devfn)         ((devfn) & 0x07)
421e06f131SMichael S. Tsirkin #define VTD_SID_TO_BUS(sid)         (((sid) >> 8) & 0xff)
43d92fa2dcSLe Tan #define VTD_SID_TO_DEVFN(sid)       ((sid) & 0xff)
441da12ec4SLe Tan 
451da12ec4SLe Tan #define DMAR_REG_SIZE               0x230
4692e5d85eSPrasad Singamsetty #define VTD_HOST_AW_39BIT           39
4792e5d85eSPrasad Singamsetty #define VTD_HOST_AW_48BIT           48
4892e5d85eSPrasad Singamsetty #define VTD_HOST_ADDRESS_WIDTH      VTD_HOST_AW_39BIT
4992e5d85eSPrasad Singamsetty #define VTD_HAW_MASK(aw)            ((1ULL << (aw)) - 1)
501da12ec4SLe Tan 
51d46114f9SPeter Xu #define DMAR_REPORT_F_INTR          (1)
52d46114f9SPeter Xu 
53651e4cefSPeter Xu #define  VTD_MSI_ADDR_HI_MASK        (0xffffffff00000000ULL)
54651e4cefSPeter Xu #define  VTD_MSI_ADDR_HI_SHIFT       (32)
55651e4cefSPeter Xu #define  VTD_MSI_ADDR_LO_MASK        (0x00000000ffffffffULL)
56651e4cefSPeter Xu 
57d92fa2dcSLe Tan typedef struct VTDContextEntry VTDContextEntry;
58d92fa2dcSLe Tan typedef struct VTDContextCacheEntry VTDContextCacheEntry;
591da12ec4SLe Tan typedef struct VTDAddressSpace VTDAddressSpace;
60b5a280c0SLe Tan typedef struct VTDIOTLBEntry VTDIOTLBEntry;
61bc38ee10SMichael S. Tsirkin typedef union VTD_IR_TableEntry VTD_IR_TableEntry;
621f91aceeSPeter Xu typedef union VTD_IR_MSIAddress VTD_IR_MSIAddress;
63fb43cf73SLiu, Yi L typedef struct VTDPASIDDirEntry VTDPASIDDirEntry;
64fb43cf73SLiu, Yi L typedef struct VTDPASIDEntry VTDPASIDEntry;
65d92fa2dcSLe Tan 
66d92fa2dcSLe Tan /* Context-Entry */
67d92fa2dcSLe Tan struct VTDContextEntry {
68fb43cf73SLiu, Yi L     union {
69fb43cf73SLiu, Yi L         struct {
70d92fa2dcSLe Tan             uint64_t lo;
71d92fa2dcSLe Tan             uint64_t hi;
72d92fa2dcSLe Tan         };
73fb43cf73SLiu, Yi L         struct {
74fb43cf73SLiu, Yi L             uint64_t val[4];
75fb43cf73SLiu, Yi L         };
76fb43cf73SLiu, Yi L     };
77fb43cf73SLiu, Yi L };
78d92fa2dcSLe Tan 
79d92fa2dcSLe Tan struct VTDContextCacheEntry {
80d92fa2dcSLe Tan     /* The cache entry is obsolete if
81d92fa2dcSLe Tan      * context_cache_gen!=IntelIOMMUState.context_cache_gen
82d92fa2dcSLe Tan      */
83d92fa2dcSLe Tan     uint32_t context_cache_gen;
84d92fa2dcSLe Tan     struct VTDContextEntry context_entry;
85d92fa2dcSLe Tan };
86d92fa2dcSLe Tan 
87fb43cf73SLiu, Yi L /* PASID Directory Entry */
88fb43cf73SLiu, Yi L struct VTDPASIDDirEntry {
89fb43cf73SLiu, Yi L     uint64_t val;
90fb43cf73SLiu, Yi L };
91fb43cf73SLiu, Yi L 
92fb43cf73SLiu, Yi L /* PASID Table Entry */
93fb43cf73SLiu, Yi L struct VTDPASIDEntry {
94fb43cf73SLiu, Yi L     uint64_t val[8];
95fb43cf73SLiu, Yi L };
96fb43cf73SLiu, Yi L 
971da12ec4SLe Tan struct VTDAddressSpace {
987df953bdSKnut Omang     PCIBus *bus;
991da12ec4SLe Tan     uint8_t devfn;
1001b2b1237SJason Wang     uint32_t pasid;
1011da12ec4SLe Tan     AddressSpace as;
1023df9d748SAlexey Kardashevskiy     IOMMUMemoryRegion iommu;
1034b519ef1SPeter Xu     MemoryRegion root;          /* The root container of the device */
1044b519ef1SPeter Xu     MemoryRegion nodmar;        /* The alias of shared nodmar MR */
105651e4cefSPeter Xu     MemoryRegion iommu_ir;      /* Interrupt region: 0xfeeXXXXX */
1061b2b1237SJason Wang     MemoryRegion iommu_ir_fault; /* Interrupt region for catching fault */
1071da12ec4SLe Tan     IntelIOMMUState *iommu_state;
108d92fa2dcSLe Tan     VTDContextCacheEntry context_cache_entry;
109b4a4ba0dSPeter Xu     QLIST_ENTRY(VTDAddressSpace) next;
1104f8a62a9SPeter Xu     /* Superset of notifier flags that this address space has */
1114f8a62a9SPeter Xu     IOMMUNotifierFlag notifier_flags;
1128a7c6060SPeter Xu     /*
1138a7c6060SPeter Xu      * @iova_tree traces mapped IOVA ranges.
1148a7c6060SPeter Xu      *
1158a7c6060SPeter Xu      * The tree is not needed if no MAP notifier is registered with current
1168a7c6060SPeter Xu      * VTD address space, because all guest invalidate commands can be
1178a7c6060SPeter Xu      * directly passed to the IOMMU UNMAP notifiers without any further
1188a7c6060SPeter Xu      * reshuffling.
1198a7c6060SPeter Xu      *
1208a7c6060SPeter Xu      * The tree OTOH is required for MAP typed iommu notifiers for a few
1218a7c6060SPeter Xu      * reasons.
1228a7c6060SPeter Xu      *
1238a7c6060SPeter Xu      * Firstly, there's no way to identify whether an PSI (Page Selective
1248a7c6060SPeter Xu      * Invalidations) or DSI (Domain Selective Invalidations) event is an
1258a7c6060SPeter Xu      * MAP or UNMAP event within the message itself.  Without having prior
1268a7c6060SPeter Xu      * knowledge of existing state vIOMMU doesn't know whether it should
1278a7c6060SPeter Xu      * notify MAP or UNMAP for a PSI message it received when caching mode
1288a7c6060SPeter Xu      * is enabled (for MAP notifiers).
1298a7c6060SPeter Xu      *
1308a7c6060SPeter Xu      * Secondly, PSI messages received from guest driver can be enlarged in
1318a7c6060SPeter Xu      * range, covers but not limited to what the guest driver wanted to
1328a7c6060SPeter Xu      * invalidate.  When the range to invalidates gets bigger than the
1338a7c6060SPeter Xu      * limit of a PSI message, it can even become a DSI which will
1348a7c6060SPeter Xu      * invalidate the whole domain.  If the vIOMMU directly notifies the
1358a7c6060SPeter Xu      * registered device with the unmodified range, it may confuse the
1368a7c6060SPeter Xu      * registered drivers (e.g. vfio-pci) on either:
1378a7c6060SPeter Xu      *
1388a7c6060SPeter Xu      *   (1) Trying to map the same region more than once (for
1398a7c6060SPeter Xu      *       VFIO_IOMMU_MAP_DMA, -EEXIST will trigger), or,
1408a7c6060SPeter Xu      *
1418a7c6060SPeter Xu      *   (2) Trying to UNMAP a range that is still partially mapped.
1428a7c6060SPeter Xu      *
1438a7c6060SPeter Xu      * That accuracy is not required for UNMAP-only notifiers, but it is a
1448a7c6060SPeter Xu      * must-to-have for notifiers registered with MAP events, because the
1458a7c6060SPeter Xu      * vIOMMU needs to make sure the shadow page table is always in sync
1468a7c6060SPeter Xu      * with the guest IOMMU pgtables for a device.
1478a7c6060SPeter Xu      */
1488a7c6060SPeter Xu     IOVATree *iova_tree;
1491da12ec4SLe Tan };
1501da12ec4SLe Tan 
151b5a280c0SLe Tan struct VTDIOTLBEntry {
152b5a280c0SLe Tan     uint64_t gfn;
153b5a280c0SLe Tan     uint16_t domain_id;
1541b2b1237SJason Wang     uint32_t pasid;
155b5a280c0SLe Tan     uint64_t slpte;
156d66b969bSJason Wang     uint64_t mask;
15707f7b733SPeter Xu     uint8_t access_flags;
158b5a280c0SLe Tan };
159b5a280c0SLe Tan 
160ede9c94aSPeter Xu /* VT-d Source-ID Qualifier types */
161ede9c94aSPeter Xu enum {
162ede9c94aSPeter Xu     VTD_SQ_FULL = 0x00,     /* Full SID verification */
163ede9c94aSPeter Xu     VTD_SQ_IGN_3 = 0x01,    /* Ignore bit 3 */
164ede9c94aSPeter Xu     VTD_SQ_IGN_2_3 = 0x02,  /* Ignore bits 2 & 3 */
165ede9c94aSPeter Xu     VTD_SQ_IGN_1_3 = 0x03,  /* Ignore bits 1-3 */
166ede9c94aSPeter Xu     VTD_SQ_MAX,
167ede9c94aSPeter Xu };
168ede9c94aSPeter Xu 
169ede9c94aSPeter Xu /* VT-d Source Validation Types */
170ede9c94aSPeter Xu enum {
171ede9c94aSPeter Xu     VTD_SVT_NONE = 0x00,    /* No validation */
172ede9c94aSPeter Xu     VTD_SVT_ALL = 0x01,     /* Do full validation */
173ede9c94aSPeter Xu     VTD_SVT_BUS = 0x02,     /* Validate bus range */
174ede9c94aSPeter Xu     VTD_SVT_MAX,
175ede9c94aSPeter Xu };
176ede9c94aSPeter Xu 
1771f91aceeSPeter Xu /* Interrupt Remapping Table Entry Definition */
178bc38ee10SMichael S. Tsirkin union VTD_IR_TableEntry {
1791f91aceeSPeter Xu     struct {
180e03b5686SMarc-André Lureau #if HOST_BIG_ENDIAN
181*642ba896SThomas Huth         uint64_t dest_id:32;         /* Destination ID */
182*642ba896SThomas Huth         uint64_t __reserved_1:8;     /* Reserved 1 */
183*642ba896SThomas Huth         uint64_t vector:8;           /* Interrupt Vector */
184*642ba896SThomas Huth         uint64_t irte_mode:1;        /* IRTE Mode */
185*642ba896SThomas Huth         uint64_t __reserved_0:3;     /* Reserved 0 */
186*642ba896SThomas Huth         uint64_t __avail:4;          /* Available spaces for software */
187*642ba896SThomas Huth         uint64_t delivery_mode:3;    /* Delivery Mode */
188*642ba896SThomas Huth         uint64_t trigger_mode:1;     /* Trigger Mode */
189*642ba896SThomas Huth         uint64_t redir_hint:1;       /* Redirection Hint */
190*642ba896SThomas Huth         uint64_t dest_mode:1;        /* Destination Mode */
191*642ba896SThomas Huth         uint64_t fault_disable:1;    /* Fault Processing Disable */
192*642ba896SThomas Huth         uint64_t present:1;          /* Whether entry present/available */
1931f91aceeSPeter Xu #else
194*642ba896SThomas Huth         uint64_t present:1;          /* Whether entry present/available */
195*642ba896SThomas Huth         uint64_t fault_disable:1;    /* Fault Processing Disable */
196*642ba896SThomas Huth         uint64_t dest_mode:1;        /* Destination Mode */
197*642ba896SThomas Huth         uint64_t redir_hint:1;       /* Redirection Hint */
198*642ba896SThomas Huth         uint64_t trigger_mode:1;     /* Trigger Mode */
199*642ba896SThomas Huth         uint64_t delivery_mode:3;    /* Delivery Mode */
200*642ba896SThomas Huth         uint64_t __avail:4;          /* Available spaces for software */
201*642ba896SThomas Huth         uint64_t __reserved_0:3;     /* Reserved 0 */
202*642ba896SThomas Huth         uint64_t irte_mode:1;        /* IRTE Mode */
203*642ba896SThomas Huth         uint64_t vector:8;           /* Interrupt Vector */
204*642ba896SThomas Huth         uint64_t __reserved_1:8;     /* Reserved 1 */
205*642ba896SThomas Huth         uint64_t dest_id:32;         /* Destination ID */
2061f91aceeSPeter Xu #endif
207e03b5686SMarc-André Lureau #if HOST_BIG_ENDIAN
2081f91aceeSPeter Xu         uint64_t __reserved_2:44;    /* Reserved 2 */
2091f91aceeSPeter Xu         uint64_t sid_vtype:2;        /* Source-ID Validation Type */
2101f91aceeSPeter Xu         uint64_t sid_q:2;            /* Source-ID Qualifier */
211*642ba896SThomas Huth         uint64_t source_id:16;       /* Source-ID */
2121f91aceeSPeter Xu #else
213*642ba896SThomas Huth         uint64_t source_id:16;       /* Source-ID */
2141f91aceeSPeter Xu         uint64_t sid_q:2;            /* Source-ID Qualifier */
2151f91aceeSPeter Xu         uint64_t sid_vtype:2;        /* Source-ID Validation Type */
2161f91aceeSPeter Xu         uint64_t __reserved_2:44;    /* Reserved 2 */
2171f91aceeSPeter Xu #endif
218bc38ee10SMichael S. Tsirkin     } QEMU_PACKED irte;
2191f91aceeSPeter Xu     uint64_t data[2];
2201f91aceeSPeter Xu };
2211f91aceeSPeter Xu 
2221f91aceeSPeter Xu #define VTD_IR_INT_FORMAT_COMPAT     (0) /* Compatible Interrupt */
2231f91aceeSPeter Xu #define VTD_IR_INT_FORMAT_REMAP      (1) /* Remappable Interrupt */
2241f91aceeSPeter Xu 
2251f91aceeSPeter Xu /* Programming format for MSI/MSI-X addresses */
2261f91aceeSPeter Xu union VTD_IR_MSIAddress {
2271f91aceeSPeter Xu     struct {
228e03b5686SMarc-André Lureau #if HOST_BIG_ENDIAN
2291f91aceeSPeter Xu         uint32_t __head:12;          /* Should always be: 0x0fee */
2301f91aceeSPeter Xu         uint32_t index_l:15;         /* Interrupt index bit 14-0 */
2311f91aceeSPeter Xu         uint32_t int_mode:1;         /* Interrupt format */
2321f91aceeSPeter Xu         uint32_t sub_valid:1;        /* SHV: Sub-Handle Valid bit */
2331f91aceeSPeter Xu         uint32_t index_h:1;          /* Interrupt index bit 15 */
2341f91aceeSPeter Xu         uint32_t __not_care:2;
2351f91aceeSPeter Xu #else
2361f91aceeSPeter Xu         uint32_t __not_care:2;
2371f91aceeSPeter Xu         uint32_t index_h:1;          /* Interrupt index bit 15 */
2381f91aceeSPeter Xu         uint32_t sub_valid:1;        /* SHV: Sub-Handle Valid bit */
2391f91aceeSPeter Xu         uint32_t int_mode:1;         /* Interrupt format */
2401f91aceeSPeter Xu         uint32_t index_l:15;         /* Interrupt index bit 14-0 */
2411f91aceeSPeter Xu         uint32_t __head:12;          /* Should always be: 0x0fee */
2421f91aceeSPeter Xu #endif
243bc38ee10SMichael S. Tsirkin     } QEMU_PACKED addr;
2441f91aceeSPeter Xu     uint32_t data;
2451f91aceeSPeter Xu };
2461f91aceeSPeter Xu 
2471f91aceeSPeter Xu /* When IR is enabled, all MSI/MSI-X data bits should be zero */
2481f91aceeSPeter Xu #define VTD_IR_MSI_DATA          (0)
2491f91aceeSPeter Xu 
2501da12ec4SLe Tan /* The iommu (DMAR) device state struct */
2511da12ec4SLe Tan struct IntelIOMMUState {
2521c7955c4SPeter Xu     X86IOMMUState x86_iommu;
2531da12ec4SLe Tan     MemoryRegion csrmem;
2544b519ef1SPeter Xu     MemoryRegion mr_nodmar;
2554b519ef1SPeter Xu     MemoryRegion mr_ir;
2564b519ef1SPeter Xu     MemoryRegion mr_sys_alias;
2571da12ec4SLe Tan     uint8_t csr[DMAR_REG_SIZE];     /* register values */
2581da12ec4SLe Tan     uint8_t wmask[DMAR_REG_SIZE];   /* R/W bytes */
2591da12ec4SLe Tan     uint8_t w1cmask[DMAR_REG_SIZE]; /* RW1C(Write 1 to Clear) bytes */
2601da12ec4SLe Tan     uint8_t womask[DMAR_REG_SIZE];  /* WO (write only - read returns 0) */
2611da12ec4SLe Tan     uint32_t version;
2621da12ec4SLe Tan 
2633b40f0e5SAviv Ben-David     bool caching_mode;              /* RO - is cap CM enabled? */
2644a4f219eSYi Sun     bool scalable_mode;             /* RO - is Scalable Mode supported? */
265b8ffd7d6SJason Wang     bool snoop_control;             /* RO - is SNP filed supported? */
2663b40f0e5SAviv Ben-David 
2671da12ec4SLe Tan     dma_addr_t root;                /* Current root table pointer */
268fb43cf73SLiu, Yi L     bool root_scalable;             /* Type of root table (scalable or not) */
2691da12ec4SLe Tan     bool dmar_enabled;              /* Set if DMA remapping is enabled */
2701da12ec4SLe Tan 
2711da12ec4SLe Tan     uint16_t iq_head;               /* Current invalidation queue head */
2721da12ec4SLe Tan     uint16_t iq_tail;               /* Current invalidation queue tail */
2731da12ec4SLe Tan     dma_addr_t iq;                  /* Current invalidation queue pointer */
2741da12ec4SLe Tan     uint16_t iq_size;               /* IQ Size in number of entries */
275c0c1d351SLiu, Yi L     bool iq_dw;                     /* IQ descriptor width 256bit or not */
2761da12ec4SLe Tan     bool qi_enabled;                /* Set if the QI is enabled */
2771da12ec4SLe Tan     uint8_t iq_last_desc_type;      /* The type of last completed descriptor */
2781da12ec4SLe Tan 
2791da12ec4SLe Tan     /* The index of the Fault Recording Register to be used next.
2801da12ec4SLe Tan      * Wraps around from N-1 to 0, where N is the number of FRCD_REG.
2811da12ec4SLe Tan      */
2821da12ec4SLe Tan     uint16_t next_frcd_reg;
2831da12ec4SLe Tan 
2841da12ec4SLe Tan     uint64_t cap;                   /* The value of capability reg */
2851da12ec4SLe Tan     uint64_t ecap;                  /* The value of extended capability reg */
2861da12ec4SLe Tan 
287d92fa2dcSLe Tan     uint32_t context_cache_gen;     /* Should be in [1,MAX] */
288b5a280c0SLe Tan     GHashTable *iotlb;              /* IOTLB */
289d92fa2dcSLe Tan 
290da8d439cSJason Wang     GHashTable *vtd_address_spaces;             /* VTD address spaces */
291da8d439cSJason Wang     VTDAddressSpace *vtd_as_cache[VTD_PCI_BUS_MAX]; /* VTD address space cache */
292dd4d607eSPeter Xu     /* list of registered notifiers */
293b4a4ba0dSPeter Xu     QLIST_HEAD(, VTDAddressSpace) vtd_as_with_notifiers;
294a5861439SPeter Xu 
295a5861439SPeter Xu     /* interrupt remapping */
296a5861439SPeter Xu     bool intr_enabled;              /* Whether guest enabled IR */
297a5861439SPeter Xu     dma_addr_t intr_root;           /* Interrupt remapping table pointer */
298a5861439SPeter Xu     uint32_t intr_size;             /* Number of IR table entries */
29928589311SJan Kiszka     bool intr_eime;                 /* Extended interrupt mode enabled */
300e6b6af05SRadim Krčmář     OnOffAuto intr_eim;             /* Toggle for EIM cabability */
301fb506e70SRadim Krčmář     bool buggy_eim;                 /* Force buggy EIM unless eim=off */
30237f51384SPrasad Singamsetty     uint8_t aw_bits;                /* Host/IOVA address width (in bits) */
303ccc23bb0SPeter Xu     bool dma_drain;                 /* Whether DMA r/w draining enabled */
3048646d9c7SDavid Woodhouse     bool dma_translation;           /* Whether DMA translation supported */
3051b2b1237SJason Wang     bool pasid;                     /* Whether to support PASID */
3061d9efa73SPeter Xu 
3071d9efa73SPeter Xu     /*
3081d9efa73SPeter Xu      * Protects IOMMU states in general.  Currently it protects the
3091d9efa73SPeter Xu      * per-IOMMU IOTLB cache, and context entry cache in VTDAddressSpace.
3101d9efa73SPeter Xu      */
3111d9efa73SPeter Xu     QemuMutex iommu_lock;
3121da12ec4SLe Tan };
3131da12ec4SLe Tan 
3147df953bdSKnut Omang /* Find the VTD Address space associated with the given bus pointer,
3157df953bdSKnut Omang  * create a new one if none exists
3167df953bdSKnut Omang  */
3171b2b1237SJason Wang VTDAddressSpace *vtd_find_add_as(IntelIOMMUState *s, PCIBus *bus,
3181b2b1237SJason Wang                                  int devfn, unsigned int pasid);
3197df953bdSKnut Omang 
3201da12ec4SLe Tan #endif
321