@@ -5576,6 +5576,27 @@ static int intel_iommu_set_dev_attr(struct device *dev,
return ret;
}
+static int intel_iommu_domain_get_attr(struct iommu_domain *domain,
+ enum iommu_attr attr, void *data)
+{
+ struct dmar_domain *dmar_domain = to_dmar_domain(domain);
+ int ret = -EINVAL, *id;
+
+ switch (attr) {
+ case DOMAIN_ATTR_AUXD_ID:
+ if (dmar_domain->default_pasid > 0) {
+ ret = 0;
+ id = data;
+ *id = dmar_domain->default_pasid;
+ }
+ break;
+ default:
+ break;
+ }
+
+ return ret;
+}
+
const struct iommu_ops intel_iommu_ops = {
.capable = intel_iommu_capable,
.domain_alloc = intel_iommu_domain_alloc,
@@ -5592,6 +5613,7 @@ const struct iommu_ops intel_iommu_ops = {
.get_resv_regions = intel_iommu_get_resv_regions,
.put_resv_regions = intel_iommu_put_resv_regions,
.device_group = pci_device_group,
+ .domain_get_attr = intel_iommu_domain_get_attr,
.get_dev_attr = intel_iommu_get_dev_attr,
.set_dev_attr = intel_iommu_set_dev_attr,
.pgsize_bitmap = INTEL_IOMMU_PGSIZES,