lkml.org 
[lkml]   [2019]   [Mar]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH v2 4/7] iommu/vt-d: Ignore domain parameter in attach_device if device requires identity map
From
Date
If a device requires an identity map then it is not safe to attach a
domain that can remap addresses. Warn the user if this occurs.

Signed-off-by: James Sewart <jamessewart@arista.com>
---
drivers/iommu/intel-iommu.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index 2e00e8708f06..104d36f225a7 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -5101,6 +5101,11 @@ static int intel_iommu_attach_device(struct iommu_domain *domain,
}
}

+ if (iommu_no_mapping(dev)) {
+ dmar_domain = si_domain;
+ dev_warn(dev, "VT-d: Device is required to use identity IOMMU mapping, ignoring domain attached\n");
+ }
+
iommu = device_to_iommu(dev, &bus, &devfn);
if (!iommu)
return -ENODEV;
--
2.17.1
\
 
 \ /
  Last update: 2019-03-14 13:00    [W:0.205 / U:2.712 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site