summaryrefslogtreecommitdiffstats
path: root/drivers/iommu/intel-pasid.c
diff options
context:
space:
mode:
authorLu Baolu <baolu.lu@linux.intel.com>2020-01-02 01:18:16 +0100
committerJoerg Roedel <jroedel@suse.de>2020-01-07 14:05:58 +0100
commit87208f22a4d942ce880e7bf092158eecd6ffa293 (patch)
tree005e09f1eb211d1978cdb317c96f6b456b65d890 /drivers/iommu/intel-pasid.c
parentiommu/vt-d: Add set domain DOMAIN_ATTR_NESTING attr (diff)
downloadlinux-87208f22a4d942ce880e7bf092158eecd6ffa293.tar.xz
linux-87208f22a4d942ce880e7bf092158eecd6ffa293.zip
iommu/vt-d: Add PASID_FLAG_FL5LP for first-level pasid setup
Current intel_pasid_setup_first_level() use 5-level paging for first level translation if CPUs use 5-level paging mode too. This makes sense for SVA usages since the page table is shared between CPUs and IOMMUs. But it makes no sense if we only want to use first level for IOVA translation. Add PASID_FLAG_FL5LP bit in the flags which indicates whether the 5-level paging mode should be used. Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com> Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu/intel-pasid.c')
-rw-r--r--drivers/iommu/intel-pasid.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/iommu/intel-pasid.c b/drivers/iommu/intel-pasid.c
index 3cb569e76642..22b30f10b396 100644
--- a/drivers/iommu/intel-pasid.c
+++ b/drivers/iommu/intel-pasid.c
@@ -477,18 +477,15 @@ int intel_pasid_setup_first_level(struct intel_iommu *iommu,
pasid_set_sre(pte);
}
-#ifdef CONFIG_X86
- /* Both CPU and IOMMU paging mode need to match */
- if (cpu_feature_enabled(X86_FEATURE_LA57)) {
+ if (flags & PASID_FLAG_FL5LP) {
if (cap_5lp_support(iommu->cap)) {
pasid_set_flpm(pte, 1);
} else {
- pr_err("VT-d has no 5-level paging support for CPU\n");
+ pr_err("No 5-level paging support for first-level\n");
pasid_clear_entry(pte);
return -EINVAL;
}
}
-#endif /* CONFIG_X86 */
pasid_set_domain_id(pte, did);
pasid_set_address_width(pte, iommu->agaw);