Re: [PATCH RFC PREVIEW 1/6] iommu/vt-d: Separate page request queue from SVM
From: Joel Granados
Date: Wed Sep 04 2024 - 05:13:28 EST
On Mon, Aug 26, 2024 at 09:09:14PM +0800, Baolu Lu wrote:
> On 2024/8/26 19:40, Klaus Jensen wrote:
> > From: Joel Granados<j.granados@xxxxxxxxxxx>
> >
> > IO page faults are no longer dependent on CONFIG_INTEL_IOMMU_SVM. Move
> > all Page Request Queue (PRQ) functions that handle prq events to a new
> > file in drivers/iommu/intel/prq.c. The page_req_des struct is made
> > available in drivers/iommu/intel/iommu.h.
> >
> > No functional changes are intended. This is a preparation patch to
> > enable the use of IO page faults outside the SVM and nested use cases.
> >
> > Signed-off-by: Joel Granados<j.granados@xxxxxxxxxxx>
> > ---
> > drivers/iommu/intel/Makefile | 2 +-
> > drivers/iommu/intel/iommu.c | 18 +--
> > drivers/iommu/intel/iommu.h | 40 +++++-
> > drivers/iommu/intel/prq.c | 290 ++++++++++++++++++++++++++++++++++++++++
> > drivers/iommu/intel/svm.c | 308 -------------------------------------------
> > 5 files changed, 331 insertions(+), 327 deletions(-)
> >
> > diff --git a/drivers/iommu/intel/Makefile b/drivers/iommu/intel/Makefile
> > index c8beb0281559..d3bb0798092d 100644
> > --- a/drivers/iommu/intel/Makefile
> > +++ b/drivers/iommu/intel/Makefile
> > @@ -1,6 +1,6 @@
> > # SPDX-License-Identifier: GPL-2.0
> > obj-$(CONFIG_DMAR_TABLE) += dmar.o
> > -obj-$(CONFIG_INTEL_IOMMU) += iommu.o pasid.o nested.o cache.o
> > +obj-$(CONFIG_INTEL_IOMMU) += iommu.o pasid.o nested.o cache.o prq.o
> > obj-$(CONFIG_DMAR_TABLE) += trace.o cap_audit.o
> > obj-$(CONFIG_DMAR_PERF) += perf.o
> > obj-$(CONFIG_INTEL_IOMMU_DEBUGFS) += debugfs.o
>
> Thanks for the patch! Now that IOPF is separate from SVA, the Kconfig
> needs to be updated accordingly.
>
> diff --git a/drivers/iommu/intel/Kconfig b/drivers/iommu/intel/Kconfig
> index f52fb39c968e..2888671c9278 100644
> --- a/drivers/iommu/intel/Kconfig
> +++ b/drivers/iommu/intel/Kconfig
> @@ -15,6 +15,7 @@ config INTEL_IOMMU
> select DMA_OPS
> select IOMMU_API
> select IOMMU_IOVA
> + select IOMMU_IOPF
This will force IOMMU_IOPF when INTEL_IOMMU is selected. You do this in
order to use IOPF if available, but it wont conflict with Intel IOMMU's
that do not support IOPF. right?
> select IOMMUFD_DRIVER if IOMMUFD
> select NEED_DMA_MAP_STATE
> select DMAR_TABLE
> @@ -51,7 +52,6 @@ config INTEL_IOMMU_SVM
> depends on X86_64
> select MMU_NOTIFIER
> select IOMMU_SVA
> - select IOMMU_IOPF
I already had this one
> help
> Shared Virtual Memory (SVM) provides a facility for devices
> to access DMA resources through process address space by
>
> Thanks,
> baolu
Thx for the review
best
--
Joel Granados