iommu/vt-d: Set domain type for a private domain
authorLu Baolu <baolu.lu@linux.intel.com>
Wed, 12 Jun 2019 00:28:46 +0000 (08:28 +0800)
committerJoerg Roedel <jroedel@suse.de>
Wed, 12 Jun 2019 08:36:59 +0000 (10:36 +0200)
Otherwise, domain_get_iommu() will be broken.

Fixes: 942067f1b6b97 ("iommu/vt-d: Identify default domains replaced with private")
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/intel-iommu.c

index 60ec58b..862c978 100644 (file)
@@ -3494,6 +3494,8 @@ static struct dmar_domain *get_private_domain_for_dev(struct device *dev)
 out:
        if (!domain)
                dev_err(dev, "Allocating domain failed\n");
+       else
+               domain->domain.type = IOMMU_DOMAIN_DMA;
 
        return domain;
 }