Skip to content

Commit bfd3c6b

Browse files
LuBaolujoergroedel
authored andcommitted
iommu/vt-d: Allow zero SAGAW if second-stage not supported
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 <[email protected]> Reviewed-by: Kevin Tian <[email protected]> Signed-off-by: Jacob Pan <[email protected]> Signed-off-by: Lu Baolu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]>
1 parent c7d6245 commit bfd3c6b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/iommu/intel/dmar.c

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

10731073
err = -EINVAL;
1074-
if (cap_sagaw(iommu->cap) == 0) {
1074+
if (!cap_sagaw(iommu->cap) &&
1075+
(!ecap_smts(iommu->ecap) || ecap_slts(iommu->ecap))) {
10751076
pr_info("%s: No supported address widths. Not attempting DMA translation.\n",
10761077
iommu->name);
10771078
drhd->ignored = 1;

0 commit comments

Comments
 (0)