2020-02-03 18:01:05 +08:00
|
|
|
diff -Nur kae_driver-1.2.8.old/uacce/uacce.c kae_driver-1.2.8/uacce/uacce.c
|
2020-03-04 02:21:12 +08:00
|
|
|
--- kae_driver-1.2.8.old/kae_driver/uacce/uacce.c 2020-02-03 16:15:12.585798416 +0800
|
|
|
|
|
+++ kae_driver-1.2.8/kae_driver/uacce/uacce.c 2020-02-03 16:16:25.797131365 +0800
|
2020-02-03 18:01:05 +08:00
|
|
|
@@ -969,7 +969,7 @@
|
|
|
|
|
if (is_to_free_region)
|
|
|
|
|
uacce_destroy_region(q, qfr);
|
|
|
|
|
}
|
|
|
|
|
-#ifdef CONFIG_IOMMU_SVA
|
|
|
|
|
+#ifdef CONFIG_IOMMU_SVA2
|
|
|
|
|
if (uacce->flags & UACCE_DEV_SVA)
|
|
|
|
|
iommu_sva_unbind_device(uacce->pdev, q->pasid);
|
|
|
|
|
#endif
|
|
|
|
|
@@ -1019,7 +1019,7 @@
|
|
|
|
|
int ret;
|
|
|
|
|
int pasid = 0;
|
|
|
|
|
|
|
|
|
|
-#ifdef CONFIG_IOMMU_SVA
|
|
|
|
|
+#ifdef CONFIG_IOMMU_SVA2
|
|
|
|
|
if (uacce->flags & UACCE_DEV_PASID) {
|
|
|
|
|
ret = iommu_sva_bind_device(uacce->pdev, current->mm, &pasid,
|
|
|
|
|
IOMMU_SVA_FEAT_IOPF, NULL);
|
|
|
|
|
@@ -1052,7 +1052,7 @@
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
err_unbind:
|
|
|
|
|
-#ifdef CONFIG_IOMMU_SVA
|
|
|
|
|
+#ifdef CONFIG_IOMMU_SVA2
|
|
|
|
|
if (uacce->flags & UACCE_DEV_PASID)
|
|
|
|
|
iommu_sva_unbind_device(uacce->pdev, pasid);
|
|
|
|
|
#endif
|
|
|
|
|
@@ -1557,7 +1557,7 @@
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
-#ifndef CONFIG_IOMMU_SVA
|
|
|
|
|
+#ifndef CONFIG_IOMMU_SVA2
|
|
|
|
|
static int uacce_dev_match(struct device *dev, void *data)
|
|
|
|
|
{
|
|
|
|
|
if (dev->parent == data)
|
|
|
|
|
@@ -1732,7 +1732,7 @@
|
|
|
|
|
uacce->ops->get_available_instances =
|
|
|
|
|
uacce_default_get_available_instances;
|
|
|
|
|
|
|
|
|
|
-#ifndef CONFIG_IOMMU_SVA
|
|
|
|
|
+#ifndef CONFIG_IOMMU_SVA2
|
|
|
|
|
ret = uacce_set_iommu_domain(uacce);
|
|
|
|
|
if (ret)
|
|
|
|
|
return ret;
|
|
|
|
|
@@ -1745,7 +1745,7 @@
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (uacce->flags & UACCE_DEV_PASID) {
|
|
|
|
|
-#ifdef CONFIG_IOMMU_SVA
|
|
|
|
|
+#ifdef CONFIG_IOMMU_SVA2
|
|
|
|
|
ret = iommu_sva_init_device(uacce->pdev, IOMMU_SVA_FEAT_IOPF,
|
|
|
|
|
0, 0, NULL);
|
|
|
|
|
if (ret) {
|
|
|
|
|
@@ -1780,7 +1780,7 @@
|
|
|
|
|
return -EAGAIN;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
-#ifdef CONFIG_IOMMU_SVA
|
|
|
|
|
+#ifdef CONFIG_IOMMU_SVA2
|
|
|
|
|
iommu_sva_shutdown_device(uacce->pdev);
|
|
|
|
|
#else
|
|
|
|
|
uacce_unset_iommu_domain(uacce);
|