lkml.org 
[lkml]   [2020]   [Aug]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 8/9] iommu/vt-d: Send IOASID bind/unbind notifications
Date
On Intel Scalable I/O Virtualization (SIOV) enabled platforms with
ENQCMD in use by the guest, KVM must establish a guest-host PASID
translation table prior to the issuing of ENQCMD. PASID translation
table also depends on the IOMMU PASID entry, which is configured during
the guest page table bind time. This patch adds a notification event to
the IOMMU driver such that KVM can be notified when a new guest-host
PASID mapping is established or demolished.

Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
---
drivers/iommu/intel/svm.c | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/drivers/iommu/intel/svm.c b/drivers/iommu/intel/svm.c
index 600e3ae5b656..d8a5efa75095 100644
--- a/drivers/iommu/intel/svm.c
+++ b/drivers/iommu/intel/svm.c
@@ -471,6 +471,11 @@ int intel_svm_bind_gpasid(struct iommu_domain *domain, struct device *dev,
}

mutex_unlock(&pasid_mutex);
+ /*
+ * Notify KVM new host-guest PASID bind is ready. KVM will set up
+ * PASID translation table to support guest ENQCMD.
+ */
+ ioasid_notify(data->hpasid, IOASID_BIND, IOASID_NOTIFY_SET);
return ret;
}

@@ -510,6 +515,8 @@ int intel_svm_unbind_gpasid(struct device *dev, int pasid)
* and perform cleanup.
*/
ioasid_attach_data(pasid, NULL);
+ ioasid_notify(pasid, IOASID_UNBIND,
+ IOASID_NOTIFY_SET);
kfree(svm);
}
}
--
2.7.4
\
 
 \ /
  Last update: 2020-08-22 06:29    [W:0.487 / U:0.976 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site