diff mbox series

[3/3] iommu/virtio: Enable x86 support

Message ID 20210316191652.3401335-4-jean-philippe@linaro.org
State New
Headers show
Series Add support for ACPI VIOT | expand

Commit Message

Jean-Philippe Brucker March 16, 2021, 7:16 p.m. UTC
With the VIOT support in place, x86 platforms can now use the
virtio-iommu.

The arm64 Kconfig selects IOMMU_DMA, while x86 IOMMU drivers select it
themselves.

Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>

---
 drivers/iommu/Kconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

-- 
2.30.2

Comments

Joerg Roedel March 18, 2021, 10:44 a.m. UTC | #1
On Tue, Mar 16, 2021 at 08:16:54PM +0100, Jean-Philippe Brucker wrote:
> With the VIOT support in place, x86 platforms can now use the

> virtio-iommu.

> 

> The arm64 Kconfig selects IOMMU_DMA, while x86 IOMMU drivers select it

> themselves.

> 

> Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>

> ---

>  drivers/iommu/Kconfig | 3 ++-

>  1 file changed, 2 insertions(+), 1 deletion(-)

> 

> diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig

> index 2819b5c8ec30..ccca83ef2f06 100644

> --- a/drivers/iommu/Kconfig

> +++ b/drivers/iommu/Kconfig

> @@ -400,8 +400,9 @@ config HYPERV_IOMMU

>  config VIRTIO_IOMMU

>  	tristate "Virtio IOMMU driver"

>  	depends on VIRTIO

> -	depends on ARM64

> +	depends on (ARM64 || X86)

>  	select IOMMU_API

> +	select IOMMU_DMA if X86

>  	select INTERVAL_TREE

>  	select ACPI_VIOT if ACPI

>  	help


Acked-by: Joerg Roedel <jroedel@suse.de>
Robin Murphy March 18, 2021, 11:43 a.m. UTC | #2
On 2021-03-16 19:16, Jean-Philippe Brucker wrote:
> With the VIOT support in place, x86 platforms can now use the

> virtio-iommu.

> 

> The arm64 Kconfig selects IOMMU_DMA, while x86 IOMMU drivers select it

> themselves.


Actually, now that both AMD and Intel are converted over, maybe it's 
finally time to punt that to x86 arch code to match arm64?

Robin.

> Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>

> ---

>   drivers/iommu/Kconfig | 3 ++-

>   1 file changed, 2 insertions(+), 1 deletion(-)

> 

> diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig

> index 2819b5c8ec30..ccca83ef2f06 100644

> --- a/drivers/iommu/Kconfig

> +++ b/drivers/iommu/Kconfig

> @@ -400,8 +400,9 @@ config HYPERV_IOMMU

>   config VIRTIO_IOMMU

>   	tristate "Virtio IOMMU driver"

>   	depends on VIRTIO

> -	depends on ARM64

> +	depends on (ARM64 || X86)

>   	select IOMMU_API

> +	select IOMMU_DMA if X86

>   	select INTERVAL_TREE

>   	select ACPI_VIOT if ACPI

>   	help

>
Michael S. Tsirkin March 18, 2021, 6:28 p.m. UTC | #3
On Tue, Mar 16, 2021 at 08:16:54PM +0100, Jean-Philippe Brucker wrote:
> With the VIOT support in place, x86 platforms can now use the

> virtio-iommu.

> 

> The arm64 Kconfig selects IOMMU_DMA, while x86 IOMMU drivers select it

> themselves.

> 

> Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>


Acked-by: Michael S. Tsirkin <mst@redhat.com>


> ---

>  drivers/iommu/Kconfig | 3 ++-

>  1 file changed, 2 insertions(+), 1 deletion(-)

> 

> diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig

> index 2819b5c8ec30..ccca83ef2f06 100644

> --- a/drivers/iommu/Kconfig

> +++ b/drivers/iommu/Kconfig

> @@ -400,8 +400,9 @@ config HYPERV_IOMMU

>  config VIRTIO_IOMMU

>  	tristate "Virtio IOMMU driver"

>  	depends on VIRTIO

> -	depends on ARM64

> +	depends on (ARM64 || X86)

>  	select IOMMU_API

> +	select IOMMU_DMA if X86


Would it hurt to just select unconditionally? Seems a bit cleaner
...

>  	select INTERVAL_TREE

>  	select ACPI_VIOT if ACPI

>  	help

> -- 

> 2.30.2
Jean-Philippe Brucker April 15, 2021, 3:14 p.m. UTC | #4
On Thu, Mar 18, 2021 at 11:43:38AM +0000, Robin Murphy wrote:
> On 2021-03-16 19:16, Jean-Philippe Brucker wrote:

> > With the VIOT support in place, x86 platforms can now use the

> > virtio-iommu.

> > 

> > The arm64 Kconfig selects IOMMU_DMA, while x86 IOMMU drivers select it

> > themselves.

> 

> Actually, now that both AMD and Intel are converted over, maybe it's finally

> time to punt that to x86 arch code to match arm64?


x86 also has CONFIG_HYPERV_IOMMU that doesn't use IOMMU_DMA, and might not
want to pull in dma-iommu.o + iova.o (don't know if they care about guest
size). There also is the old gart driver, but that doesn't select
IOMMU_SUPPORT. 

Thanks,
Jean
Jean-Philippe Brucker April 15, 2021, 3:15 p.m. UTC | #5
On Thu, Mar 18, 2021 at 02:28:02PM -0400, Michael S. Tsirkin wrote:
> On Tue, Mar 16, 2021 at 08:16:54PM +0100, Jean-Philippe Brucker wrote:

> > With the VIOT support in place, x86 platforms can now use the

> > virtio-iommu.

> > 

> > The arm64 Kconfig selects IOMMU_DMA, while x86 IOMMU drivers select it

> > themselves.

> > 

> > Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>

> 

> Acked-by: Michael S. Tsirkin <mst@redhat.com>

> 

> > ---

> >  drivers/iommu/Kconfig | 3 ++-

> >  1 file changed, 2 insertions(+), 1 deletion(-)

> > 

> > diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig

> > index 2819b5c8ec30..ccca83ef2f06 100644

> > --- a/drivers/iommu/Kconfig

> > +++ b/drivers/iommu/Kconfig

> > @@ -400,8 +400,9 @@ config HYPERV_IOMMU

> >  config VIRTIO_IOMMU

> >  	tristate "Virtio IOMMU driver"

> >  	depends on VIRTIO

> > -	depends on ARM64

> > +	depends on (ARM64 || X86)

> >  	select IOMMU_API

> > +	select IOMMU_DMA if X86

> 

> Would it hurt to just select unconditionally? Seems a bit cleaner

> ...


Yes I think I'll do this for the moment

Thanks,
Jean

> 

> >  	select INTERVAL_TREE

> >  	select ACPI_VIOT if ACPI

> >  	help

> > -- 

> > 2.30.2

>
diff mbox series

Patch

diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig
index 2819b5c8ec30..ccca83ef2f06 100644
--- a/drivers/iommu/Kconfig
+++ b/drivers/iommu/Kconfig
@@ -400,8 +400,9 @@  config HYPERV_IOMMU
 config VIRTIO_IOMMU
 	tristate "Virtio IOMMU driver"
 	depends on VIRTIO
-	depends on ARM64
+	depends on (ARM64 || X86)
 	select IOMMU_API
+	select IOMMU_DMA if X86
 	select INTERVAL_TREE
 	select ACPI_VIOT if ACPI
 	help