Skip to content

Commit 9d6ab26

Browse files
LuBaolujoergroedel
authored andcommitted
iommu/vt-d: Block force-snoop domain attaching if no SC support
In the attach_dev callback of the default domain ops, if the domain has been set force_snooping, but the iommu hardware of the device does not support SC(Snoop Control) capability, the callback should block it and return a corresponding error code. Signed-off-by: Lu Baolu <[email protected]> Reviewed-by: Jason Gunthorpe <[email protected]> Reviewed-by: Kevin Tian <[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 ea661ad commit 9d6ab26

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/iommu/intel/iommu.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4333,6 +4333,9 @@ static int prepare_domain_attach_device(struct iommu_domain *domain,
43334333
if (!iommu)
43344334
return -ENODEV;
43354335

4336+
if (dmar_domain->force_snooping && !ecap_sc_support(iommu->ecap))
4337+
return -EOPNOTSUPP;
4338+
43364339
/* check if this iommu agaw is sufficient for max mapped address */
43374340
addr_width = agaw_to_width(iommu->agaw);
43384341
if (addr_width > cap_mgaw(iommu->cap))

0 commit comments

Comments
 (0)