linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] numa: enforce iommu-off memory address limit
@ 2007-06-15 17:33 Milton Miller
  2007-06-16  4:34 ` Michael Ellerman
  0 siblings, 1 reply; 2+ messages in thread
From: Milton Miller @ 2007-06-15 17:33 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: paulus


Don't short circuit the lmb_end_of_DRAM if iommu_is_off.

If linux,iommu-off is in /chosen (because iommu=off was on the command
line), we limit the memory when adding it to the lmbs and page tables,
but not when numa parses the device tree for numa affinity.  When we
free bootmem, we then try to use these pages without mapping them or
allocating supporting data structures resulting in bad_page and/or data
storage interrupts.

Signed-off-by: Milton Miller <miltonm@bga.com>
--- 
Paul, I think this can wait for 2.6.23 although its small enough
if you want to send it for 2.6.22.

Index: kernel/arch/powerpc/mm/numa.c
===================================================================
--- kernel.orig/arch/powerpc/mm/numa.c	2007-06-15 01:10:19.000000000 -0500
+++ kernel/arch/powerpc/mm/numa.c	2007-06-15 01:41:32.000000000 -0500
@@ -21,6 +21,7 @@
 #include <asm/lmb.h>
 #include <asm/system.h>
 #include <asm/smp.h>
+#include <asm/iommu.h>
 
 static int numa_enabled = 1;
 
@@ -286,7 +287,7 @@ static unsigned long __init numa_enforce
 	 * having memory holes below the limit.
 	 */
 
-	if (! memory_limit)
+	if (!memory_limit && !iommu_is_off)
 		return size;
 
 	if (start + size <= lmb_end_of_DRAM())

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

* Re: [PATCH] numa: enforce iommu-off memory address limit
  2007-06-15 17:33 [PATCH] numa: enforce iommu-off memory address limit Milton Miller
@ 2007-06-16  4:34 ` Michael Ellerman
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2007-06-16  4:34 UTC (permalink / raw)
  To: Milton Miller; +Cc: linuxppc-dev, paulus

[-- Attachment #1: Type: text/plain, Size: 1695 bytes --]

On Fri, 2007-06-15 at 12:33 -0500, Milton Miller wrote:
> Don't short circuit the lmb_end_of_DRAM if iommu_is_off.
> 
> If linux,iommu-off is in /chosen (because iommu=off was on the command
> line), we limit the memory when adding it to the lmbs and page tables,
> but not when numa parses the device tree for numa affinity.  When we
> free bootmem, we then try to use these pages without mapping them or
> allocating supporting data structures resulting in bad_page and/or data
> storage interrupts.
> 
> Signed-off-by: Milton Miller <miltonm@bga.com>
> --- 
> Paul, I think this can wait for 2.6.23 although its small enough
> if you want to send it for 2.6.22.
> 
> Index: kernel/arch/powerpc/mm/numa.c
> ===================================================================
> --- kernel.orig/arch/powerpc/mm/numa.c	2007-06-15 01:10:19.000000000 -0500
> +++ kernel/arch/powerpc/mm/numa.c	2007-06-15 01:41:32.000000000 -0500
> @@ -21,6 +21,7 @@
>  #include <asm/lmb.h>
>  #include <asm/system.h>
>  #include <asm/smp.h>
> +#include <asm/iommu.h>
>  
>  static int numa_enabled = 1;
>  
> @@ -286,7 +287,7 @@ static unsigned long __init numa_enforce
>  	 * having memory holes below the limit.
>  	 */
>  
> -	if (! memory_limit)
> +	if (!memory_limit && !iommu_is_off)
>  		return size;

I'd rather just remove the check entirely, and rename the routine -
numa_check_end_of_ram() or something.

cheers


-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

end of thread, other threads:[~2007-06-16  4:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-15 17:33 [PATCH] numa: enforce iommu-off memory address limit Milton Miller
2007-06-16  4:34 ` Michael Ellerman

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