From: Kunkun Jiang jiangkunkun@huawei.com
virt inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I61SPO CVE: NA
--------------------------------
This reverts commit 9db83ab7c297b4f0d4d31a22fe389ce31c1ee662.
Signed-off-by: Kunkun Jiang jiangkunkun@huawei.com Reviewed-by: Keqian Zhu zhukeqian1@huawei.com Signed-off-by: Zheng Zengkai zhengzengkai@huawei.com --- drivers/iommu/iommu.c | 37 ------------------------------------- include/linux/iommu.h | 18 ------------------ 2 files changed, 55 deletions(-)
diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index d2fbebee719b..d53c88c647ae 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -2383,43 +2383,6 @@ static void __iommu_detach_device(struct iommu_domain *domain, trace_detach_device_from_domain(dev); }
-/** - * iommu_bind_guest_msi - Passes the stage1 GIOVA/GPA mapping of a - * virtual doorbell - * - * @domain: iommu domain the stage 1 mapping will be attached to - * @iova: iova allocated by the guest - * @gpa: guest physical address of the virtual doorbell - * @size: granule size used for the mapping - * - * The associated IOVA can be reused by the host to create a nested - * stage2 binding mapping translating into the physical doorbell used - * by the devices attached to the domain. - * - * All devices within the domain must share the same physical doorbell. - * A single MSI GIOVA/GPA mapping can be attached to an iommu_domain. - */ - -int iommu_bind_guest_msi(struct iommu_domain *domain, - dma_addr_t giova, phys_addr_t gpa, size_t size) -{ - if (unlikely(!domain->ops->bind_guest_msi)) - return -ENODEV; - - return domain->ops->bind_guest_msi(domain, giova, gpa, size); -} -EXPORT_SYMBOL_GPL(iommu_bind_guest_msi); - -void iommu_unbind_guest_msi(struct iommu_domain *domain, - dma_addr_t giova) -{ - if (unlikely(!domain->ops->unbind_guest_msi)) - return; - - domain->ops->unbind_guest_msi(domain, giova); -} -EXPORT_SYMBOL_GPL(iommu_unbind_guest_msi); - void iommu_detach_device(struct iommu_domain *domain, struct device *dev) { struct iommu_group *group; diff --git a/include/linux/iommu.h b/include/linux/iommu.h index 95320164dcf3..0e696aec98a5 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -248,8 +248,6 @@ struct iommu_iotlb_gather { * @sva_unbind_gpasid: unbind guest pasid and mm * @attach_pasid_table: attach a pasid table * @detach_pasid_table: detach the pasid table - * @bind_guest_msi: provides a stage1 giova/gpa MSI doorbell mapping - * @unbind_guest_msi: withdraw a stage1 giova/gpa MSI doorbell mapping * @def_domain_type: device default domain type, return value: * - IOMMU_DOMAIN_IDENTITY: must use an identity domain * - IOMMU_DOMAIN_DMA: must use a dma domain @@ -347,10 +345,6 @@ struct iommu_ops {
int (*def_domain_type)(struct device *dev);
- int (*bind_guest_msi)(struct iommu_domain *domain, - dma_addr_t giova, phys_addr_t gpa, size_t size); - void (*unbind_guest_msi)(struct iommu_domain *domain, dma_addr_t giova); - int (*dev_get_config)(struct device *dev, int type, void *data); int (*dev_set_config)(struct device *dev, int type, void *data);
@@ -507,10 +501,6 @@ extern int iommu_attach_pasid_table(struct iommu_domain *domain, extern int iommu_uapi_attach_pasid_table(struct iommu_domain *domain, void __user *udata); extern void iommu_detach_pasid_table(struct iommu_domain *domain); -extern int iommu_bind_guest_msi(struct iommu_domain *domain, - dma_addr_t giova, phys_addr_t gpa, size_t size); -extern void iommu_unbind_guest_msi(struct iommu_domain *domain, - dma_addr_t giova); extern struct iommu_domain *iommu_get_domain_for_dev(struct device *dev); extern struct iommu_domain *iommu_get_dma_domain(struct device *dev); extern size_t iommu_pgsize(struct iommu_domain *domain, @@ -1221,14 +1211,6 @@ iommu_sva_bind_group(struct iommu_group *group, struct mm_struct *mm, return NULL; }
-int iommu_bind_guest_msi(struct iommu_domain *domain, - dma_addr_t giova, phys_addr_t gpa, size_t size) -{ - return -ENODEV; -} -static inline -void iommu_unbind_guest_msi(struct iommu_domain *domain, dma_addr_t giova) {} - static inline int iommu_dev_set_config(struct device *dev, int type, void *data) {