Linux IOMMU Development
 help / color / mirror / Atom feed
From: Joel Granados <joel.granados@kernel.org>
To: David Woodhouse <dwmw2@infradead.org>,
	 Lu Baolu <baolu.lu@linux.intel.com>,
	Joerg Roedel <joro@8bytes.org>,  Will Deacon <will@kernel.org>,
	Robin Murphy <robin.murphy@arm.com>,
	 Jason Gunthorpe <jgg@ziepe.ca>,
	Kevin Tian <kevin.tian@intel.com>,
	 Klaus Jensen <its@irrelevant.dk>
Cc: linux-kernel@vger.kernel.org, iommu@lists.linux.dev,
	 Joel Granados <joel.granados@kernel.org>,
	 Joel Granados <joel.granados@kernel.org>
Subject: [PATCH v4 4/5] iommufd: Enable PRI when doing the iommufd_hwpt_alloc
Date: Tue, 15 Oct 2024 23:08:14 +0200	[thread overview]
Message-ID: <20241015-jag-iopfv8-v4-4-b696ca89ba29@kernel.org> (raw)
In-Reply-To: <20241015-jag-iopfv8-v4-0-b696ca89ba29@kernel.org>

Add IOMMU_HWPT_FAULT_ID_VALID as part of the valid flags when doing an
iommufd_hwpt_alloc allowing the use of an iommu fault allocation
(iommu_fault_alloc) with the IOMMU_HWPT_ALLOC ioctl.

Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Joel Granados <joel.granados@kernel.org>
---
 drivers/iommu/intel/iommu.c          | 3 ++-
 drivers/iommu/iommufd/hw_pagetable.c | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c
index 5d9c3333c92d..dd399ca09859 100644
--- a/drivers/iommu/intel/iommu.c
+++ b/drivers/iommu/intel/iommu.c
@@ -3535,7 +3535,8 @@ intel_iommu_domain_alloc_user(struct device *dev, u32 flags,
 	}
 
 	if (flags &
-	    (~(IOMMU_HWPT_ALLOC_NEST_PARENT | IOMMU_HWPT_ALLOC_DIRTY_TRACKING)))
+	    (~(IOMMU_HWPT_ALLOC_NEST_PARENT | IOMMU_HWPT_ALLOC_DIRTY_TRACKING
+	       | IOMMU_HWPT_FAULT_ID_VALID)))
 		return ERR_PTR(-EOPNOTSUPP);
 	if (nested_parent && !nested_supported(iommu))
 		return ERR_PTR(-EOPNOTSUPP);
diff --git a/drivers/iommu/iommufd/hw_pagetable.c b/drivers/iommu/iommufd/hw_pagetable.c
index d06bf6e6c19f..8f020bc0815f 100644
--- a/drivers/iommu/iommufd/hw_pagetable.c
+++ b/drivers/iommu/iommufd/hw_pagetable.c
@@ -107,7 +107,8 @@ iommufd_hwpt_paging_alloc(struct iommufd_ctx *ictx, struct iommufd_ioas *ioas,
 			  const struct iommu_user_data *user_data)
 {
 	const u32 valid_flags = IOMMU_HWPT_ALLOC_NEST_PARENT |
-				IOMMU_HWPT_ALLOC_DIRTY_TRACKING;
+				IOMMU_HWPT_ALLOC_DIRTY_TRACKING |
+				IOMMU_HWPT_FAULT_ID_VALID;
 	const struct iommu_ops *ops = dev_iommu_ops(idev->dev);
 	struct iommufd_hwpt_paging *hwpt_paging;
 	struct iommufd_hw_pagetable *hwpt;

-- 
2.43.0



  parent reply	other threads:[~2024-10-15 21:08 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-15 21:08 [PATCH v4 0/5] iommu: Enable user space IOPFs in non-PASID and non-svm cases Joel Granados
2024-10-15 21:08 ` [PATCH v4 1/5] iommu/vt-d: Separate page request queue from SVM Joel Granados
2024-10-15 21:08 ` [PATCH v4 2/5] iommu/vt-d: Remove the pasid present check in prq_event_thread Joel Granados
2024-10-28  7:50   ` Yi Liu
2024-10-28  8:23     ` Baolu Lu
2024-10-29  5:11       ` Yi Liu
2024-10-28 10:24     ` Joel Granados
2024-10-29  3:12       ` Baolu Lu
2024-10-29  5:13         ` Yi Liu
2024-10-29  5:39           ` Baolu Lu
2024-10-30  5:51             ` Yi Liu
2024-10-30  8:32               ` Baolu Lu
2024-10-30 14:28         ` Joel Granados
2024-10-31  3:42           ` Baolu Lu
2024-10-31  9:57           ` Baolu Lu
2024-10-31 11:18             ` Joel Granados
2024-10-31 11:46               ` Baolu Lu
2024-10-15 21:08 ` [PATCH v4 3/5] iommu: kconfig: Move IOMMU_IOPF into INTEL_IOMMU Joel Granados
2024-10-15 21:08 ` Joel Granados [this message]
2024-10-15 21:08 ` [PATCH v4 5/5] iommu/vt-d: drop pasid requirement for prq initialization Joel Granados
2024-11-02  3:27 ` [PATCH v4 0/5] iommu: Enable user space IOPFs in non-PASID and non-svm cases Baolu Lu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241015-jag-iopfv8-v4-4-b696ca89ba29@kernel.org \
    --to=joel.granados@kernel.org \
    --cc=baolu.lu@linux.intel.com \
    --cc=dwmw2@infradead.org \
    --cc=iommu@lists.linux.dev \
    --cc=its@irrelevant.dk \
    --cc=jgg@ziepe.ca \
    --cc=joro@8bytes.org \
    --cc=kevin.tian@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox