linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH/RFC 00/09] IPMMU address translation enablement prototype
@ 2019-02-20 14:55 Magnus Damm
  2019-02-20 14:55 ` [PATCH/RFC 01/09] iommu/ipmmu-vmsa: Disable IPMMU when address expansion is not needed Magnus Damm
                   ` (8 more replies)
  0 siblings, 9 replies; 14+ messages in thread
From: Magnus Damm @ 2019-02-20 14:55 UTC (permalink / raw)
  To: linux-renesas-soc; +Cc: Magnus Damm

IPMMU address translation enablement prototype

[PATCH/RFC 01/09] iommu/ipmmu-vmsa: Disable IPMMU when address expansion is not needed
[PATCH/RFC 02/09] iommu/ipmmu-vmsa: Display system memory informationn during boot
[PATCH/RFC 03/09] iommu/ipmmu-vmsa: Introduce keepipmmu boot parameter
[PATCH/RFC 04/09] arm64: dts: renesas: ulcb: Introduce keepipmmu boot parameter
[PATCH/RFC 05/09] arm64: dts: renesas: salvator: Introduce keepipmmu boot parameter
[PATCH/RFC 06/09] arm64: dts: renesas: draak: Introduce keepipmmu boot parameter
[PATCH/RFC 07/09] arm64: dts: renesas: ebisu: Introduce keepipmmu boot parameter
[PATCH/RFC 08/09] arm64: dts: renesas: eagle: Introduce keepipmmu boot parameter
[PATCH/RFC 09/09] arm64: dts: renesas: cat874: Introduce keepipmmu boot parameter

These patches experiment with runtime detection of system memory amount
and location to check if all memory exists within 32 bits physical address
space or not. In case all memory exists within 32 bits then we can assume
address expansion via IPMMU will not be required so the white list code
will simply ignore enablement of IPMMU devices on systems with smaller
amounts of system memory.

Not intended for upstream merge however patch 1/9 might be not so far off.

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

 Developed on top of next-20190215

 arch/arm64/boot/dts/renesas/r8a774c0-cat874.dts  |    2 -
 arch/arm64/boot/dts/renesas/r8a77970-eagle.dts   |    2 -
 arch/arm64/boot/dts/renesas/r8a77990-ebisu.dts   |    2 -
 arch/arm64/boot/dts/renesas/r8a77995-draak.dts   |    2 -
 arch/arm64/boot/dts/renesas/salvator-common.dtsi |    2 -
 arch/arm64/boot/dts/renesas/ulcb.dtsi            |    2 -
 drivers/iommu/ipmmu-vmsa.c                       |   29 +++++++++++++++++++++-
 7 files changed, 34 insertions(+), 7 deletions(-)



^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH/RFC 01/09] iommu/ipmmu-vmsa: Disable IPMMU when address expansion is not needed
  2019-02-20 14:55 [PATCH/RFC 00/09] IPMMU address translation enablement prototype Magnus Damm
@ 2019-02-20 14:55 ` Magnus Damm
  2019-02-20 16:09   ` Geert Uytterhoeven
  2019-02-20 14:56 ` [PATCH/RFC 02/09] iommu/ipmmu-vmsa: Display system memory informationn during boot Magnus Damm
                   ` (7 subsequent siblings)
  8 siblings, 1 reply; 14+ messages in thread
From: Magnus Damm @ 2019-02-20 14:55 UTC (permalink / raw)
  To: linux-renesas-soc; +Cc: Magnus Damm

From: Magnus Damm <damm+renesas@opensource.se>

Add a memory bank location check to the whitelist handling.

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

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

--- 0001/drivers/iommu/ipmmu-vmsa.c
+++ work/drivers/iommu/ipmmu-vmsa.c	2019-02-20 22:59:28.589893396 +0900
@@ -17,6 +17,7 @@
 #include <linux/io.h>
 #include <linux/io-pgtable.h>
 #include <linux/iommu.h>
+#include <linux/memblock.h>
 #include <linux/of.h>
 #include <linux/of_device.h>
 #include <linux/of_iommu.h>
@@ -797,6 +798,12 @@ static bool ipmmu_slave_whitelist(struct
 	if (!soc_device_match(soc_rcar_gen3_whitelist))
 		return false;
 
+	/* In case all system memory fits within 32 bits of physical space
+	 * then assume the IPMMU will not be needed for address expansion.
+	 */
+	if (memblock_end_of_DRAM() <= SZ_4G)
+		return false;
+	
 	/* Check whether this slave device can work with the IPMMU */
 	for (i = 0; i < ARRAY_SIZE(rcar_gen3_slave_whitelist); i++) {
 		if (!strcmp(dev_name(dev), rcar_gen3_slave_whitelist[i]))

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH/RFC 02/09] iommu/ipmmu-vmsa: Display system memory informationn during boot
  2019-02-20 14:55 [PATCH/RFC 00/09] IPMMU address translation enablement prototype Magnus Damm
  2019-02-20 14:55 ` [PATCH/RFC 01/09] iommu/ipmmu-vmsa: Disable IPMMU when address expansion is not needed Magnus Damm
@ 2019-02-20 14:56 ` Magnus Damm
  2019-02-20 14:56 ` [PATCH/RFC 03/09] iommu/ipmmu-vmsa: Introduce keepipmmu boot parameter Magnus Damm
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 14+ messages in thread
From: Magnus Damm @ 2019-02-20 14:56 UTC (permalink / raw)
  To: linux-renesas-soc; +Cc: Magnus Damm

From: Magnus Damm <damm+renesas@opensource.se>

Clarify runtime memory bank detection in the IPMMU driver.

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

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

--- 0002/drivers/iommu/ipmmu-vmsa.c
+++ work/drivers/iommu/ipmmu-vmsa.c	2019-02-20 23:09:46.212274343 +0900
@@ -1095,6 +1095,14 @@ static int ipmmu_probe(struct platform_d
 			dev_info(&pdev->dev, "IPMMU context 0 is reserved\n");
 			set_bit(0, mmu->ctx);
 		}
+
+		if (memblock_end_of_DRAM() <= SZ_4G) {
+			dev_info(&pdev->dev, "All system memory located within 32 bits of physical address space.\n");
+			dev_info(&pdev->dev, "IPMMU address translation not needed.\n");
+		} else {
+			dev_info(&pdev->dev, "System memory detected outside 32 bits of physical address space.\n");
+			dev_info(&pdev->dev, "IPMMU address translation may be required.\n");
+		}		
 	}
 
 	/*

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH/RFC 03/09] iommu/ipmmu-vmsa: Introduce keepipmmu boot parameter
  2019-02-20 14:55 [PATCH/RFC 00/09] IPMMU address translation enablement prototype Magnus Damm
  2019-02-20 14:55 ` [PATCH/RFC 01/09] iommu/ipmmu-vmsa: Disable IPMMU when address expansion is not needed Magnus Damm
  2019-02-20 14:56 ` [PATCH/RFC 02/09] iommu/ipmmu-vmsa: Display system memory informationn during boot Magnus Damm
@ 2019-02-20 14:56 ` Magnus Damm
  2019-02-20 19:54   ` Geert Uytterhoeven
  2019-02-20 14:56 ` [PATCH/RFC 04/09] arm64: dts: renesas: ulcb: " Magnus Damm
                   ` (5 subsequent siblings)
  8 siblings, 1 reply; 14+ messages in thread
From: Magnus Damm @ 2019-02-20 14:56 UTC (permalink / raw)
  To: linux-renesas-soc; +Cc: Magnus Damm

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);
+
 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++) {

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH/RFC 04/09] arm64: dts: renesas: ulcb: Introduce keepipmmu boot parameter
  2019-02-20 14:55 [PATCH/RFC 00/09] IPMMU address translation enablement prototype Magnus Damm
                   ` (2 preceding siblings ...)
  2019-02-20 14:56 ` [PATCH/RFC 03/09] iommu/ipmmu-vmsa: Introduce keepipmmu boot parameter Magnus Damm
@ 2019-02-20 14:56 ` Magnus Damm
  2019-02-20 14:56 ` [PATCH/RFC 05/09] arm64: dts: renesas: salvator: " Magnus Damm
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 14+ messages in thread
From: Magnus Damm @ 2019-02-20 14:56 UTC (permalink / raw)
  To: linux-renesas-soc; +Cc: Magnus Damm

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>
---

 arch/arm64/boot/dts/renesas/ulcb.dtsi |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- 0001/arch/arm64/boot/dts/renesas/ulcb.dtsi
+++ work/arch/arm64/boot/dts/renesas/ulcb.dtsi	2019-02-20 23:23:07.594289512 +0900
@@ -26,7 +26,7 @@
 	};
 
 	chosen {
-		bootargs = "ignore_loglevel rw root=/dev/nfs ip=dhcp";
+		bootargs = "keepipmmu ignore_loglevel rw root=/dev/nfs ip=dhcp";
 		stdout-path = "serial0:115200n8";
 	};
 

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH/RFC 05/09] arm64: dts: renesas: salvator: Introduce keepipmmu boot parameter
  2019-02-20 14:55 [PATCH/RFC 00/09] IPMMU address translation enablement prototype Magnus Damm
                   ` (3 preceding siblings ...)
  2019-02-20 14:56 ` [PATCH/RFC 04/09] arm64: dts: renesas: ulcb: " Magnus Damm
@ 2019-02-20 14:56 ` Magnus Damm
  2019-02-20 14:56 ` [PATCH/RFC 06/09] arm64: dts: renesas: draak: " Magnus Damm
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 14+ messages in thread
From: Magnus Damm @ 2019-02-20 14:56 UTC (permalink / raw)
  To: linux-renesas-soc; +Cc: Magnus Damm

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>
---

 arch/arm64/boot/dts/renesas/salvator-common.dtsi |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- 0001/arch/arm64/boot/dts/renesas/salvator-common.dtsi
+++ work/arch/arm64/boot/dts/renesas/salvator-common.dtsi	2019-02-20 23:23:21.820035344 +0900
@@ -38,7 +38,7 @@
 	};
 
 	chosen {
-		bootargs = "ignore_loglevel rw root=/dev/nfs ip=dhcp";
+		bootargs = "keepipmmu ignore_loglevel rw root=/dev/nfs ip=dhcp";
 		stdout-path = "serial0:115200n8";
 	};
 

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH/RFC 06/09] arm64: dts: renesas: draak: Introduce keepipmmu boot parameter
  2019-02-20 14:55 [PATCH/RFC 00/09] IPMMU address translation enablement prototype Magnus Damm
                   ` (4 preceding siblings ...)
  2019-02-20 14:56 ` [PATCH/RFC 05/09] arm64: dts: renesas: salvator: " Magnus Damm
@ 2019-02-20 14:56 ` Magnus Damm
  2019-02-20 14:56 ` [PATCH/RFC 07/09] arm64: dts: renesas: ebisu: " Magnus Damm
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 14+ messages in thread
From: Magnus Damm @ 2019-02-20 14:56 UTC (permalink / raw)
  To: linux-renesas-soc; +Cc: Magnus Damm

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>
---

 arch/arm64/boot/dts/renesas/r8a77995-draak.dts |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- 0001/arch/arm64/boot/dts/renesas/r8a77995-draak.dts
+++ work/arch/arm64/boot/dts/renesas/r8a77995-draak.dts	2019-02-20 23:26:18.708309313 +0900
@@ -20,7 +20,7 @@
 	};
 
 	chosen {
-		bootargs = "ignore_loglevel";
+		bootargs = "keepipmmu ignore_loglevel";
 		stdout-path = "serial0:115200n8";
 	};
 

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH/RFC 07/09] arm64: dts: renesas: ebisu: Introduce keepipmmu boot parameter
  2019-02-20 14:55 [PATCH/RFC 00/09] IPMMU address translation enablement prototype Magnus Damm
                   ` (5 preceding siblings ...)
  2019-02-20 14:56 ` [PATCH/RFC 06/09] arm64: dts: renesas: draak: " Magnus Damm
@ 2019-02-20 14:56 ` Magnus Damm
  2019-02-20 14:57 ` [PATCH/RFC 08/09] arm64: dts: renesas: eagle: " Magnus Damm
  2019-02-20 14:57 ` [PATCH/RFC 09/09] arm64: dts: renesas: cat874: " Magnus Damm
  8 siblings, 0 replies; 14+ messages in thread
From: Magnus Damm @ 2019-02-20 14:56 UTC (permalink / raw)
  To: linux-renesas-soc; +Cc: Magnus Damm

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>
---

 arch/arm64/boot/dts/renesas/r8a77990-ebisu.dts |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- 0001/arch/arm64/boot/dts/renesas/r8a77990-ebisu.dts
+++ work/arch/arm64/boot/dts/renesas/r8a77990-ebisu.dts	2019-02-20 23:27:36.595392808 +0900
@@ -19,7 +19,7 @@
 	};
 
 	chosen {
-		bootargs = "ignore_loglevel";
+		bootargs = "keepipmmu ignore_loglevel";
 		stdout-path = "serial0:115200n8";
 	};
 

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH/RFC 08/09] arm64: dts: renesas: eagle: Introduce keepipmmu boot parameter
  2019-02-20 14:55 [PATCH/RFC 00/09] IPMMU address translation enablement prototype Magnus Damm
                   ` (6 preceding siblings ...)
  2019-02-20 14:56 ` [PATCH/RFC 07/09] arm64: dts: renesas: ebisu: " Magnus Damm
@ 2019-02-20 14:57 ` Magnus Damm
  2019-02-20 14:57 ` [PATCH/RFC 09/09] arm64: dts: renesas: cat874: " Magnus Damm
  8 siblings, 0 replies; 14+ messages in thread
From: Magnus Damm @ 2019-02-20 14:57 UTC (permalink / raw)
  To: linux-renesas-soc; +Cc: Magnus Damm

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>
---

 arch/arm64/boot/dts/renesas/r8a77970-eagle.dts |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- 0001/arch/arm64/boot/dts/renesas/r8a77970-eagle.dts
+++ work/arch/arm64/boot/dts/renesas/r8a77970-eagle.dts	2019-02-20 23:28:58.798702585 +0900
@@ -19,7 +19,7 @@
 	};
 
 	chosen {
-		bootargs = "ignore_loglevel rw root=/dev/nfs ip=dhcp";
+		bootargs = "keepipmmu ignore_loglevel rw root=/dev/nfs ip=dhcp";
 		stdout-path = "serial0:115200n8";
 	};
 

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH/RFC 09/09] arm64: dts: renesas: cat874: Introduce keepipmmu boot parameter
  2019-02-20 14:55 [PATCH/RFC 00/09] IPMMU address translation enablement prototype Magnus Damm
                   ` (7 preceding siblings ...)
  2019-02-20 14:57 ` [PATCH/RFC 08/09] arm64: dts: renesas: eagle: " Magnus Damm
@ 2019-02-20 14:57 ` Magnus Damm
  8 siblings, 0 replies; 14+ messages in thread
From: Magnus Damm @ 2019-02-20 14:57 UTC (permalink / raw)
  To: linux-renesas-soc; +Cc: Magnus Damm

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>
---

 arch/arm64/boot/dts/renesas/r8a774c0-cat874.dts |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- 0001/arch/arm64/boot/dts/renesas/r8a774c0-cat874.dts
+++ work/arch/arm64/boot/dts/renesas/r8a774c0-cat874.dts	2019-02-20 23:30:12.806582698 +0900
@@ -18,7 +18,7 @@
 	};
 
 	chosen {
-		bootargs = "ignore_loglevel rw root=/dev/nfs ip=dhcp";
+		bootargs = "keepipmmu ignore_loglevel rw root=/dev/nfs ip=dhcp";
 		stdout-path = "serial0:115200n8";
 	};
 

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH/RFC 01/09] iommu/ipmmu-vmsa: Disable IPMMU when address expansion is not needed
  2019-02-20 14:55 ` [PATCH/RFC 01/09] iommu/ipmmu-vmsa: Disable IPMMU when address expansion is not needed Magnus Damm
@ 2019-02-20 16:09   ` Geert Uytterhoeven
  2019-03-19 13:45     ` Magnus Damm
  0 siblings, 1 reply; 14+ messages in thread
From: Geert Uytterhoeven @ 2019-02-20 16:09 UTC (permalink / raw)
  To: Magnus Damm; +Cc: Linux-Renesas

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>
>
> Add a memory bank location check to the whitelist handling.
>
> Signed-off-by: Magnus Damm <damm+renesas@opensource.se>

Thanks for your patch!

> --- 0001/drivers/iommu/ipmmu-vmsa.c
> +++ work/drivers/iommu/ipmmu-vmsa.c     2019-02-20 22:59:28.589893396 +0900

> @@ -797,6 +798,12 @@ static bool ipmmu_slave_whitelist(struct
>         if (!soc_device_match(soc_rcar_gen3_whitelist))
>                 return false;
>
> +       /* In case all system memory fits within 32 bits of physical space
> +        * then assume the IPMMU will not be needed for address expansion.
> +        */
> +       if (memblock_end_of_DRAM() <= SZ_4G)

Can this give a compiler warning on arm32 when CONFIG_ARM_LPAE=n?

> +               return false;
> +
>         /* Check whether this slave device can work with the IPMMU */
>         for (i = 0; i < ARRAY_SIZE(rcar_gen3_slave_whitelist); i++) {
>                 if (!strcmp(dev_name(dev), rcar_gen3_slave_whitelist[i]))

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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH/RFC 03/09] iommu/ipmmu-vmsa: Introduce keepipmmu boot parameter
  2019-02-20 14:56 ` [PATCH/RFC 03/09] iommu/ipmmu-vmsa: Introduce keepipmmu boot parameter Magnus Damm
@ 2019-02-20 19:54   ` Geert Uytterhoeven
  0 siblings, 0 replies; 14+ messages in thread
From: Geert Uytterhoeven @ 2019-02-20 19:54 UTC (permalink / raw)
  To: Magnus Damm; +Cc: Linux-Renesas

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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH/RFC 01/09] iommu/ipmmu-vmsa: Disable IPMMU when address expansion is not needed
  2019-02-20 16:09   ` Geert Uytterhoeven
@ 2019-03-19 13:45     ` Magnus Damm
  2019-03-19 14:07       ` Geert Uytterhoeven
  0 siblings, 1 reply; 14+ messages in thread
From: Magnus Damm @ 2019-03-19 13:45 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Linux-Renesas

Hi Geert,
On Thu, Feb 21, 2019 at 1:10 AM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
>
> 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>
> >
> > Add a memory bank location check to the whitelist handling.
> >
> > Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
>
> Thanks for your patch!

Thanks for feedback!

> > --- 0001/drivers/iommu/ipmmu-vmsa.c
> > +++ work/drivers/iommu/ipmmu-vmsa.c     2019-02-20 22:59:28.589893396 +0900
>
> > @@ -797,6 +798,12 @@ static bool ipmmu_slave_whitelist(struct
> >         if (!soc_device_match(soc_rcar_gen3_whitelist))
> >                 return false;
> >
> > +       /* In case all system memory fits within 32 bits of physical space
> > +        * then assume the IPMMU will not be needed for address expansion.
> > +        */
> > +       if (memblock_end_of_DRAM() <= SZ_4G)
>
> Can this give a compiler warning on arm32 when CONFIG_ARM_LPAE=n?

Not sure how, can you elaborate?

To test this I actually installed a new arm32 compiler but I failed to
trigger any warnings.

Thanks,

/ magnus

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH/RFC 01/09] iommu/ipmmu-vmsa: Disable IPMMU when address expansion is not needed
  2019-03-19 13:45     ` Magnus Damm
@ 2019-03-19 14:07       ` Geert Uytterhoeven
  0 siblings, 0 replies; 14+ messages in thread
From: Geert Uytterhoeven @ 2019-03-19 14:07 UTC (permalink / raw)
  To: Magnus Damm; +Cc: Linux-Renesas

Hi Magnus,

On Tue, Mar 19, 2019 at 2:45 PM Magnus Damm <magnus.damm@gmail.com> wrote:
> On Thu, Feb 21, 2019 at 1:10 AM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> > On Wed, Feb 20, 2019 at 3:55 PM Magnus Damm <magnus.damm@gmail.com> wrote:
> > > --- 0001/drivers/iommu/ipmmu-vmsa.c
> > > +++ work/drivers/iommu/ipmmu-vmsa.c     2019-02-20 22:59:28.589893396 +0900
> >
> > > @@ -797,6 +798,12 @@ static bool ipmmu_slave_whitelist(struct
> > >         if (!soc_device_match(soc_rcar_gen3_whitelist))
> > >                 return false;
> > >
> > > +       /* In case all system memory fits within 32 bits of physical space
> > > +        * then assume the IPMMU will not be needed for address expansion.
> > > +        */
> > > +       if (memblock_end_of_DRAM() <= SZ_4G)
> >
> > Can this give a compiler warning on arm32 when CONFIG_ARM_LPAE=n?
>
> Not sure how, can you elaborate?

SZ_4G is 0x100000000ULL, which is always 64-bit.
memblock_end_of_DRAM() returns a physaddr_t, which is 32-bit if
CONFIG_ARM_LPAE=n, in which case the comparison is always true.

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

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2019-03-19 14:08 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-20 14:55 [PATCH/RFC 00/09] IPMMU address translation enablement prototype Magnus Damm
2019-02-20 14:55 ` [PATCH/RFC 01/09] iommu/ipmmu-vmsa: Disable IPMMU when address expansion is not needed Magnus Damm
2019-02-20 16:09   ` Geert Uytterhoeven
2019-03-19 13:45     ` Magnus Damm
2019-03-19 14:07       ` Geert Uytterhoeven
2019-02-20 14:56 ` [PATCH/RFC 02/09] iommu/ipmmu-vmsa: Display system memory informationn during boot Magnus Damm
2019-02-20 14:56 ` [PATCH/RFC 03/09] iommu/ipmmu-vmsa: Introduce keepipmmu boot parameter Magnus Damm
2019-02-20 19:54   ` Geert Uytterhoeven
2019-02-20 14:56 ` [PATCH/RFC 04/09] arm64: dts: renesas: ulcb: " Magnus Damm
2019-02-20 14:56 ` [PATCH/RFC 05/09] arm64: dts: renesas: salvator: " Magnus Damm
2019-02-20 14:56 ` [PATCH/RFC 06/09] arm64: dts: renesas: draak: " Magnus Damm
2019-02-20 14:56 ` [PATCH/RFC 07/09] arm64: dts: renesas: ebisu: " Magnus Damm
2019-02-20 14:57 ` [PATCH/RFC 08/09] arm64: dts: renesas: eagle: " Magnus Damm
2019-02-20 14:57 ` [PATCH/RFC 09/09] arm64: dts: renesas: cat874: " Magnus Damm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).