[PATCH RFC PREVIEW 2/6] iommu: Make IOMMU_IOPF selectable in Kconfig

Klaus Jensen posted 6 patches 1 year, 3 months ago
[PATCH RFC PREVIEW 2/6] iommu: Make IOMMU_IOPF selectable in Kconfig
Posted by Klaus Jensen 1 year, 3 months ago
From: Joel Granados <j.granados@samsung.com>

IOMMU_IOPF is no longer selectable through INTEL_IOMMU_SVM effectively
severing their relation and allowing them to be used independently.

Signed-off-by: Joel Granados <j.granados@samsung.com>
---
 drivers/iommu/Kconfig       | 2 +-
 drivers/iommu/intel/Kconfig | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig
index a82f10054aec..d3ee8a0ad4a6 100644
--- a/drivers/iommu/Kconfig
+++ b/drivers/iommu/Kconfig
@@ -164,7 +164,7 @@ config IOMMU_SVA
 	bool
 
 config IOMMU_IOPF
-	bool
+	bool "Enable IO page fault in IOMMU"
 
 config FSL_PAMU
 	bool "Freescale IOMMU support"
diff --git a/drivers/iommu/intel/Kconfig b/drivers/iommu/intel/Kconfig
index f52fb39c968e..fb5a4593c197 100644
--- a/drivers/iommu/intel/Kconfig
+++ b/drivers/iommu/intel/Kconfig
@@ -51,7 +51,6 @@ config INTEL_IOMMU_SVM
 	depends on X86_64
 	select MMU_NOTIFIER
 	select IOMMU_SVA
-	select IOMMU_IOPF
 	help
 	  Shared Virtual Memory (SVM) provides a facility for devices
 	  to access DMA resources through process address space by

-- 
2.45.2
Re: [PATCH RFC PREVIEW 2/6] iommu: Make IOMMU_IOPF selectable in Kconfig
Posted by Jason Gunthorpe 1 year, 3 months ago
On Mon, Aug 26, 2024 at 01:40:28PM +0200, Klaus Jensen wrote:
> From: Joel Granados <j.granados@samsung.com>
> 
> IOMMU_IOPF is no longer selectable through INTEL_IOMMU_SVM effectively
> severing their relation and allowing them to be used independently.
> 
> Signed-off-by: Joel Granados <j.granados@samsung.com>
> ---
>  drivers/iommu/Kconfig       | 2 +-
>  drivers/iommu/intel/Kconfig | 1 -
>  2 files changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig
> index a82f10054aec..d3ee8a0ad4a6 100644
> --- a/drivers/iommu/Kconfig
> +++ b/drivers/iommu/Kconfig
> @@ -164,7 +164,7 @@ config IOMMU_SVA
>  	bool
>  
>  config IOMMU_IOPF
> -	bool
> +	bool "Enable IO page fault in IOMMU"


Currently IOMMU_IOPF indicates that the driver wants to consume the
library functions around IOPF, it is not a user selectable because any
driver that links to those functions should have them working. If you
want to make the core driver use them then the select should be moved
from the SVM sub config to the core driver config.

If you want to change IOMMU_IOPF to a user configurable then it should
have a full help text and all the kconfig places touching it should be
turned into

  depends IOMMU_IOPF

Ie you can't enable any drivers SVA kconfig without also picking
IOMMU_IOPF.

This is doing neither fully.. Pick one :)

Jason
Re: [PATCH RFC PREVIEW 2/6] iommu: Make IOMMU_IOPF selectable in Kconfig
Posted by Joel Granados 1 year, 3 months ago
On Mon, Aug 26, 2024 at 11:05:58AM -0300, Jason Gunthorpe wrote:
> On Mon, Aug 26, 2024 at 01:40:28PM +0200, Klaus Jensen wrote:
> > From: Joel Granados <j.granados@samsung.com>
> > 
> > IOMMU_IOPF is no longer selectable through INTEL_IOMMU_SVM effectively
> > severing their relation and allowing them to be used independently.
> > 
> > Signed-off-by: Joel Granados <j.granados@samsung.com>
> > ---
> >  drivers/iommu/Kconfig       | 2 +-
> >  drivers/iommu/intel/Kconfig | 1 -
> >  2 files changed, 1 insertion(+), 2 deletions(-)
> > 
> > diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig
> > index a82f10054aec..d3ee8a0ad4a6 100644
> > --- a/drivers/iommu/Kconfig
> > +++ b/drivers/iommu/Kconfig
> > @@ -164,7 +164,7 @@ config IOMMU_SVA
> >  	bool
> >  
> >  config IOMMU_IOPF
> > -	bool
> > +	bool "Enable IO page fault in IOMMU"
> 
> 
> Currently IOMMU_IOPF indicates that the driver wants to consume the
> library functions around IOPF, it is not a user selectable because any
> driver that links to those functions should have them working. If you
> want to make the core driver use them then the select should be moved
> from the SVM sub config to the core driver config.
This is in line with the feedback that I got from Lu. I'll put
IOMMU_IOPF under INTEL_IOMMU and drop this commit from the set.

Thx.

> 
> If you want to change IOMMU_IOPF to a user configurable then it should
> have a full help text and all the kconfig places touching it should be
> turned into
> 
>   depends IOMMU_IOPF
> 
> Ie you can't enable any drivers SVA kconfig without also picking
> IOMMU_IOPF.
> 
> This is doing neither fully.. Pick one :)
> 
> Jason

-- 

Joel Granados