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)
806806 return container_of (dom , struct dmar_domain , domain );
807807}
808808
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+
809816/* Retrieve the domain ID which has allocated to the domain */
810817static inline u16
811818domain_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)
816823 return info -> did ;
817824}
818825
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+
819835/*
820836 * 0: readable
821837 * 1: writable
Original file line number Diff line number Diff line change 2222#define is_pasid_enabled (entry ) (((entry)->lo >> 3) & 0x1)
2323#define get_pasid_dir_size (entry ) (1 << ((((entry)->lo >> 9) & 0x7) + 7))
2424
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-
3225#define PASID_FLAG_NESTED BIT(1)
3326#define PASID_FLAG_PAGE_SNOOP BIT(2)
3427
You can’t perform that action at this time.
0 commit comments