File tree Expand file tree Collapse file tree 2 files changed +16
-7
lines changed Expand file tree Collapse file tree 2 files changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -806,6 +806,13 @@ static inline struct dmar_domain *to_dmar_domain(struct iommu_domain *dom)
806
806
return container_of (dom , struct dmar_domain , domain );
807
807
}
808
808
809
+ /*
810
+ * Domain ID reserved for pasid entries programmed for first-level
811
+ * only and pass-through transfer modes.
812
+ */
813
+ #define FLPT_DEFAULT_DID 1
814
+ #define NUM_RESERVED_DID 2
815
+
809
816
/* Retrieve the domain ID which has allocated to the domain */
810
817
static inline u16
811
818
domain_id_iommu (struct dmar_domain * domain , struct intel_iommu * iommu )
@@ -816,6 +823,15 @@ domain_id_iommu(struct dmar_domain *domain, struct intel_iommu *iommu)
816
823
return info -> did ;
817
824
}
818
825
826
+ static inline u16
827
+ iommu_domain_did (struct iommu_domain * domain , struct intel_iommu * iommu )
828
+ {
829
+ if (domain -> type == IOMMU_DOMAIN_SVA ||
830
+ domain -> type == IOMMU_DOMAIN_IDENTITY )
831
+ return FLPT_DEFAULT_DID ;
832
+ return domain_id_iommu (to_dmar_domain (domain ), iommu );
833
+ }
834
+
819
835
/*
820
836
* 0: readable
821
837
* 1: writable
Original file line number Diff line number Diff line change 22
22
#define is_pasid_enabled (entry ) (((entry)->lo >> 3) & 0x1)
23
23
#define get_pasid_dir_size (entry ) (1 << ((((entry)->lo >> 9) & 0x7) + 7))
24
24
25
- /*
26
- * Domain ID reserved for pasid entries programmed for first-level
27
- * only and pass-through transfer modes.
28
- */
29
- #define FLPT_DEFAULT_DID 1
30
- #define NUM_RESERVED_DID 2
31
-
32
25
#define PASID_FLAG_NESTED BIT(1)
33
26
#define PASID_FLAG_PAGE_SNOOP BIT(2)
34
27
You can’t perform that action at this time.
0 commit comments