Skip to content

Commit 16c951f

Browse files
LuBaolugregkh
authored andcommitted
iommu/vt-d: Allow zero SAGAW if second-stage not supported
[ Upstream commit bfd3c6b ] The VT-d spec states (in section 11.4.2) that hardware implementations reporting second-stage translation support (SSTS) field as Clear also report the SAGAW field as 0. Fix an inappropriate check in alloc_iommu(). Fixes: 792fb43 ("iommu/vt-d: Enable Intel IOMMU scalable mode by default") Suggested-by: Raghunathan Srinivasan <raghunathan.srinivasan@intel.com> Reviewed-by: Kevin Tian <kevin.tian@intel.com> Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com> Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com> Link: https://lore.kernel.org/r/20230318024824.124542-1-baolu.lu@linux.intel.com Link: https://lore.kernel.org/r/20230329134721.469447-3-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel <jroedel@suse.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent e4fbeaa commit 16c951f

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/iommu/intel/dmar.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1080,7 +1080,8 @@ static int alloc_iommu(struct dmar_drhd_unit *drhd)
10801080
}
10811081

10821082
err = -EINVAL;
1083-
if (cap_sagaw(iommu->cap) == 0) {
1083+
if (!cap_sagaw(iommu->cap) &&
1084+
(!ecap_smts(iommu->ecap) || ecap_slts(iommu->ecap))) {
10841085
pr_info("%s: No supported address widths. Not attempting DMA translation.\n",
10851086
iommu->name);
10861087
drhd->ignored = 1;

0 commit comments

Comments
 (0)