aboutsummaryrefslogtreecommitdiffstats
path: root/xen/include/xen/iommu.h
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2009-12-08 07:51:30 +0000
committerKeir Fraser <keir.fraser@citrix.com>2009-12-08 07:51:30 +0000
commitb9c20c78789f94b3b550d0a9d694662cba5fa794 (patch)
tree83dc5d7dbbfaa8570a214afe6cb1af5324e21507 /xen/include/xen/iommu.h
parentef86b9f18bdc20297f3d4bd9c21ce17fab81039e (diff)
downloadxen-b9c20c78789f94b3b550d0a9d694662cba5fa794.tar.gz
xen-b9c20c78789f94b3b550d0a9d694662cba5fa794.tar.bz2
xen-b9c20c78789f94b3b550d0a9d694662cba5fa794.zip
VT-d: per-iommu domain-id
Currently, xen uses shared iommu domain-id across all the VT-d units in the platform. The number of iommu domain-ids (NR_DID, e.g. 256) supported by each VT-d unit is reported in Capability register. The limitation of current implementation is it only can support at most NR_DID domains with VT-d in the entire platform, even though the platform can support N * NR_DID (where N is the number of VT-d units). Imagine a platform with several SR_IOV NICs, and each NIC supports 128 VFs. It possibly beyond the NR_DID. This patch implements iommu domain-id management per iommu (VT-d unit), hence solves above limitation. It removes the global domain-id bitmap, instead use domain-id bitmap in struct iommu, and also involve an array to map guest domain-id and iommu domain-id, which is used to iommu domain-id when flush context cache or IOTLB. When a device is assigned to a guest, choose an available iommu domain-id from the device's iommu, and map guest domain id to the domain-id mapping array. When a device is deassigned from a guest, clear the domain-id bit in domain-id bitmap and clear the corresponding entry in domain-id map array if there is no other devices under the same iommu owned by the guest. Signed-off-by: Weidong Han <weidong.han@intel.com>
Diffstat (limited to 'xen/include/xen/iommu.h')
-rw-r--r--xen/include/xen/iommu.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/xen/include/xen/iommu.h b/xen/include/xen/iommu.h
index fe27141c1e..dcecabb9f4 100644
--- a/xen/include/xen/iommu.h
+++ b/xen/include/xen/iommu.h
@@ -55,6 +55,8 @@ struct iommu {
u64 root_maddr; /* root entry machine address */
int irq;
struct intel_iommu *intel;
+ unsigned long *domid_bitmap; /* domain id bitmap */
+ u16 *domid_map; /* domain id mapping array */
};
int iommu_setup(void);