Lines Matching refs:pasid

24 #include "pasid.h"
27 static void intel_svm_drain_prq(struct device *dev, u32 pasid);
131 qi_flush_piotlb(sdev->iommu, sdev->did, svm->pasid, address, pages, ih);
134 svm->pasid, sdev->qdep, address,
196 svm->pasid, true);
213 static int pasid_to_svm_sdev(struct device *dev, unsigned int pasid,
224 if (pasid == INVALID_IOASID || pasid >= PASID_MAX)
227 svm = ioasid_find(NULL, pasid, NULL);
314 svm->pasid);
328 * check pasid VMM ownership. We can drop the following line
332 svm->pasid = data->hpasid;
399 int intel_svm_unbind_gpasid(struct device *dev, u32 pasid)
410 ret = pasid_to_svm_sdev(dev, pasid, &svm, &sdev);
420 svm->pasid, false);
421 intel_svm_drain_prq(dev, svm->pasid);
434 ioasid_set_data(pasid, NULL);
449 static void load_pasid(struct mm_struct *mm, u32 pasid)
454 smp_store_release(&mm->pasid, pasid);
505 if (svm->pasid >= pasid_max) {
508 svm->pasid);
568 svm->pasid = ioasid_alloc(NULL, PASID_MIN,
570 if (svm->pasid == INVALID_IOASID) {
585 ioasid_free(svm->pasid);
595 svm->pasid, FLPT_DEFAULT_DID,
603 ioasid_free(svm->pasid);
611 /* The newly allocated pasid is loaded to the mm. */
612 load_pasid(mm, svm->pasid);
622 svm->pasid, FLPT_DEFAULT_DID,
634 sdev->pasid = svm->pasid;
644 static int intel_svm_unbind_mm(struct device *dev, u32 pasid)
655 ret = pasid_to_svm_sdev(dev, pasid, &svm, &sdev);
671 svm->pasid, false);
672 intel_svm_drain_prq(dev, svm->pasid);
676 ioasid_free(svm->pasid);
679 /* Clear mm's pasid. */
705 u64 pasid:20;
752 * intel_svm_drain_prq - Drain page requests and responses for a pasid
754 * @pasid: pasid for draining
756 * Drain all pending page requests and responses related to @pasid in both
758 * driver has stopped DMA, the pasid entry has been cleared, and both IOTLB
761 * It waits until all pending page requests for @pasid in the page fault
766 static void intel_svm_drain_prq(struct device *dev, u32 pasid)
803 if (!req->pasid_present || req->pasid != pasid) {
820 desc[1].qw0 = QI_EIOTLB_PASID(pasid) |
824 desc[2].qw0 = QI_DEV_EIOTLB_PASID(pasid) |
866 event.fault.prm.pasid = desc->pasid;
936 if (!svm || svm->pasid != req->pasid) {
938 svm = ioasid_find(NULL, req->pasid, NULL);
945 iommu->name, req->pasid, ((unsigned long long *)req)[0],
1013 sdev->ops->fault_cb(sdev->dev, req->pasid, req->addr,
1029 resp.qw0 = QI_PGRP_PASID(req->pasid) |
1109 intel_svm_unbind_mm(sdev->dev, sdev->pasid);
1116 u32 pasid;
1120 pasid = sdev->pasid;
1123 return pasid;
1164 if (prm->pasid == 0 || prm->pasid >= PASID_MAX) {
1169 ret = pasid_to_svm_sdev(dev, prm->pasid, &svm, &sdev);
1177 * pasid has been bound to its mm.
1206 desc.qw0 = QI_PGRP_PASID(prm->pasid) | QI_PGRP_DID(sid) |