diff mbox series

[PATCH/RFC] drivers/vfio: Allow type-1 IOMMU instantiation with Renesas IPMMU-VMSA

Message ID 20180725133451.7083-1-geert+renesas@glider.be (mailing list archive)
State New, archived
Headers show
Series [PATCH/RFC] drivers/vfio: Allow type-1 IOMMU instantiation with Renesas IPMMU-VMSA | expand

Commit Message

Geert Uytterhoeven July 25, 2018, 1:34 p.m. UTC
The Renesas IPMMU-VMSA driver is compatible with the notion of a type-1
IOMMU in VFIO.

This patch allows guests to use the VFIO_IOMMU_TYPE1 API on hosts
equipped with a Renesas VMSA-compatible IPMMU.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
Lightly tested with sata_rcar on Renesas R-Car H3 ES2.0.

For testing, this patch and all prerequisites are available in the
topic/rcar3-virt-gpio-passthrough-v3 branch of my git repository at
git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers.git.
---
 drivers/vfio/Kconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Robin Murphy July 25, 2018, 1:48 p.m. UTC | #1
Hi Geert,

On 25/07/18 14:34, Geert Uytterhoeven wrote:
> The Renesas IPMMU-VMSA driver is compatible with the notion of a type-1
> IOMMU in VFIO.
> 
> This patch allows guests to use the VFIO_IOMMU_TYPE1 API on hosts
> equipped with a Renesas VMSA-compatible IPMMU.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> Lightly tested with sata_rcar on Renesas R-Car H3 ES2.0.
> 
> For testing, this patch and all prerequisites are available in the
> topic/rcar3-virt-gpio-passthrough-v3 branch of my git repository at
> git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers.git.
> ---
>   drivers/vfio/Kconfig | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/vfio/Kconfig b/drivers/vfio/Kconfig
> index c84333eb5eb59bef..a3e21e7c066596d7 100644
> --- a/drivers/vfio/Kconfig
> +++ b/drivers/vfio/Kconfig
> @@ -21,7 +21,8 @@ config VFIO_VIRQFD
>   menuconfig VFIO
>   	tristate "VFIO Non-Privileged userspace driver framework"
>   	depends on IOMMU_API
> -	select VFIO_IOMMU_TYPE1 if (X86 || S390 || ARM_SMMU || ARM_SMMU_V3)
> +	select VFIO_IOMMU_TYPE1 if (X86 || S390 || ARM_SMMU || ARM_SMMU_V3 || \
> +				    IPMMU_VMSA)

I recall this came up in the context of virtio-iommu too[1], wherein we 
decided that listing individual drivers was actually a bit silly and 
this should simply have ARM || ARM64 for consistency. Looks like there's 
even more justification now :)

Robin.

[1] https://www.mail-archive.com/kvmarm@lists.cs.columbia.edu/msg16235.html

>   	select ANON_INODES
>   	help
>   	  VFIO provides a framework for secure userspace device drivers.
>
diff mbox series

Patch

diff --git a/drivers/vfio/Kconfig b/drivers/vfio/Kconfig
index c84333eb5eb59bef..a3e21e7c066596d7 100644
--- a/drivers/vfio/Kconfig
+++ b/drivers/vfio/Kconfig
@@ -21,7 +21,8 @@  config VFIO_VIRQFD
 menuconfig VFIO
 	tristate "VFIO Non-Privileged userspace driver framework"
 	depends on IOMMU_API
-	select VFIO_IOMMU_TYPE1 if (X86 || S390 || ARM_SMMU || ARM_SMMU_V3)
+	select VFIO_IOMMU_TYPE1 if (X86 || S390 || ARM_SMMU || ARM_SMMU_V3 || \
+				    IPMMU_VMSA)
 	select ANON_INODES
 	help
 	  VFIO provides a framework for secure userspace device drivers.