diff mbox series

[PATCH/RFC,03/09] iommu/ipmmu-vmsa: Introduce keepipmmu boot parameter

Message ID 155067457726.15971.1787990365004385103.sendpatchset@octo (mailing list archive)
State Under Review
Delegated to: Geert Uytterhoeven
Headers show
Series IPMMU address translation enablement prototype | expand

Commit Message

Magnus Damm Feb. 20, 2019, 2:56 p.m. UTC
From: Magnus Damm <damm+renesas@opensource.se>

Introduce a keepipmmu boot paramenter to let the user override.

Not-Yet-Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
---

 drivers/iommu/ipmmu-vmsa.c |   14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

Comments

Geert Uytterhoeven Feb. 20, 2019, 7:54 p.m. UTC | #1
Hi Magnus,

On Wed, Feb 20, 2019 at 3:55 PM Magnus Damm <magnus.damm@gmail.com> wrote:
> From: Magnus Damm <damm+renesas@opensource.se>
>
> Introduce a keepipmmu boot paramenter to let the user override.
>
> Not-Yet-Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
> ---
>
>  drivers/iommu/ipmmu-vmsa.c |   14 +++++++++++++-
>  1 file changed, 13 insertions(+), 1 deletion(-)
>
> --- 0004/drivers/iommu/ipmmu-vmsa.c
> +++ work/drivers/iommu/ipmmu-vmsa.c     2019-02-20 23:17:54.038850305 +0900
> @@ -759,6 +759,17 @@ static int ipmmu_init_platform_device(st
>         return 0;
>  }
>
> +
> +static int keep_ipmmu;
> +
> +static int __init keepipmmu_setup(char *__unused)
> +{
> +       keep_ipmmu = 1;
> +       return 1;
> +}
> +
> +__setup("keepipmmu", keepipmmu_setup);

Documentation/admin-guide/kernel-parameters.txt shows other IOMMUs
implement binary parameters, which allow to override the default, to
disable or enable the IOMMU.

Perhaps you want the default to be enabled when running in HYP mode,
so the IPMMU can be used for KVM+VFIO device pass-through?

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
diff mbox series

Patch

--- 0004/drivers/iommu/ipmmu-vmsa.c
+++ work/drivers/iommu/ipmmu-vmsa.c	2019-02-20 23:17:54.038850305 +0900
@@ -759,6 +759,17 @@  static int ipmmu_init_platform_device(st
 	return 0;
 }
 
+
+static int keep_ipmmu;
+
+static int __init keepipmmu_setup(char *__unused)
+{
+	keep_ipmmu = 1;
+	return 1;
+}
+
+__setup("keepipmmu", keepipmmu_setup);
+
 static const struct soc_device_attribute soc_rcar_gen3[] = {
 	{ .soc_id = "r8a774a1", },
 	{ .soc_id = "r8a774c0", },
@@ -802,7 +813,8 @@  static bool ipmmu_slave_whitelist(struct
 	 * then assume the IPMMU will not be needed for address expansion.
 	 */
 	if (memblock_end_of_DRAM() <= SZ_4G)
-		return false;
+		if (!keep_ipmmu)
+			return false;
 	
 	/* Check whether this slave device can work with the IPMMU */
 	for (i = 0; i < ARRAY_SIZE(rcar_gen3_slave_whitelist); i++) {