Commit 3b33d4ab authored by Lu Baolu's avatar Lu Baolu Committed by Joerg Roedel

iommu/vt-d: Reserve a domain id for FL and PT modes

Vt-d spec rev3.0 (section 6.2.3.1) requires that each pasid
entry for first-level or pass-through translation should be
programmed with a domain id different from those used for
second-level or nested translation. It is recommended that
software could use a same domain id for all first-only and
pass-through translations.

This reserves a domain id for first-level and pass-through
translations.

Cc: Ashok Raj <ashok.raj@intel.com>
Cc: Jacob Pan <jacob.jun.pan@linux.intel.com>
Cc: Kevin Tian <kevin.tian@intel.com>
Cc: Liu Yi L <yi.l.liu@intel.com>
Cc: Sanjay Kumar <sanjay.k.kumar@intel.com>
Signed-off-by: default avatarLu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
parent 5d308fc1
...@@ -1621,6 +1621,16 @@ static int iommu_init_domains(struct intel_iommu *iommu) ...@@ -1621,6 +1621,16 @@ static int iommu_init_domains(struct intel_iommu *iommu)
*/ */
set_bit(0, iommu->domain_ids); set_bit(0, iommu->domain_ids);
/*
* Vt-d spec rev3.0 (section 6.2.3.1) requires that each pasid
* entry for first-level or pass-through translation modes should
* be programmed with a domain id different from those used for
* second-level or nested translation. We reserve a domain id for
* this purpose.
*/
if (sm_supported(iommu))
set_bit(FLPT_DEFAULT_DID, iommu->domain_ids);
return 0; return 0;
} }
......
...@@ -17,6 +17,12 @@ ...@@ -17,6 +17,12 @@
#define PDE_PFN_MASK PAGE_MASK #define PDE_PFN_MASK PAGE_MASK
#define PASID_PDE_SHIFT 6 #define PASID_PDE_SHIFT 6
/*
* Domain ID reserved for pasid entries programmed for first-level
* only and pass-through transfer modes.
*/
#define FLPT_DEFAULT_DID 1
struct pasid_dir_entry { struct pasid_dir_entry {
u64 val; u64 val;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment