提交 b16fb440 编写于 作者: K Kunkun Jiang 提交者: Zheng Zengkai

Revert "iommu/smmuv3: Enforce incompatibility between nested mode and HW MSI regions"

virt inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I61SPO
CVE: NA

--------------------------------

This reverts commit 85412c04.
Signed-off-by: NKunkun Jiang <jiangkunkun@huawei.com>
Reviewed-by: NKeqian Zhu <zhukeqian1@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 c83eca3e
...@@ -2914,23 +2914,6 @@ static bool arm_smmu_share_msi_domain(struct iommu_domain *domain, ...@@ -2914,23 +2914,6 @@ static bool arm_smmu_share_msi_domain(struct iommu_domain *domain,
return share; return share;
} }
static bool arm_smmu_has_hw_msi_resv_region(struct device *dev)
{
struct iommu_resv_region *region;
bool has_msi_resv_region = false;
LIST_HEAD(resv_regions);
iommu_get_resv_regions(dev, &resv_regions);
list_for_each_entry(region, &resv_regions, list) {
if (region->type == IOMMU_RESV_MSI) {
has_msi_resv_region = true;
break;
}
}
iommu_put_resv_regions(dev, &resv_regions);
return has_msi_resv_region;
}
static int arm_smmu_attach_dev(struct iommu_domain *domain, struct device *dev) static int arm_smmu_attach_dev(struct iommu_domain *domain, struct device *dev)
{ {
int ret = 0; int ret = 0;
...@@ -2995,12 +2978,10 @@ static int arm_smmu_attach_dev(struct iommu_domain *domain, struct device *dev) ...@@ -2995,12 +2978,10 @@ static int arm_smmu_attach_dev(struct iommu_domain *domain, struct device *dev)
/* /*
* In nested mode we must check all devices belonging to the * In nested mode we must check all devices belonging to the
* domain share the same physical MSI doorbell. Otherwise nested * domain share the same physical MSI doorbell. Otherwise nested
* stage MSI binding is not supported. Also nested mode is not * stage MSI binding is not supported.
* compatible with MSI HW reserved regions.
*/ */
if (smmu_domain->stage == ARM_SMMU_DOMAIN_NESTED && if (smmu_domain->stage == ARM_SMMU_DOMAIN_NESTED &&
(!arm_smmu_share_msi_domain(domain, dev) || !arm_smmu_share_msi_domain(domain, dev)) {
arm_smmu_has_hw_msi_resv_region(dev))) {
ret = -EINVAL; ret = -EINVAL;
goto out_unlock; goto out_unlock;
} }
......
...@@ -3127,7 +3127,6 @@ void iommu_get_resv_regions(struct device *dev, struct list_head *list) ...@@ -3127,7 +3127,6 @@ void iommu_get_resv_regions(struct device *dev, struct list_head *list)
if (ops && ops->get_resv_regions) if (ops && ops->get_resv_regions)
ops->get_resv_regions(dev, list); ops->get_resv_regions(dev, list);
} }
EXPORT_SYMBOL_GPL(iommu_get_resv_regions);
void iommu_put_resv_regions(struct device *dev, struct list_head *list) void iommu_put_resv_regions(struct device *dev, struct list_head *list)
{ {
...@@ -3136,7 +3135,6 @@ void iommu_put_resv_regions(struct device *dev, struct list_head *list) ...@@ -3136,7 +3135,6 @@ void iommu_put_resv_regions(struct device *dev, struct list_head *list)
if (ops && ops->put_resv_regions) if (ops && ops->put_resv_regions)
ops->put_resv_regions(dev, list); ops->put_resv_regions(dev, list);
} }
EXPORT_SYMBOL_GPL(iommu_put_resv_regions);
/** /**
* generic_iommu_put_resv_regions - Reserved region driver helper * generic_iommu_put_resv_regions - Reserved region driver helper
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册