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

Revert "iommu: Introduce bind/unbind_guest_msi"

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

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

This reverts commit 9db83ab7.
Signed-off-by: NKunkun Jiang <jiangkunkun@huawei.com>
Reviewed-by: NKeqian Zhu <zhukeqian1@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 620e41f8
...@@ -2383,43 +2383,6 @@ static void __iommu_detach_device(struct iommu_domain *domain, ...@@ -2383,43 +2383,6 @@ static void __iommu_detach_device(struct iommu_domain *domain,
trace_detach_device_from_domain(dev); 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) void iommu_detach_device(struct iommu_domain *domain, struct device *dev)
{ {
struct iommu_group *group; struct iommu_group *group;
......
...@@ -248,8 +248,6 @@ struct iommu_iotlb_gather { ...@@ -248,8 +248,6 @@ struct iommu_iotlb_gather {
* @sva_unbind_gpasid: unbind guest pasid and mm * @sva_unbind_gpasid: unbind guest pasid and mm
* @attach_pasid_table: attach a pasid table * @attach_pasid_table: attach a pasid table
* @detach_pasid_table: detach the 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: * @def_domain_type: device default domain type, return value:
* - IOMMU_DOMAIN_IDENTITY: must use an identity domain * - IOMMU_DOMAIN_IDENTITY: must use an identity domain
* - IOMMU_DOMAIN_DMA: must use a dma domain * - IOMMU_DOMAIN_DMA: must use a dma domain
...@@ -347,10 +345,6 @@ struct iommu_ops { ...@@ -347,10 +345,6 @@ struct iommu_ops {
int (*def_domain_type)(struct device *dev); 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_get_config)(struct device *dev, int type, void *data);
int (*dev_set_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, ...@@ -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, extern int iommu_uapi_attach_pasid_table(struct iommu_domain *domain,
void __user *udata); void __user *udata);
extern void iommu_detach_pasid_table(struct iommu_domain *domain); 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_domain_for_dev(struct device *dev);
extern struct iommu_domain *iommu_get_dma_domain(struct device *dev); extern struct iommu_domain *iommu_get_dma_domain(struct device *dev);
extern size_t iommu_pgsize(struct iommu_domain *domain, 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, ...@@ -1221,14 +1211,6 @@ iommu_sva_bind_group(struct iommu_group *group, struct mm_struct *mm,
return NULL; 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 static inline
int iommu_dev_set_config(struct device *dev, int type, void *data) int iommu_dev_set_config(struct device *dev, int type, void *data)
{ {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册