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 <[email protected]> Cc: David Woodhouse <[email protected]> Signed-off-by: Shaohua Li <[email protected]> --- 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 _______________________________________________ iommu mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/iommu
