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

Revert "iommu/smmuv3: Nested mode single MSI doorbell per domain enforcement"

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

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

This reverts commit b4ddfa73.
Signed-off-by: NKunkun Jiang <jiangkunkun@huawei.com>
Reviewed-by: NKeqian Zhu <zhukeqian1@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 b16fb440
...@@ -2883,37 +2883,6 @@ static void arm_smmu_detach_dev(struct arm_smmu_master *master) ...@@ -2883,37 +2883,6 @@ static void arm_smmu_detach_dev(struct arm_smmu_master *master)
arm_smmu_install_ste_for_dev(master); arm_smmu_install_ste_for_dev(master);
} }
static bool arm_smmu_share_msi_domain(struct iommu_domain *domain,
struct device *dev)
{
struct arm_smmu_domain *smmu_domain = to_smmu_domain(domain);
struct irq_domain *irqd = dev_get_msi_domain(dev);
struct arm_smmu_master *master;
unsigned long flags;
bool share = false;
if (!irqd)
return true;
spin_lock_irqsave(&smmu_domain->devices_lock, flags);
list_for_each_entry(master, &smmu_domain->devices, domain_head) {
struct irq_domain *d = dev_get_msi_domain(master->dev);
if (!d)
continue;
if (irqd != d) {
dev_info(dev, "Nested mode forbids to attach devices "
"using different physical MSI doorbells "
"to the same iommu_domain");
goto unlock;
}
}
share = true;
unlock:
spin_unlock_irqrestore(&smmu_domain->devices_lock, flags);
return share;
}
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;
...@@ -2975,16 +2944,6 @@ static int arm_smmu_attach_dev(struct iommu_domain *domain, struct device *dev) ...@@ -2975,16 +2944,6 @@ static int arm_smmu_attach_dev(struct iommu_domain *domain, struct device *dev)
ret = -EINVAL; ret = -EINVAL;
goto out_unlock; goto out_unlock;
} }
/*
* In nested mode we must check all devices belonging to the
* domain share the same physical MSI doorbell. Otherwise nested
* stage MSI binding is not supported.
*/
if (smmu_domain->stage == ARM_SMMU_DOMAIN_NESTED &&
!arm_smmu_share_msi_domain(domain, dev)) {
ret = -EINVAL;
goto out_unlock;
}
master->domain = smmu_domain; master->domain = smmu_domain;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册