All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] intel-iommu: respect iommu=pt
@ 2015-11-24 21:53 Shaohua Li
       [not found] ` <58e2344c50053de58ceed658272ecc0f349c2f2f.1448401068.git.shli-b10kYP2dOMg@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Shaohua Li @ 2015-11-24 21:53 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA
  Cc: Kernel-team-b10kYP2dOMg, Joerg Roedel, David Woodhouse

Currently if a device has rmrr or the device is a pci device,
passthrough is disabled even with iommu=pt. The worry is moving such
devices between domains don't work. But some users don't do the domain
reassignment at all, disabling passthough punish everybody. And iommu=pt
is a boot option, user knows the risk. So intead of failing the
passthough, just print a warning and continue the passthough.

Cc: Joerg Roedel <jroedel-l3A5Bk7waGM@public.gmane.org>
Cc: David Woodhouse <David.Woodhouse-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Shaohua Li <shli-b10kYP2dOMg@public.gmane.org>
---
 drivers/iommu/intel-iommu.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index f1042da..24aa0b3 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -2798,8 +2798,12 @@ static int __init dev_prepare_static_identity_mapping(struct device *dev, int hw
 {
 	int ret;
 
-	if (!iommu_should_identity_map(dev, 1))
-		return 0;
+	if (!iommu_should_identity_map(dev, 1)) {
+		if (!(iommu_identity_mapping & IDENTMAP_ALL))
+			return 0;
+		WARN_ONCE(true, "IOMMU passthough is forced on, some devices "
+			"might not work because of device/platform limitations\n");
+	}
 
 	ret = domain_add_dev_info(si_domain, dev);
 	if (!ret)
-- 
2.4.6

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-11-24 22:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-24 21:53 [PATCH] intel-iommu: respect iommu=pt Shaohua Li
     [not found] ` <58e2344c50053de58ceed658272ecc0f349c2f2f.1448401068.git.shli-b10kYP2dOMg@public.gmane.org>
2015-11-24 21:59   ` Woodhouse, David
     [not found]     ` <1448402349.44976.112.camel-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2015-11-24 22:15       ` Shaohua Li
     [not found]         ` <20151124221515.GB2106568-tb7CFzD8y5b7E6g3fPdp/g2O0Ztt9esIQQ4Iyu8u01E@public.gmane.org>
2015-11-24 22:29           ` David Woodhouse

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.