Skip to content

Commit 3b33d4a

Browse files
LuBaolujoergroedel
authored andcommitted
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: Lu Baolu <baolu.lu@linux.intel.com> Signed-off-by: Joerg Roedel <jroedel@suse.de>
1 parent 5d308fc commit 3b33d4a

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

drivers/iommu/intel-iommu.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1621,6 +1621,16 @@ static int iommu_init_domains(struct intel_iommu *iommu)
16211621
*/
16221622
set_bit(0, iommu->domain_ids);
16231623

1624+
/*
1625+
* Vt-d spec rev3.0 (section 6.2.3.1) requires that each pasid
1626+
* entry for first-level or pass-through translation modes should
1627+
* be programmed with a domain id different from those used for
1628+
* second-level or nested translation. We reserve a domain id for
1629+
* this purpose.
1630+
*/
1631+
if (sm_supported(iommu))
1632+
set_bit(FLPT_DEFAULT_DID, iommu->domain_ids);
1633+
16241634
return 0;
16251635
}
16261636

drivers/iommu/intel-pasid.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@
1717
#define PDE_PFN_MASK PAGE_MASK
1818
#define PASID_PDE_SHIFT 6
1919

20+
/*
21+
* Domain ID reserved for pasid entries programmed for first-level
22+
* only and pass-through transfer modes.
23+
*/
24+
#define FLPT_DEFAULT_DID 1
25+
2026
struct pasid_dir_entry {
2127
u64 val;
2228
};

0 commit comments

Comments
 (0)